From mboxrd@z Thu Jan 1 00:00:00 1970 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 EFF3E1A01C6 for ; Wed, 8 Jan 2025 21:53:33 +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=1736373214; cv=none; b=a10udFXfkFceysC4N8hiT70sx0wHUShQSWa0izUGTkTFeBgxkGoSHKPZ2CLfv6E57DD2N6ot+/dVMexP6xIY5zUihgzls9no10lKPDy5nb1/7/cVPg9IYQcQdzuuudX3yscSBIGsvnktqXXUDL7e56oayanozMNjR0CIZA/XG3k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736373214; c=relaxed/simple; bh=uYyWrzIZpslIM/Egq2j7QHpjWQZX8ZcFhnCtY6t/IT4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RGnMrU0h31nA7WXpFhBywyR+jjGiMX0NVvb9w8ppnX2iVvT+77GwTTsLSuZUEYeuB8cMjjEGOImTFpwUcGd4y2XKv9w+Zm2jBewg1zgRAYfJ4cR7jJ+rqr9kGbrXGvYaFrSlbEjoKUz9POEN6B+/zQaJQWESjwDmvQMVnkI7jYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m5UMZchE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m5UMZchE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52037C4CEEC; Wed, 8 Jan 2025 21:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736373213; bh=uYyWrzIZpslIM/Egq2j7QHpjWQZX8ZcFhnCtY6t/IT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m5UMZchE1Lnc8a8FCussf8aAbMiXg+sEMUEn9wc0036A/7P//U28QYD3+cpqSMAaO +9y+r7Ts4kUhPgALwdRnLzVsVuS4xYDn+Au+R8Gb4aEAoA1r4kAt6zHTjMzp0uVnRu 9PEms0sbbY+DoeKd4ia83rotMuPYQeFeujRTQV8rLKAFlOYuOPiNePNgaRLF0LOkUM zYvuGCdLYT5JJUwLYZwsKW+zQChFNHVID0Pt0WbFcKHMhFRLOadCJfde8brdEzpzNJ NjQKK5IE64dI5cu7RnjN0IOc0OSSGvanK712+XhID1Bez7VF4hyajv4aPoVdQpgHBH ahozPo6kbdPJg== Date: Wed, 8 Jan 2025 13:53:29 -0800 From: Kees Cook To: Linus Walleij Cc: Andy Lutomirski , Will Drewry , linux-kernel@vger.kernel.org Subject: Re: [PATCH] seccomp: Stub for !CONFIG_SECCOMP Message-ID: <202501081352.6FF1687F67@keescook> References: <20250107-seccomp-stub-2-v1-1-fd43bcee2560@linaro.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: <20250107-seccomp-stub-2-v1-1-fd43bcee2560@linaro.org> On Tue, Jan 07, 2025 at 09:46:48AM +0100, Linus Walleij wrote: > When using !CONFIG_SECCOMP with CONFIG_GENERIC_ENTRY, the > randconfig bots found the following snag: > > kernel/entry/common.c: In function 'syscall_trace_enter': > >> kernel/entry/common.c:52:23: error: implicit declaration > of function '__secure_computing' [-Wimplicit-function-declaration] > 52 | ret = __secure_computing(NULL); > | ^~~~~~~~~~~~~~~~~~ > > Since generic entry calls __secure_computing() unconditionally, > fix this by adding another static inline stub. > > Link: https://lore.kernel.org/oe-kbuild-all/202501061240.Fzk9qiFZ-lkp@intel.com/ > Signed-off-by: Linus Walleij > --- > include/linux/seccomp.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h > index 341980599c71242d3bb95b544c954278efcc65b9..622a8d8899085b204c449e101de7fe59e26e15a2 100644 > --- a/include/linux/seccomp.h > +++ b/include/linux/seccomp.h > @@ -58,6 +58,10 @@ static inline int secure_computing(void) { return 0; } > static inline int __secure_computing(const struct seccomp_data *sd) { return 0; } ^^^^ > #else > static inline void secure_computing_strict(int this_syscall) { return; } > +static inline int __secure_computing(const struct seccomp_data *sd) > +{ > + return 0; > +} > #endif Let's just move the existing __secure_computing() no-op out of the ifdef there. -Kees > > static inline long prctl_get_seccomp(void) > > --- > base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37 > change-id: 20250107-seccomp-stub-2-a2e8cbe1f949 > > Best regards, > -- > Linus Walleij > -- Kees Cook