]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tun: honor IOCB_NOWAIT flag
authorJens Axboe <axboe@kernel.dk>
Fri, 20 Nov 2020 14:59:54 +0000 (07:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Dec 2020 09:42:00 +0000 (10:42 +0100)
commit6d568992ab78f4b819984c188e21f76de784081a
tree1428aeab51cb3af48385c412fa3e246aa386a67d
parentbd2585b7c821bfc81f7badbf04634d6cb988c722
tun: honor IOCB_NOWAIT flag

[ Upstream commit 5aac0390a63b8718237a61dd0d24a29201d1c94a ]

tun only checks the file O_NONBLOCK flag, but it should also be checking
the iocb IOCB_NOWAIT flag. Any fops using ->read/write_iter() should check
both, otherwise it breaks users that correctly expect O_NONBLOCK semantics
if IOCB_NOWAIT is set.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/e9451860-96cc-c7c7-47b8-fe42cadd5f4c@kernel.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/tun.c