Skip to content
Commit 239af197 authored by Ilia Gavrilov's avatar Ilia Gavrilov Committed by David S. Miller
Browse files

llc: fix data loss when reading from a socket in llc_ui_recvmsg()



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: 30a584d9 ("[LLX]: SOCK_DGRAM interface fixes")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarIlia Gavrilov <Ilia.Gavrilov@infotecs.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c46286fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment