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=1795988758; b=mPfzoh/bCl6QIeC10+1DcEA7LGqxmrBPh5830D7i06AzyKjZrVrCga8xqQfX7hEtpTpP 2uu5s2kUL2rmG9r2M6P/phVmTDawkzJI5xSHNJkyztYd1LjwwRXq4TIPqwqSYWYdi67hV RPvY6Xjpcg7/8L+lV+q4ZCEgtyUkiev6GACFFa/fojI+MieUw2YyVkoqDgMIG9ku5+pAC TBUnZ8lmrDjEtsovpQ8pnkDk0NCr22jrfduu5174pT1Gw2RJgphZ9FlD+zharj8KJc4LR 4dsjf3+bbcr9AxKlIczYv4g+RgJTksoV0GmGrOkZC3W8c+KV6O4mNB/mi7LzMfO4Qtg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795988758; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=WydxnKd7YqXil4CKJX7u9NWagiVqq/Z2S3wUwB9Mk+g=; b=WsO5rqs8tGnIC/Oyo4qImKNagxWYihe3po0mmth6brcEdoYmKT0MoUE4UQ6lAFS2hMq8 u6KlkpN1wdb8dVCkxBrEa4E/eSrae+y23qDVFMNRYyvvSL5hiRk2wACs1fyC3y80ZwiAu wQdwPuqdZiRpi6YG0Asl23ndKZIL1dsIx6awcinGjqe1nBYP/MK9XZkyEhZ/6AgRw4/vX YMjbw0rRd3lDIIXwKCR0EQyDXWtLUgZRsmfqwjQqiMpmWbtBiyD+NHLC4XScqwI9+SXQx xUnKyJwb4KlBSSZv9xDdFK0D46iNRTZ65myc/EWG4i0YoT5yldS4NVnuS7Ds8+gQ4Ug== 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=ovEPlVPR; 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 1D11F606A31C; Sun, 29 Nov 2026 21:45:57 +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=ovEPlVPR Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9E461F00923; Sun, 29 Nov 2026 21:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795988757; bh=WydxnKd7YqXil4CKJX7u9NWagiVqq/Z2S3wUwB9Mk+g=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ovEPlVPRUlXuxxoSNPyQLRKZ4TqStAmqGFJpIOlZSVH23Q1BMCOOuC2Qtrw4v/OQP Orj8RuSh4OBeUPnVC1BslEK70gIH05WMaUDhTOP+eU1tHYVu7vk2CEdg/qkie4Y8Fi kBMbRI4lA4UVYikiiBaL2pluzvrSmz6VwigkKelDLHGxMqNHISYAF9l7Le2VqmHk3Z upsjEK4C67zarMwWtA6C5TDKih4JN8cBv2eISdzOSfcn+ldWXh+y9veEIgoT39ch+8 ObZw6i4oyoPlV1LpSRJK50gPvJ7asASitknHr/uf4H+kJ5erF1Nm//42wUYYMLQype uoiiIvqtpDEew== Date: Sun, 29 Nov 2026 22:45:54 +0100 From: Frederic Weisbecker To: Aaron Tomlin Cc: axboe@kernel.dk, tglx@kernel.org, aacraid@microsemi.com, James.Bottomley@hansenpartnership.com, mkp@kernel.org, bigeasy@linutronix.de, gmaglione@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, miklos@szeredi.hu, 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: Re: [PATCH v17 04/10] sched/isolation: Prevent out-of-bounds read in isolcpus= boot parameter parser Message-ID: References: <20261129045436.255364-1-atomlin@atomlin.com> <20261129045436.255364-5-atomlin@atomlin.com> 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 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261129045436.255364-5-atomlin@atomlin.com> Le Sat, Nov 28, 2026 at 11:54:28PM -0500, Aaron Tomlin a écrit : > The "isolcpus=" 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=unknown"), 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=" to skip unknown sub-parameters") > Cc: stable@vger.kernel.org > Reviewed-by: Valentin Schneider > Signed-off-by: Aaron Tomlin Reviewed-by: Frederic Weisbecker But this should be sent seperately as a fix. Thanks. -- Frederic Weisbecker SUSE Labs