From nobody Sun Jun 14 11:30:15 2026 Received: from cstnet.cn (smtp81.cstnet.cn [159.226.251.81]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5164F35958 for ; Thu, 2 Apr 2026 14:07:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775138861; cv=none; b=M2PHdKEnDdc+IabYsNaaifnUbgGKgeKE6uOgF8K47i3XJGMw+ydIWMrlQEgAG5EOvRGvEpQF2cJq87eK7JBVBKBFX8RDMv6KN3nMSToaKQUxUfF13I97qzyGuA6Y9X1qg+Sc9jqN0/fqtfFtrOeoOIyMZr18JTPGQKQz+LNKh5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775138861; c=relaxed/simple; bh=dRftmun3uPF+PE2U5uBKL7KGM/maXl8UPJF2pf4t6Ks=; h=From:Date:Subject:To:Cc:Message-ID; b=LQVSoPsfdrh7JvCk5T1GaouyVvG/lvs5iG0mJCQTco/6hndlRISp9gvqF8fO8vfyXVlec9AGXy/sbaBgiHkz7t5gQp4obEnrTsSK0A9si0CRpgLPx/54hnkZuRJl5XMhchalyOQNpNULl/8uHiFQIkzdEoSYOO8iK6UiNYcAS4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from hppdeMacBook-Pro.local (unknown [111.196.245.197]) by APP-03 (Coremail) with SMTP id rQCowADX+eAfeM5p4C+rDA--.22193S3; Thu, 02 Apr 2026 22:07:32 +0800 (CST) From: Pengpeng Hou Date: Thu, 2 Apr 2026 21:50:37 +0800 Subject: [PATCH] ARM: setup: NUL-terminate the fpe= emulator type To: linux-arm-kernel@lists.infradead.org Cc: jbohac@suse.cz, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, pengpeng@iscas.ac.cn Message-ID: <177513885235.95485.11195348639348945216@iscas.ac.cn> X-CM-TRANSID: rQCowADX+eAfeM5p4C+rDA--.22193S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw4rCw13ArWxWF17CryfWFg_yoW8Jw1xpa 9093Z8trs8ury7Ja4UAr1IvF98Jws7try2grW293yvyF12qr92q39Y9F1a9w1v9rW293Wj 9a4ftrsxAayUArJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBq14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1l84 ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I2 62IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcV AFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG 0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82 IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC2 0s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMI IF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF 0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87 Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUU038UUUUUU== X-CM-SenderInfo: pshqw1xhqjqxpvfd2hldfou0/ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" fpe_setup() copies the boot-time fpe=3D value into fpe_type[8] with a raw 8-byte memcpy(). The NWFPE path later checks that value with strcmp() to decide whether to install the emulator. If the command line provides an 8-byte fpe=3D value, fpe_type is left without a trailing NUL and strcmp() reads past the end of the array. Store the option with strscpy() and leave room for the terminator. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Pengpeng Hou --- arch/arm/kernel/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 0bfd66c7ada0..815a53a8584d 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -65,11 +66,11 @@ =20 =20 #if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE) -char fpe_type[8]; +char fpe_type[9]; =20 static int __init fpe_setup(char *line) { - memcpy(fpe_type, line, 8); + strscpy(fpe_type, line, sizeof(fpe_type)); return 1; } =20 --=20 2.50.1 (Apple Git-155)