io_uring/nop: ensure nop->fd is always initialized
authorJens Axboe <axboe@kernel.dk>
Thu, 21 Nov 2024 14:12:17 +0000 (07:12 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Nov 2024 14:15:30 +0000 (07:15 -0700)
commitee116574de8415b0673c466e6cd28ba5f70c41a2
treeec30acea91f145e2eb9e5852a9b78117b1eccff2
parentf46b9cdb22f7a167c36b6bcddaef7e8aee2598fa
io_uring/nop: ensure nop->fd is always initialized

A previous commit added file support for nop, but it only initializes
nop->fd if IORING_NOP_FIXED_FILE is set. That check should be
IORING_NOP_FILE. Fix up the condition in nop preparation, and initialize
it to a sane value even if we're not going to be directly using it.

While in there, do the same thing for the nop->buffer field.

Reported-by: syzbot+9a8500a45c2cabdf9577@syzkaller.appspotmail.com
Fixes: a85f31052bce ("io_uring/nop: add support for testing registered files and buffers")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/nop.c