Re: [PATCH] tun: fix mismatch in mutex lock-unlock in tun_get_user()

From: David Miller
Date: Mon Feb 19 2018 - 11:15:08 EST


From: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>
Date: Sat, 17 Feb 2018 01:11:55 +0300

> There is a single error path where tfile->napi_mutex is left unlocked.
> It can lead to a deadlock.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>

As Eric explained, tun_napi_frags_enabled() (and therefore 'frags')
will never be true for TUN devices, which is the type handled by this
code path.