From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E2E1C4332F for ; Sun, 4 Dec 2022 22:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbiLDWW3 (ORCPT ); Sun, 4 Dec 2022 17:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiLDWW2 (ORCPT ); Sun, 4 Dec 2022 17:22:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49AF31208E; Sun, 4 Dec 2022 14:22:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AC5C860F17; Sun, 4 Dec 2022 22:22:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AD06C433C1; Sun, 4 Dec 2022 22:22:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670192546; bh=WPtcDEfHJt/O7gAG5TXEo2xTN4qotOLlkgPOPqlvdqc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cn4QF8BqPRA76+1gVVayfuGcTbj6ApXIe5pHlvxGFfBbX9jbY8A9+SCEpF4C60hbd OTdj5JtJ3oLO2EfjN84acKqM/SIuSz3fRiu05/n7inknrzc9oXvMhKRUv/kg6TIhs2 8woF5y/iFXXI+54qQ+4riYl+UPNzA63jXB4HmRPCQM5FFdUKS5yWpzZ8gFn2cZNrAR Rah88wYUr3nNvydQeECS48PqlUtlTSx/oS3Ssc02U3vkZkKuB95oiVWDaO58Ky0eE2 xNjPQFdUA2NbP5rzXulVx+MHdxhyjWODXTU52EzIByBHcFhDHKkJDpfPXYr+185qAu bG19P6APltV2w== Date: Mon, 5 Dec 2022 07:22:21 +0900 From: Masami Hiramatsu (Google) To: Greg Kroah-Hartman Cc: LKML , bpf@vger.kernel.org, Borislav Petkov , Alexei Starovoitov , Steven Rostedt , Linus Torvalds , Andrew Morton , Peter Zijlstra , Kees Cook , Josh Poimboeuf , KP Singh , Mark Rutland , Florent Revest , Christoph Hellwig , Chris Mason Subject: Re: [PATCH] panic: Taint kernel if fault injection has been used Message-Id: <20221205072221.63e14cfb08531fc418ab6d1d@kernel.org> In-Reply-To: References: <166995635931.455067.17768077948832448089.stgit@devnote3> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Fri, 2 Dec 2022 07:33:11 +0100 Greg Kroah-Hartman wrote: > On Fri, Dec 02, 2022 at 01:45:59PM +0900, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Since the function error injection framework in the fault injection > > subsystem can change the function code flow forcibly, it may cause > > unexpected behavior (and that is the purpose of this feature) even > > if it is applied to the ALLOW_ERROR_INJECTION functions. > > So this feature must be used only for debugging or testing purpose. > > > > To identify this in the kernel oops message, add a new taint flag > > for the fault injection. This taint flag will be set by either > > function error injection is used or the BPF use the kprobe_override > > on error injectable functions (identified by ALLOW_ERROR_INJECTION). > > > > Link: https://lore.kernel.org/all/20221121104403.1545f9b5@gandalf.local.home/T/#u > > > > Signed-off-by: Masami Hiramatsu (Google) > > --- > > Documentation/admin-guide/tainted-kernels.rst | 5 +++++ > > include/linux/panic.h | 3 ++- > > kernel/fail_function.c | 2 ++ > > kernel/panic.c | 1 + > > kernel/trace/bpf_trace.c | 2 ++ > > 5 files changed, 12 insertions(+), 1 deletion(-) > > I think you forgot to also update tools/debugging/kernel-chktaint with > this new entry :( Oops, thanks for pointing! Let me update the patch. -- Masami Hiramatsu (Google)