Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2221447rbb; Tue, 27 Feb 2024 15:04:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXPgsetrnUrNXCa1Cf1eW7DdfE0dFOOgIt3+TEaPFJyRuyi3q3jVesN8hvwT2sa7o6EOW2DtRZWN+pIhE0VFXKfgMcG9tPgVbww5wsNBA== X-Google-Smtp-Source: AGHT+IFSZ9pEbFEynqXVbunrIXKVzvdOLLEeHD0yghA2ppZa8Oi8BWIWaBi9ALHcACpznJld73yS X-Received: by 2002:a17:906:c28d:b0:a3f:c115:3ac8 with SMTP id r13-20020a170906c28d00b00a3fc1153ac8mr7776226ejz.43.1709075043032; Tue, 27 Feb 2024 15:04:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075043; cv=pass; d=google.com; s=arc-20160816; b=xuXKaYhrqyDdkZH/aOeLqh7d/7Keb8+0HNFC+8McFSj7psu9RLLAECFirhRVaKmgHt q8CpOlKXxiQc2m4lh9Un1ex4pVkSRx1GCtb6ZizQTsj5Eq2WhkQY+NyQjOUKx5sWZwk7 B40kWbjdFf68JMIb49hRtlcqxDmWg/Zl1NxqD24iretWKHin+EHXTLNoOuYV/OwE3c88 xo66LA8QAZLOKuV/KDRUEpnvI5rE3lLpL50l6RTiO+GUY43+Ql8s7QnQGIpRkZHyzxdI MkRzHRv5NW7NpB2qJnNuoVUahqj/6ih6bNgrXoTrTNJ/5FK7kOLbcHiaDmp9DZwKknMg NJ7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=LqroY/eSaYOruRUIz4FV37kZQGVpkhWqQp6wqfnEjoE=; fh=FgALq4trs1fC9vqAH0pDRTfBTL3pfA1sq2hSZaOuxN4=; b=VsmDYD9VgkeKyro6vp6kgVP+CkbY9GGkZinCEFoiJsNqfg0ejwjBCZ1bgpPOZMYRdw SuDF89DxeIEsuLtZ7LZ3I+Zpv9sP8WUR/pOoxWwQQ1ksMFeOF3UOdl2v+9NNTjiYAJ5H 5dUb9ZAEOFyZuh8u5tzDAoowruqhm9J6RcpkIA/uQddrDNwaU9MuVP9rQLSAZXcHrxBc voYlBLqgNa2/R5cFLBzm+kJoZZbnwhsa8+93vhBjdTfV8hPP97XV2U+C8iIRyK7nq0TQ IY3uPc/O0XkLl2VxORgNT3IHcT6riJKtmBhcQ5/8BMvSZCzKk+NRZLQDsfN8FkPF21km 6JHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y5qzDTP2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-84158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84158-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s9-20020a170906454900b00a3f43e48052si1090923ejq.525.2024.02.27.15.04.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y5qzDTP2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-84158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84158-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C7C881F26A1D for ; Tue, 27 Feb 2024 23:04:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EF0B55C18; Tue, 27 Feb 2024 23:03:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y5qzDTP2" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3660354673; Tue, 27 Feb 2024 23:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075034; cv=none; b=XnGh3/prKji7FFYgKwQUhxXav6rHJhPFdDu14gfOZUyH2Ukvl3xKwZyCMI8nULCOpLhDGjqEbIIW3qfw4kHQfiMu4birhMjxsL3fZ4j6vPqg08W/EoaenggMFHNP+z8ViWBB3Kd39lUfTYatBIlSPbeZ0msVmUfg/Fa7daNGgCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075034; c=relaxed/simple; bh=RS9cpFSeTTXbKFeGO6nCVsKpFRKp+oQHaPY0gzPdSrY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pIANPqw2iNUusUM/xhRSIxMLWmZAwTBaj4573pvIOJ4UQf24zNrhpphJH9dSN0OprtVDizMACP9rsMHyKRz8PWAimtm2oIuJvWiS8jvCQE0FTXFtcy2qsW+x6PSigs3aU+dn/yqm2fyynMvPTs2X9TkhlbkYpwEZxOby9Iu62ME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Y5qzDTP2; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e4ca46ab04so3053622b3a.3; Tue, 27 Feb 2024 15:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709075032; x=1709679832; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=LqroY/eSaYOruRUIz4FV37kZQGVpkhWqQp6wqfnEjoE=; b=Y5qzDTP26ceQgbHeNVnPgnxCLaUEbVMEBFEkTxVejjXZmFsEv8yTefnAH0dt9T3HOR GCbVSaPg+bYeaIvVhnYwp4SdzIVbls3Rex7tjME9/Kbw8K5PN6jyrAyJVdNPQRuwqE6X 4doWfZaw47s73pkii+aD44jnmnlwcgh/cgEgBhKSirBdnLJboOQyXf9qYCYcXjQBd4e1 JBEZ9kfKepG2iVn3MjD91B2m+14XPYHnxSAZuZj5q2M3IcX0ij2DVjR3cM8zvVttIRup Whke5RJoF5Om3Nkx0A7HiGGsEhwLtNjXlwP+5+basNPSXr0N/PYXVyTeO/dCKzB7vxhW kXDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709075032; x=1709679832; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LqroY/eSaYOruRUIz4FV37kZQGVpkhWqQp6wqfnEjoE=; b=UP9fAzb6afGuw+QVYpGiX00j9VNFY94O3uGdBEb4W7Rl+CwHCzE8eLslArUUozc/Nw E2XjDNRnvtZi4LpadS2VOLY5V05i53Z1ikugPYEedJMUlaQVYTBw+7g3o6plxpI8pTp9 aqUuTDay0nOLX87Myk2TZGpLmcRT3uJ6tgHJHopGL0hsmBIDhOXHyAxB5EWmnWX8XvXD oiVGTi3nrxSXMl0A80hVxVDCVBN6RG4hbCWMjWdBKrOxuiGcg1y3gqebKJI0skevBLpz SJAZwMdQ+TQrQo/6VlqcX3ZT1jxbMXODdha2N7TP4vEI1RnUc7kQ6rr6Lx+dudkO/QLq W5PQ== X-Forwarded-Encrypted: i=1; AJvYcCUgi8qmcO/dW+EbzLNTmVhoPbBujcitRruLvnvsWO4FhGomuhAFNvqhoOpvLihoa450I4vgscVTb1ntmkqcX4nmtKXD7gR1C3l0i5E5lp1Y/SIwoUWiF6px5imlg7GgTNOLbR4CnyWxgOGKHWYA X-Gm-Message-State: AOJu0YxXj9xcxXxLSTxr5xIcD46Psv/VGZ4TAjFPR41Jj+/V6SQ6iwsA ApT0nm9FHAOfwcVDT+XnDLwDIpowGFtW2aSXAHVu/Y7ldzMeMDcK X-Received: by 2002:a05:6a00:4403:b0:6e5:265:fd31 with SMTP id br3-20020a056a00440300b006e50265fd31mr13271740pfb.7.1709075032276; Tue, 27 Feb 2024 15:03:52 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e5-20020a056a0000c500b006e530aca55asm4041625pfj.123.2024.02.27.15.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:03:51 -0800 (PST) Sender: Guenter Roeck Date: Tue, 27 Feb 2024 15:03:50 -0800 From: Guenter Roeck To: Kees Cook Cc: Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] lib: stackinit: Adjust target string to 8 bytes for m68k Message-ID: References: <20240227224653.work.603-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240227224653.work.603-kees@kernel.org> On Tue, Feb 27, 2024 at 02:46:56PM -0800, Kees Cook wrote: > For reasons I cannot understand, m68k moves the start of the stack frame > for consecutive calls to the same function if the function's test > variable is larger than 8 bytes. This was only happening for the char > array test (obviously), so adjust the length of the string for m68k > only. I want the array size to be longer than "unsigned long" for every > given architecture, so the other remain unchanged. > > Additionally adjust the error message to be a bit more clear about > what's happened, and move the KUNIT check outside of the consecutive > calls to minimize what happens between them. > > Reported-by: Guenter Roeck > Closes: https://lore.kernel.org/lkml/a0d10d50-2720-4ecd-a2c6-c2c5e5aeee65@roeck-us.net/ > Signed-off-by: Kees Cook Hmm, guess I misunderstood the other e-mail. Anyway, it works. After re-enabling the m68k tests: Tested-by: Guenter Roeck I'll also run it through qemu for other architectures to be sure that there is no negative impact. Thanks, Guenter