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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AB5DC54E41 for ; Tue, 5 Mar 2024 19:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aI0I7BAk8tZ67GyPrpJKs4mJ/j9bMDEhd29JToT9Zjo=; b=Mdy7LJuSkmSSSn waybINgLsKqo8jPOjXbfrrT6WwFbb7OcIdW/1iOIeZTnCz5QHoEionBuNJqwlGwCua92x14ODVSXL LTG8F5y5BAeDbLFqh15r4km/48XYwVHen3lZsGGfzFdF3CIkfI9PdWtwE7KKqMewhEUtso7/g7mN8 TRxEqMiDTGAgtln3OGGAwAETIcUmIbJeiiDeFqT63VK/1n8q7kYYcmpNOVuyghrYQX/X1KWkrmS9G O7gjftCTCzHvgIcRCDedorAv7VDTZ3leUmYWxg1mOK2YlUjH9xX7sx2V+7WGDoz7x/TyTxhqPNyqV XekancvMkIblnc5b+0Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rharc-0000000F59R-3Kum; Tue, 05 Mar 2024 19:54:12 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rharZ-0000000F58K-2URE for linux-arm-kernel@lists.infradead.org; Tue, 05 Mar 2024 19:54:11 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6e5dddd3b95so92793b3a.1 for ; Tue, 05 Mar 2024 11:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709668448; x=1710273248; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8OJiIuppva2X62G3XuKOpZ18Of2oWMu+/RVVvODtp4M=; b=Oaj3kq3uetGqVtP4qRKpjlI4NeBG2JuMk4uAFOkBC97yFQ82R9Dp+kUMss8YI1l9Q0 CRbP8ZPsOjqNxbbRHkJfk5dawTeEc6w6Sl97XywRpIfzp/xJ0DDjfm7GR6ImC9JPDf68 TP/AFX0FnXw1gGRm4GpVdCDKAyVY2Bqz8JKIA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668448; x=1710273248; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8OJiIuppva2X62G3XuKOpZ18Of2oWMu+/RVVvODtp4M=; b=ZSKOBnusrysUVHIZCRmQ9bjtKZ+1TJ3pcqkniityfD63o0yqs5DXRTHtDSu02tNePa TR16oHiaV8wNSF1DclJAcv7Zs7RH5pjPGAYWZl/WjF+cjnFa1JzL66+D4Z87ikfolCAn TGLYwuzpOvZnDsQZn/sPQyt7JRZ0L41D+mhvLte4g4g73uO+2vg6EowvukykiEGv5U2k L2IteAHHHNLOX5FoZ3SwNBQ4r7uOUFeXtAxa1IMmc6znk/SnxGu0d1qDfSqGcELLitXM OZa/QHwIclLlA/Vd3owiisZkR+e98kuD8suW3UnAMjElt6pa8LMMN07ohhm+ITw0jROr lm2A== X-Forwarded-Encrypted: i=1; AJvYcCUHL8kyG0DbJvrBQIi+qygGSEeTt0j2S9Wm4rTmhfUqH/uH3U79dz4AlunibrPA51tUzmITXGQq3XR25FeAohuiWhdAFi30mAsziNBqL3OLn8WfXeI= X-Gm-Message-State: AOJu0YzES/cbFM+ljtWUH1nEDwEMwNr4bcz33hnEndSNYc35tgWs1y3T 8fRruBKAbdRXfSVc1BvuOcmqseSQ+CxEb1ZzBXLwj5x5wpdAcl/DhexyoYjGcliVE9pMPABc9vs = X-Google-Smtp-Source: AGHT+IEPSGoV+PaXRY7JI9uSPnapXCs52p1ILPTe+H1wv+UxrhqJWz+AChv6CTzYH5Lp5odgHWXRGQ== X-Received: by 2002:a05:6a00:8cc:b0:6e6:1df9:af92 with SMTP id s12-20020a056a0008cc00b006e61df9af92mr4909513pfu.14.1709668447845; Tue, 05 Mar 2024 11:54:07 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id h5-20020aa786c5000000b006e52ce4ee2fsm9391340pfo.20.2024.03.05.11.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 11:54:07 -0800 (PST) Date: Tue, 5 Mar 2024 11:54:06 -0800 From: Kees Cook To: Guenter Roeck Cc: linux-kselftest@vger.kernel.org, David Airlie , Arnd Bergmann , =?iso-8859-1?Q?Ma=EDra?= Canal , Dan Carpenter , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org Subject: Re: [RFC PATCH 1/5] bug: Core support for suppressing warning backtraces Message-ID: <202403051149.547235C794@keescook> References: <20240305184033.425294-1-linux@roeck-us.net> <20240305184033.425294-2-linux@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240305184033.425294-2-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240305_115409_743862_4A83AB83 X-CRM114-Status: GOOD ( 14.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 05, 2024 at 10:40:29AM -0800, Guenter Roeck wrote: > [...] > warning = (bug->flags & BUGFLAG_WARNING) != 0; > once = (bug->flags & BUGFLAG_ONCE) != 0; > done = (bug->flags & BUGFLAG_DONE) != 0; > > + if (warning && IS_SUPPRESSED_WARNING(function)) > + return BUG_TRAP_TYPE_WARN; > + I had to re-read __report_bug() more carefully, but yes, this works -- it's basically leaving early, like "once" does. This looks like a reasonable approach! Something very similar to this is checking that a warning happens. i.e. you talk about drm selftests checking function return values, but I've got a bunch of tests (LKDTM) that live outside of KUnit because I haven't had a clean way to check for specific warnings/bugs. I feel like future changes built on top of this series could add counters or something that KUnit could examine. E.g. I did this manually for some fortify tests: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/hardening&id=4ce615e798a752d4431fcc52960478906dec2f0e -Kees -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel