Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp701082lqh; Fri, 31 May 2024 13:46:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWR9Uf4xTC/c2/MhZ+RRwGQXzzq+h7jua5urN63a0n8a2uEzTdCBWDzXSHeZSseN5p1jUoNI8lNEK/GSN2QYRHiJZOgg+3eGY/Bjqp10Q== X-Google-Smtp-Source: AGHT+IF+pHWpbrOPStMQIeJIDzj/3jYWkBHg9bKJF441lloPy9PuaL/FgRKyrEECSZ0Abw7zDoaX X-Received: by 2002:a17:906:a2c4:b0:a67:b440:e50e with SMTP id a640c23a62f3a-a6822156300mr177673666b.71.1717188415927; Fri, 31 May 2024 13:46:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717188415; cv=pass; d=google.com; s=arc-20160816; b=DzkGGRupNZXJ5gxUudRfAnUj1PlCXC8EWwbtFVeme4Fj8nDWQgusO9oICiUZdJSgzI zFH4f9u7F4ygLQLY7RztggAB+ByT0QdRR+165ATS9s7iTNtjixeMK1oJP95kBkQDS7rb 7hdaZUW9+QeBiG0wZYYomU3ocoDSdTtegYejheBwZlxfbl4QAHF4mKz/Rtv1P0qtGJ7/ buPuFhlBJ59yekPUWT6QnAz1VobdSM7dulriq1u9S6ZHkcZuOXIgSIdKTPfmPKXNKDDO IzACgSjx2ylk4rCj8POJrTljZcOP+UyICqw1enCAvEysEOO0rdPUfRb2SO+XFbH0iVvY HLng== 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:dkim-signature; bh=3q0NRiUAV8jG6GbyARan6N99PKIH03Y8hoxXw3Gtzm8=; fh=2UCDsxYzIdp7EGIHmtBJesLjQo1GmeijCS6HmfIiff8=; b=W+lyAaSFQGyUDiCdhdig7bEigXw3ICoDa2m+baV1EPUdwqvDaSmADqtmLWAXiqGGMq npx+f4DLCyVwc2wNolOmn3cZ9g+mv2i48yiBVoE9WxRAx9RpDZRHtFFFQHdLIC+SR8tx cpzPxZCp58OKdSAS3KTjbCLZlSpMdTDhiBuAQKzVszP6pw9W+DSjSneYq5FjrHXse3/w AcweEHeDosmcd3ucYK2PZb2IP63tQTUvvQPdKXpZot+5NXjf/vJvcFsN7grrzllYjk/I a1xCTPWWC0n0hv1FyVsX1doMs+si6FjJwP9VM6Z70tNjOxmA9iQUJJsaIicl8Q/aS4m4 sj/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqZqYxRo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68a0f6109bsi25310566b.596.2024.05.31.13.46.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqZqYxRo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 A45F31F25D16 for ; Fri, 31 May 2024 20:46:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A83E78C66; Fri, 31 May 2024 20:46:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hqZqYxRo" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2737E24B4A; Fri, 31 May 2024 20:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717188399; cv=none; b=aZO2ncjuAulC2pgubdkpzDSEOkwBSFC7SClnwcuYqUjZv+I74u5WUEOhZFJCflwcJCgSO3b3FnQeWf6nMsvsmaYc5cxLkGU8SX2BzR1CIJc+ZwwjQY49akpEplUmMqaoCkfToPXpdFqQP4w8S0nxZPwVDLKeEtY9cODCkm2l1wI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717188399; c=relaxed/simple; bh=5v6WEVFSG+niPJT/ta0D1bzUViAOVqkrK/1t7rXf4ns=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D/ssJcxb0tmnKKXze/gWzyr/gqqQ+/he17EUfYvvT4yaOmHgr82J3mjnMNJnm2rVGlYT/ybWnqw590PEJJdU7/Gq1vgiya2HzjvbpZ+eHxwIEpOieOSuLLsLnVxsULzMrjvlVSDHquXOPIR3NgktwshDZkwDnooEuOpjtZGWyvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hqZqYxRo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A23B2C116B1; Fri, 31 May 2024 20:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717188398; bh=5v6WEVFSG+niPJT/ta0D1bzUViAOVqkrK/1t7rXf4ns=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hqZqYxRovnC0m4WQ8+Ca+THQmZ4x2MfUnPaxMot6GWx5nRptmI9lolz3Ex0YJiGtz KRvmaCatWZ9eLaOK8I4yDkWZYoURfZthXL1tqgw9ElF4pIrzcIx229LnRDOGujvXtF pZQpGfKBQpMj/wpcjfkWH+2BnD05/X8SAlrrzvMvsbyCln8JbRMcCcLP/z+mwbzhP9 h0ueQCrwwPXPmIw6WTCjwcr4JVh6TlKx5qiAjm6qywFuyVeCxEeHMXRmHmYHgBQkf5 buPXqnFFgKNo+2VFggMMGDZs20INQLwE1ymRs6BdI0BHwvHSnEy9qKDsCGSTZIRnn2 1BQoZNZX0MiKQ== Date: Fri, 31 May 2024 13:46:37 -0700 From: Kees Cook To: Borislav Petkov Cc: Jeff Johnson , Nikolay Borisov , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] x86/boot: add prototype for __fortify_panic() Message-ID: <202405311345.D91BF6E9@keescook> References: <20240529-fortify_panic-v1-1-9923d5c77657@quicinc.com> <0d3f7c58-7fc0-4e8b-b6fb-c4d0d9969ce7@suse.com> <5658B525-6642-43A2-B14C-BC4AA916FBCC@alien8.de> <202405310951.56D9BD5C41@keescook> <20240531190816.GLZlogIGgpc5maOeLN@fat_crate.local> 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: <20240531190816.GLZlogIGgpc5maOeLN@fat_crate.local> On Fri, May 31, 2024 at 09:08:16PM +0200, Borislav Petkov wrote: > On Fri, May 31, 2024 at 09:53:28AM -0700, Kees Cook wrote: > > Under CONFIG_FORTIFY_SOURCE, the boot code *does* still uses > > fortify-string.h. It lets us both catch mistakes we can discover at > > compile and will catch egregious runtime mistakes, though the reporting > > is much simpler in the boot code. > > From where I'm standing, we're not catching anything in the > decompressor: > > $ objdump -D arch/x86/boot/compressed/vmlinux | grep __fortify_panic > 0000000001bec250 <__fortify_panic>: > $ > > Sure, in vmlinux proper (allmodconfig) we do: > > objdump -D vmlinux | grep __fortify_panic | wc -l > 1417 > > but not in the decompressor which is special anyway. > > So we can just as well disable CONFIG_FORTIFY_SOURCE in the decompressor > and not do silly prototypes. Please do not do this. It still benefits from compile-time sanity checking. -- Kees Cook