Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 29 Jan 2021 02:10:20 +0800
From: butt3rflyh4ck <>
Subject: Linux kernel: linux-block: nbd: use-after-free Read in nbd_queue_rq

Hi, I reported a use-after-free Read bug in ndb_queue_rq() in
drivers/block/nbd.c and reproduced in linux-5.11.0-rc4+ too.

Root Cause:

There is a race condition in nbd ioctl.
NBD_SET_SIZE_BLOCKS ioctl will call nbd_size_set(), it will change the
block size.
NBD_SET_SOCK ioctl will call nbd_add_socket() and it will invoke
krealloc() to update a block, free and realloc a new one.
But nbd_queue_rq() is in runtime. and calls nbd_handle_cmd(), there
will use config->sock. there accesses to config->socks without any locking.

Patch for this issue:

CVE assigned:
not assigned.

*2021/1/25  - Vulnerability reported to
*2020/1/26  - Vulnerability confirmed and patched.
*2020/1/28 - Vulnerability reported to
*2021/1/29 - Opened on

This issue was discovered by the ADLab of venustech.


Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.