From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=34.202.193.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795928175; b=HYNAwhnRFuqeX7x6LlfgfCSHPegYTkNh6kj7HEPASz6SqFz80Ywdis3y7BT73ZOyfctg W2W3HN9jN//iYTZMasPpQo1FBDZTDfoLR9TB3n9J2W1xp5WwULWrsg0jLIOP6LJSg1osd 9cAM8J2kSvV5LYdTJSn2jz4a3qkNb+OfTcf2j5zWSVfBqHo4DjY7J9dsh166GPiD5T6zt l8+Ah8KuOFuKEUov0Z3o0Dwk691RVT5BCQd3nJe8A66v2zbEkQ73oILA+g54dXVC2bRlj TZZvE+saZSpBeH2p3K/RqBWbLJx9yQp2mR4H/Q6+sd/lLjqTPCajyK7J+DLyqPII0sg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795928175; h=DMARC-Filter:DKIM-Signature:DKIM-Signature:Feedback-ID: X-Pm-Original-To:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding: X-MIME-Autoconverted:Content-Type; bh=W84AKdVJf1e00TxPnWPxmXQtPErxsZgtzSzSqAOOdJU=; b=aqPzTtTHD03vriniPjspUosi76ZYt8WofNf9mjL3Q7t3c4afaG7Go/dCrRCa1Hyy4meg dH6w7JByoA/XQlKovP2jwsA2cHekAkw9KhGvi2Q8hvuTLEwzcbKKffZJ/Z44HzDIoHD+A Q+5DojKIjXONK3FCzD0bhpOQYzSlAsI+kcg95ewgx+q7vkQmWEY5JQEqeeQjNxqanEnzt d5b0J4Cza1tKsiTOwQgU30rYbgP22SX7Bvtdekgwhs9PuLFzZTdS8s/HAhJE0Fuyd9FY0 ECPT7TyY7Cb1t6wOVBPEizSABMsMHnHQDALgyD08Dx/8QGvvLdKEBTy1TzcvBcZPTNw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; dkim=pass header.d=atomlin.com header.i=@atomlin.com header.a=rsa-sha256 header.s=purelymail3 header.b=iMnVrp0T; dkim=pass header.d=purelymail.com header.i=@purelymail.com header.a=rsa-sha256 header.s=purelymail3 header.b=t9dvOMNd; arc=none smtp.remote-ip=34.202.193.197 Received: from sendmail.purelymail.com (sendmail.purelymail.com [34.202.193.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7C02606A31C for ; Sun, 29 Nov 2026 04:56:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D7C02606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=atomlin.com header.i=@atomlin.com header.a=rsa-sha256 header.s=purelymail3 header.b=iMnVrp0T; dkim=pass (2048-bit key, unprotected) header.d=purelymail.com header.i=@purelymail.com header.a=rsa-sha256 header.s=purelymail3 header.b=t9dvOMNd DKIM-Signature: a=rsa-sha256; b=iMnVrp0T20YaLh3QhtSnt2SAR/zDt7WmhPvTGMvmUbiRudaAO6yYQL5S9UAcX342eMGyQy7+X7nQaCQAUSyzvjL32VZgxLHltgnA3jqPqZ/Srrawn2Q0mzxrcfljH6/g46RXUUz5Ng1eG43T8hxt7Js3s+EaeMIRCX56Oe20IdvBxVwWcOG4AJl2Et/UfDNMZylRSBgA8me+OiHd3GbVCRq0B+5wBj8fu0H+jRuwQzkCJ4rnRZ2FGxbIRYUv6QXGm0UXonLcnGL5RVJO5mdDwyESfyKUBMiDGbk0ALOiVQVuch1ZSO+QmaVxBhdIRJwTN0tOV1LT3nP7BnPLOgbp8Q==; s=purelymail3; d=atomlin.com; v=1; bh=W84AKdVJf1e00TxPnWPxmXQtPErxsZgtzSzSqAOOdJU=; h=Received:From:To:Subject:Date:Message-ID; DKIM-Signature: a=rsa-sha256; b=t9dvOMNdSrcb0+W75fTKMtvzNRCJbl5/1wWptvGbEJyBtiC0Alnes6n8Xh72b1Z3UhwHZ65fnDoJUJl1VCGua6+cMDHk2Hx8G+37b+lQxwEYZyeCpZWhBdW9QQA6e7Ss9v/9NFWS8BafC3e14cvunU6BtdJxKu4Ou+zD1yEZ6R43E4X7GbNX0bZRxF4LS7ast6P7LRwWsk0HpaLQWsqNp8jvhXaNIsbx4U9cQWEXebd7PAhFEMaiC+StMYVYy1LOvb0d+VSSNRY8ymcCln4545WeccO4Na89Efg789OwTTCJP5HHjEFKSkSvL+qJFKzDkMfv/VB/XkhHOWzOkqR6MQ==; s=purelymail3; d=purelymail.com; v=1; bh=W84AKdVJf1e00TxPnWPxmXQtPErxsZgtzSzSqAOOdJU=; h=Feedback-ID:Received:From:To:Subject:Date:Message-ID; Feedback-ID: 1802931:67223:null:purelymail X-Pm-Original-To: linux-doc@vger.kernel.org Authentication-Results: purelymail.com; auth=pass Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -527146303; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 29 Nov 2026 04:54:41 +0000 (UTC) From: Aaron Tomlin To: axboe@kernel.dk, tglx@kernel.org, aacraid@microsemi.com, James.Bottomley@HansenPartnership.com, mkp@kernel.org, frederic@kernel.org, bigeasy@linutronix.de, gmaglione@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, miklos@szeredi.hu Cc: atomlin@atomlin.com, dwagner@suse.de, eperezma@redhat.com, tom.leiming@gmail.com, ionut.nechita@windriver.com, corbet@lwn.net, vincent.guittot@linaro.org, mingo@redhat.com, peterz@infradead.org, radu@rendec.net, akpm@linux-foundation.org, steve@abita.co, sean@ashe.io, chjohnst@gmail.com, neelx@suse.com, mproche@gmail.com, nick.lange@gmail.com, marco.crivellari@suse.com, rishil1999@outlook.com, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, virtualization@lists.linux.dev, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v17 04/10] sched/isolation: Prevent out-of-bounds read in isolcpus= boot parameter parser Date: Sat, 28 Nov 2026 23:54:28 -0500 Message-ID: <20261129045436.255364-5-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261129045436.255364-1-atomlin@atomlin.com> References: <20261129045436.255364-1-atomlin@atomlin.com> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail Content-Type: text/plain; charset=UTF-8 The "isolcpus=3D" boot parameter parser in housekeeping_isolcpus_setup() contains an out-of-bounds memory read bug when handling unterminated flags. When parsing the boot parameter string, the logic expects flags to be comma-separated. If a user passes an unrecognised or legitimate flag at the very end of the string without a trailing comma (e.g., "isolcpus=3Dunknown"), the strict strncmp() checks will fail. The execution then falls through to a fallback for loop designed to skip the unknown sub-parameter. This inner loop consumes characters until it encounters either a comma or the NULL terminator ('\0'). When the loop terminates due to hitting the end of the string, the str pointer rests exactly on the NULL terminator. However, immediately following this inner loop, the code unconditionally executes str++. This advances the pointer past the end of the string and into uninitialised memory. The outer while (isalpha(*str)) loop subsequently evaluates this out-of-bounds memory. If the adjacent byte happens to be alphabetical, the parser will continue reading garbage data, potentially leading to undefined behavior or boot anomalies. Fix this by adding a bounds check immediately before the pointer increment. This ensures the parsing loop cleanly terminates when reaching the end of the boot parameter string. Fixes: 3662daf023500 ("sched/isolation: Allow "isolcpus=3D" to skip unknown= sub-parameters") Cc: stable@vger.kernel.org Reviewed-by: Valentin Schneider Signed-off-by: Aaron Tomlin --- kernel/sched/isolation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index c0c8b8862cbd..9198f6dbdadb 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -380,6 +380,8 @@ static int __init housekeeping_isolcpus_setup(char *str= ) =09=09} =20 =09=09pr_info("isolcpus: Skipped unknown flag %.*s\n", len, par); +=09=09if (!*str) +=09=09=09break; =09=09str++; =09} =20 --=20 2.55.0