]> git.infradead.org Git - users/hch/xfs.git/commit
io_uring/net: check socket is valid in io_bind()/io_listen()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Sat, 13 Jul 2024 10:05:02 +0000 (19:05 +0900)
committerJens Axboe <axboe@kernel.dk>
Sat, 13 Jul 2024 12:40:15 +0000 (06:40 -0600)
commitad00e629145b2b9f0d78aa46e204a9df7d628978
treead98f39fc977024e6dc5c504bc44f189baed7861
parent943ad0b62e3c21f324c4884caa6cb4a871bca05c
io_uring/net: check socket is valid in io_bind()/io_listen()

We need to check that sock_from_file(req->file) != NULL.

Reported-by: syzbot <syzbot+1e811482aa2c70afa9a0@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=1e811482aa2c70afa9a0
Fixes: 7481fd93fa0a ("io_uring: Introduce IORING_OP_BIND")
Fixes: ff140cc8628a ("io_uring: Introduce IORING_OP_LISTEN")
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Link: https://lore.kernel.org/r/903da529-eaa3-43ef-ae41-d30f376c60cc@I-love.SAKURA.ne.jp
[axboe: move assignment of sock to where the NULL check is]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c