Commit c7256f57 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tun: initialize napi_mutex unconditionally

This is the first part to fix following syzbot report :

console output:
kernel config:
dashboard link:

Following patch is fixing the race condition, but it seems safer
to initialize this mutex at tfile creation anyway.

Fixes: 90e33d45

 ("tun: enable napi_gro_frags() for TUN/TAP driver")
Signed-off-by: default avatarEric Dumazet <>
Reported-by: default avatar <>
Signed-off-by: default avatarDavid S. Miller <>
parent 06e55add
......@@ -320,7 +320,6 @@ static void tun_napi_init(struct tun_struct *tun, struct tun_file *tfile,
netif_napi_add(tun->dev, &tfile->napi, tun_napi_poll,
......@@ -3199,6 +3198,7 @@ static int tun_chr_open(struct inode *inode, struct file * file)
return -ENOMEM;
tfile->flags = 0;
tfile->ifindex = 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment