Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: llc: fix use after free in llc_ui_recvmsg
While commit 30a584d fixes datagram interface in LLC, a use after free bug has been introduced for SOCK_STREAM sockets that do not make use of MSG_PEEK. The flow is as follow ... if (!(flags & MSG_PEEK)) { ... sk_eat_skb(sk, skb, false); ... } ... if (used + offset < skb->len) continue; ... where sk_eat_skb() calls __kfree_skb(). Therefore, cache original length and work on skb_len to check partial reads. Fixes: 30a584d ("[LLX]: SOCK_DGRAM interface fixes") Signed-off-by: Daniel Borkmann <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information