Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E393E4766B5; Thu, 20 Aug 2026 17:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787247388; cv=none; b=EadF1Puh51JHXhX+3wpRHl8ybTCiGfydnJchD/zAaRpa6iCDZNvYFWM/fpfV67+IwS7WB4693cfZawUxTCVMVzMi1dHe1hrtirmjE/FtiaGuw3//Kuo9Hjg6+COw3EiBegja469FYPd2yBywx6kp3+oKB/cnk6ZKihsv3NT3GhQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787247388; c=relaxed/simple; bh=e3V2oXBN1owkzL8tu/LSlYprLInYk7oKUb4wsd6nHVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gN2YF8b69gefKuARofillGki5HKBnDK9XIltH6qAjjnYZg873Mlsxl58fAWBY/NAcPUKO7uYn93q28hh/MuGJhtjqvzXwVFwfhAl3QRWy0WdZyXlC7dadw0EVSM2brohuBZOh/Fl7B1LfzRuC0GnChL1vnJRdtVRpGtxaltP51U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=s+A5kxzZ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="s+A5kxzZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6FBF1F000E9; Thu, 20 Aug 2026 17:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787247386; bh=UHuj85w7v5H37lRRJOlKBiWRi5IjleTKbs/ddbBg0qY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=s+A5kxzZYgDVrUyVjhYpqUt/rNPQ0/RDzi40Hnevfr6mWmFehz4ijrfin8jQ0te0u pIIY7CVpmykB71ooIr66PzaazcNdDcFuujfO7CimH7uG7l5ZRocJQW8d9pIdDY8rdo gI9aOhvu9KKC2Wv6CVWBcK90vMiZBchb3BLTbXW0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nayna Jain , R Nageswara Sastry , George Wilson , Madhavan Srinivasan Subject: [PATCH 6.6 028/166] powerpc/pseries: lparcfg - fix kbuf[] underflow Date: Thu, 20 Aug 2026 16:54:47 +0200 Message-ID: <20260820145212.033500869@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145211.194104353@linuxfoundation.org> References: <20260820145211.194104353@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: George Wilson commit fb442a6673ff1046bf67754957d95880fdb394b5 upstream. In lparcfg_write(), a count of 0 results in kbuf[] being indexed at -1. Check for count == 0 in the existing check for count > sizeof(kbuf) and return -EINVAL if true. Fixes: 74422e2b1939 ("powerpc/pseries: Remove VLA from lparcfg_write()") Acked-by: Nayna Jain Tested-by: R Nageswara Sastry Cc: stable@vger.kernel.org # 4.20 Signed-off-by: George Wilson Signed-off-by: Madhavan Srinivasan Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/pseries/lparcfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/platforms/pseries/lparcfg.c +++ b/arch/powerpc/platforms/pseries/lparcfg.c @@ -673,7 +673,7 @@ static ssize_t lparcfg_write(struct file if (!firmware_has_feature(FW_FEATURE_SPLPAR)) return -EINVAL; - if (count > sizeof(kbuf)) + if (count == 0 || count > sizeof(kbuf)) return -EINVAL; if (copy_from_user(kbuf, buf, count))