deepin-kernel/net/llc
Ilia Gavrilov 99ee2d9cf5 llc: fix data loss when reading from a socket in llc_ui_recvmsg()
commit 239af1970b upstream.

For SOCK_STREAM sockets, if user buffer size (len) is less
than skb size (skb->len), the remaining data from skb
will be lost after calling kfree_skb().

To fix this, move the statement for partial reading
above skb deletion.

Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org)

Fixes: 30a584d944 ("[LLX]: SOCK_DGRAM interface fixes")
Cc: stable@vger.kernel.org
Signed-off-by: Ilia Gavrilov <Ilia.Gavrilov@infotecs.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4cfe30f681a3df21b77f3d4c668069d6d0cf9840)
2025-06-10 16:18:04 +08:00
..
Kconfig net: remove redundant 'depends on NET' 2021-01-27 17:04:12 -08:00
Makefile
af_llc.c llc: fix data loss when reading from a socket in llc_ui_recvmsg() 2025-06-10 16:18:04 +08:00
llc_c_ac.c llc/snap: constify dev_addr passing 2021-10-13 09:40:46 -07:00
llc_c_ev.c net: llc: Correct some function names in header 2021-03-26 15:24:14 -07:00
llc_c_st.c
llc_conn.c net/llc/llc_conn.c: fix 4 instances of -Wmissing-variable-declarations 2023-08-09 15:34:28 -07:00
llc_core.c llc: Drop support for ETH_P_TR_802_2. 2024-01-31 16:19:01 -08:00
llc_if.c llc: Check netns in llc_estab_match() and llc_listener_match(). 2023-07-20 10:46:28 +02:00
llc_input.c net: llc: reset skb->transport_header 2025-01-13 11:06:44 +08:00
llc_output.c llc/snap: constify dev_addr passing 2021-10-13 09:40:46 -07:00
llc_pdu.c net: llc: Correct function name llc_pdu_set_pf_bit() in header 2021-03-26 15:24:14 -07:00
llc_proc.c sock: Use sock_owned_by_user_nocheck() instead of sk_lock.owned. 2021-12-10 19:43:00 -08:00
llc_s_ac.c llc: do not use skb_get() before dev_queue_xmit() 2025-03-18 15:20:51 +08:00
llc_s_ev.c
llc_s_st.c
llc_sap.c llc: Check netns in llc_dgram_match(). 2023-07-20 10:46:28 +02:00
llc_station.c llc: verify mac len before reading mac header 2023-11-20 11:59:34 +01:00
sysctl_net_llc.c