deepin-kernel/net/phonet
Nathan Chancellor da9b374384 phonet/pep: Move call to pn_skb_get_dst_sockaddr() earlier in pep_sock_accept()
commit 17ba793f381eb813596d6de1cc6820bcbda5ed8b upstream.

A new warning in clang [1] points out a place in pep_sock_accept() where
dst is uninitialized then passed as a const pointer to pep_find_pipe():

  net/phonet/pep.c:829:37: error: variable 'dst' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
    829 |         newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle);
        |                                            ^~~:

Move the call to pn_skb_get_dst_sockaddr(), which initializes dst, to
before the call to pep_find_pipe(), so that dst is consistently used
initialized throughout the function.

Cc: stable@vger.kernel.org
Fixes: f7ae8d59f6 ("Phonet: allocate sock from accept syscall rather than soft IRQ")
Link: 00dacf8c22 [1]
Closes: https://github.com/ClangBuiltLinux/linux/issues/2101
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20250715-net-phonet-fix-uninit-const-pointer-v1-1-8efd1bd188b3@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 29db3339db0ed3097d4067e222981b08138d774d)
2025-07-28 15:19:02 +08:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
af_phonet.c phonet: Use netif_rx(). 2022-03-07 11:40:41 +00:00
datagram.c phonet: take correct lock to peek at the RX queue 2024-03-01 13:35:10 +01:00
pep-gprs.c net/sock: Introduce trace_sk_data_ready() 2023-01-23 11:26:50 +00:00
pep.c phonet/pep: Move call to pn_skb_get_dst_sockaddr() earlier in pep_sock_accept() 2025-07-28 15:19:02 +08:00
pn_dev.c net: Remove redundant if statements 2021-08-05 13:27:50 +01:00
pn_netlink.c phonet: Handle error of rtnl_register_module(). 2024-12-10 20:42:48 +08:00
socket.c sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES) 2023-06-24 15:50:13 -07:00
sysctl.c sysctl: pass kernel pointers to ->proc_handler 2020-04-27 02:07:40 -04:00