All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yingjie Wang <x-professor@outlook.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v3 4/4] null_blk: validate the configfs home_node attribute
Date: Mon, 30 Nov 2026 13:54:52 +0900	[thread overview]
Message-ID: <e25ab395-37ad-4ff5-897d-e4fa391a9dbf@kernel.org> (raw)
In-Reply-To: <20261127125738.1654012-5-x-professor@outlook.com>

On 11/27/26 21:59, Yingjie Wang wrote:
> The home_node module parameter is checked at module initialization, but
> the configfs home_node attribute is stored without any validation.
> Powering on the device then passes the value to kzalloc_node() and uses
> it as the tag set NUMA node.
> 
> With CONFIG_NUMA enabled, writing 2147483647 to home_node and then 1 to
> power makes SLUB use that node ID as an index into kmem_cache's
> per_node[] array, causing an out-of-bounds read:
> 
>   BUG: unable to handle page fault for address: ffff88880b042e80
>   #PF: supervisor read access in kernel mode
>   RIP: 0010:___slab_alloc+0x5ad/0x760
>   Call Trace:
>    __kmalloc_cache_node_noprof+0x2dc/0x600
>    null_add_dev+0x588/0x1e70 [null_blk]
>    nullb_device_power_store+0x29d/0x350 [null_blk]
>    configfs_write_iter+0x306/0x500
>    vfs_write+0x6a4/0x1030
>    ksys_write+0x12a/0x250
> 
> Reject home_node values other than NUMA_NO_NODE that do not name an
> online node in null_validate_conf(), before any allocation uses the
> value. Checking against nr_node_ids alone is not sufficient, because
> node IDs below it need not be possible when node numbering is sparse.
> This matches the validation done for the PCI numa_node sysfs attribute.
> 
> This bug was found by a fuzzer.
> 
> Fixes: cedcafad8277 ("nullb: add interface to power on disk")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yingjie Wang <x-professor@outlook.com>

Reviewed-by: Damien Le Moal <dlemoal@kernel.org.


-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2026-11-30  4:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 12:57 [PATCH v3 0/4] null_blk: validate configfs values before power-on Yingjie Wang
2026-11-27 12:58 ` [PATCH v3 1/4] block: move BLK_DEV_MAX_SECTORS to <linux/blkdev.h> Yingjie Wang
2026-11-30  4:50   ` Damien Le Moal
2026-11-27 12:58 ` [PATCH v3 2/4] null_blk: reject device size overflow Yingjie Wang
2026-11-30  4:52   ` Damien Le Moal
2026-11-27 12:58 ` [PATCH v3 3/4] null_blk: reject zone counts that overflow unsigned int Yingjie Wang
2026-11-30  4:54   ` Damien Le Moal
2026-11-27 12:59 ` [PATCH v3 4/4] null_blk: validate the configfs home_node attribute Yingjie Wang
2026-11-30  4:54   ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e25ab395-37ad-4ff5-897d-e4fa391a9dbf@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=x-professor@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.