From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796014494; b=lRuHGe2NjTtC/ssVITR7KpbBRI2Efk/iUsSzRHOym9sJFm159zV7iAcDO8h03GavZHLK fOc/BuTrH/MYfNGuJhRx05ZD5Oe6IvPsfIaB8D8LYBKCz+ku8gXcE6fNE6rCgcPQrXykD 8ht8w0hq4OtcGoLQChCTMLsj2LDEIE/O9hBE/2iVRUv16oyB2ba+311O3QLylMZaa+NDZ 2X/A2FPU2xXsZhRaDV+gYsip/wbZWHI7eXwDFfQ4T8bIJcYJqVLd146RLw9U1JK64/dU0 2VjpEoVmovP4DSEp/f9T8BVKlR5djsz3VJ3Rv34HYolBsCa8Y0IAWKyWMiR65QUM5Yw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796014494; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:Organization: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=sWfHyH2B5QEpqGUUCWhoC6Sgs3nYpVx2yNMYeiu0g08=; b=P/qqJtU7+ucFqqxrHrjnsOH/MCEKD1APU1dTJYh0YppwgEwdcQB9tHHpI6XMoRg0aXq9 +UEfo0LQtcdjT0ymHAAqXuRoOg/aLnTJ1fCBxs0u/7sTc8hYkXP++9ZNFxWUxwmbxlMbx mze4kX0Q5HIXAWDdg8jr5TarDCSSxn809tU/1Z099+DWGS+mmiJvsnX6w5pTz4h8Owya8 dBkb2CFm+TOTyZvDQovjlZ3MKraEqUx63aKk53LJxj0BLFqCy34M7zsXVKgsLvc0VdDPT 7T+cVfd1sBk3sN45LVmZfTcJMOHPEi/TxnwPGqtUezWpZU90QSvdrpesFFThp4hXp/g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nIbuvbDt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C177C606A31C; Mon, 30 Nov 2026 04:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nIbuvbDt Received: by smtp.kernel.org (Postfix) with ESMTPSA id C93C61F00896; Mon, 30 Nov 2026 04:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796014494; bh=sWfHyH2B5QEpqGUUCWhoC6Sgs3nYpVx2yNMYeiu0g08=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=nIbuvbDtX7mDWBP0WGz/GAoegVcaxaFs67L3rxTlgMswHitZIb3GOa5ZFskb1zise HX5TrNjqfJUpXazTffTrSekUlQFYJjeoKCasxoELG8OXZLNfUuD1kouXVGNZvp3lbr FhK/0/BD2zgzx0iWNCjbg/UUvlM32uDAPFjiOgc9wSXsq09imhMF03Qt0Vnd0SPoTg aCdwMf3VnKlIZN+Hmc0jh3STXYH1aKTcyjXBCJAwzzzrkRAMmQtH1F4POm49xK1XUF E2qJq55vggTl1Y8sPqFO8DJ5vcq0QVBOjSbEC889zCjs83Dg8ZRkSLYFuBKNM3uQiL DpfRp8xYl140Q== Message-ID: Date: Mon, 30 Nov 2026 13:54:52 +0900 X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/4] null_blk: validate the configfs home_node attribute To: Yingjie Wang , "axboe@kernel.dk" Cc: "linux-block@vger.kernel.org" , "stable@vger.kernel.org" References: <20261127125738.1654012-1-x-professor@outlook.com> <20261127125738.1654012-5-x-professor@outlook.com> From: Damien Le Moal Content-Language: en-US Organization: Western Digital Research In-Reply-To: <20261127125738.1654012-5-x-professor@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 Reviewed-by: Damien Le Moal