]> 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:18:52 +0000 (10:18 +0100)
commitf5bbdde60ad1a536974af61ee269c1a45612763e
tree988226ccb808c0066de6da5966d0257ef0de19c2
parent471186632170f46aeb66d4996b8089e0474a1b5d
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