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=1795928179; b=fGIR1WRn0QfUo6YxEOKNzE7GcBk0pJBs416bgeue2CnPUB2/1jX/TKsHX6/tIsbDz/Bq cq0FIx+qxfx2jK+4jSzxwKUG/ZI+JA7g4XnFvR4x01Id1tC51oyN+eg0iYNCNKzHAhmv/ Hcj9bcBgoddAtfCw1Mw83J6u/DKHGgAlyw3UNdno1rV3rCxpKLN5aDjJsWwblleFVl7qE RgXdFGxju4txHvmd2LOpJgb+OyassyuEF6hkTiDNCnrHwElBNnxKYLZHSTl/1cbWdTPcj 785cn9GdtzowM1quXO8fG0vpgiXC6wD6grm7rSHV7l0XV7je00kDw11s4yw+xlaoCyw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795928179; 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=hIrhZxjzwqGPcsKdMT5BI/MxNGOzBWL+zCiUZZwBwqjdUi7NGb+0qiiavrB/WWM96n1q Wu9Nt/2dYz8cGmQubxjID9h/NcpFVVJS0++0reGqGQYvqzzmg6nH/2p0hfgtCZL6sfqDZ 2b8UdCw8/yOYJbiMFhONT0HQlMWqzQRLhuWDSRLotUqFKeQSP+tQFz4RUcMuaTCd9wAo1 WtaCSgw3DUEGpftwLiHzqUrfLpV8o2TRQw78iUbOtFKChtaBPogN8dbBgmT5ROjwTcvF9 P6gb1YnTeKyRQ5Ehkf3kQfpnbhNEzRY6bsIEKuc0yCJ0h2ZxY4iMRDE/NeRi2zGGuvA== 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 D6F67606A31C for ; Sun, 29 Nov 2026 04:56:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6F67606A31C 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: virtualization@lists.linux.dev 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: virtualization@lists.linux.dev 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