Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

atm: clip: prevent NULL deref in clip_push()

Blamed commit missed that vcc_destroy_socket() calls
clip_push() with a NULL skb.

If clip_devs is NULL, clip_push() then crashes when reading
skb->truesize.

Fixes: 93a2014afbac ("atm: fix a UAF in lec_arp_clear_vccs()")
Reported-by: syzbot+1316233c4c6803382a8b@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/68556f59.a00a0220.137b3.004e.GAE@google.com/T/#u
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Gengming Liu <l.dmxcsnsbh@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
b993ea46 302251f1

+5 -6
+5 -6
net/atm/clip.c
··· 193 193 194 194 pr_debug("\n"); 195 195 196 - if (!clip_devs) { 197 - atm_return(vcc, skb->truesize); 198 - kfree_skb(skb); 199 - return; 200 - } 201 - 202 196 if (!skb) { 203 197 pr_debug("removing VCC %p\n", clip_vcc); 204 198 if (clip_vcc->entry) ··· 202 208 return; 203 209 } 204 210 atm_return(vcc, skb->truesize); 211 + if (!clip_devs) { 212 + kfree_skb(skb); 213 + return; 214 + } 215 + 205 216 skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs; 206 217 /* clip_vcc->entry == NULL if we don't have an IP address yet */ 207 218 if (!skb->dev) {