Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp424110lqp; Mon, 10 Jun 2024 08:10:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/5ipWBemTnLRFCWBydFPnGNfWA81shwydA22OgQ7wm1PQI8cXW5sxLpX9CQPBdlP79T+t0SnWEVSD8l5iu0OwJolrQlhe17q/O/6wUQ== X-Google-Smtp-Source: AGHT+IELCZ/O8rj29Bi5Novi/hYsupoO1gxjjetRIkDMPypOJkatuIIj7uJWeVyv8i8GKYxpGOKX X-Received: by 2002:a50:d4d2:0:b0:579:d673:4e67 with SMTP id 4fb4d7f45d1cf-57c509a023emr7252902a12.26.1718032231489; Mon, 10 Jun 2024 08:10:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718032231; cv=pass; d=google.com; s=arc-20160816; b=FEyJdTMR3JYZ7GuKjABRu//o6vaUMoPGPwZTTi7s4DoWCT2brkGpB6VdQY4aVfnwcQ 5PS2xq3YWoeXf0AflbSUggSNAqjWeEnUiGz9Fi4CqBC/X5XZANEqksPiCv9nledR+B2Y k/y3vcSwaHNRLoRq4BF+wxUWZD4208x3TWXQpIawANL5iGDlIW+xqSPpzQNS71YTW2jo b+pzsKDrDcCeKGijsw5XT8FaP7g10XjMVfhkyuGOlh9tQlq+mGL1JUAEbLWVobllk6hG qZHSh8d1FvEOnyA3VmLKEUrj16rn8rP92NYcjPazhkSHhVfj/Gn3rNEmQthh7hKCufk+ qNZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=1NhAwaxloBAiN+xtmBkT+YncwjMJhRX+9nxaYNTlU74=; fh=Z2Kd9jrYa4iT/lgS0kaiaf/Uqj22t0AQlopg1bIzgK4=; b=0Ql/EOkpLtpLk/LGUQxDji4uiva4bEVy4CixVHp9VgJ0J4neOzqqpej90meqlMI/oL GZ2P5y/DqtsGrgwrFiPw1uqAzkX929hwQ1dYjcJGKGDq7o+gw3yTEjlDThC58gIderz3 6pAGzqxttCvN7zgiokxyeLinWc6TDL8Q/CvXxF+ds/YzUDjqIA6l9e7OSZ661a/54C3t GL+H7em2Q8NS7oCDptie9zrEjykdlF0PYTc+M7psAsjM00p++jvsIocaXjudmYnIHhDg tpCTTShgGbJIFIPei4DUnv+Tqy/6g6WGnLGsImESEy6+MOYrcAyQJNFseE/JF2SalFP4 ry8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-208424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208424-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 4fb4d7f45d1cf-57aae0c57besi4737698a12.124.2024.06.10.08.10.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:10:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208424-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; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-208424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208424-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 739CB1F228E4 for ; Mon, 10 Jun 2024 15:10:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A410139580; Mon, 10 Jun 2024 15:10:21 +0000 (UTC) Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) (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 412C61E4A0; Mon, 10 Jun 2024 15:10:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718032220; cv=none; b=cJCiZMKy8zKjFtLuYP7DEyYcTi4L+lwNFxHsQwDiInchbwsB1rPEf/Fs+mv63YlMTEuAj2EgkkZcQs0Q41nDSrlFuKmnKKd5XiD9/ZuTAWQGMSQ7T3YrQY8ONWfAZliSGl0uzkZiZWKVe3FhDV8xdff+PuSOmGHAszgebobVc3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718032220; c=relaxed/simple; bh=I8084Qz3wl6Sg3NijYzP71C3nEnhmZP4BG7TCRsix+g=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=IEx8ir6tNt8XW4m2yWGt4KRrLbGL5f+b9Az8maopQNlGkKNEmNYV48ksEh81zNhJEWj46uShKuxiMb4QQhufChPCQTIfg2umlAH6/IvoJdzopn4U/lHkz26phtTDcmSdjiFfIq8f2U2yDn8GeAYFB6yqM4s17wbC/IDWeqgjNXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0B7E11A1057; Mon, 10 Jun 2024 15:10:11 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA id 78A8D2F; Mon, 10 Jun 2024 15:10:07 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 RESEND] checkpatch: check for missing Fixes tags From: Joe Perches To: Dan Carpenter , Andrew Morton Cc: Thorsten Leemhuis , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann , Kees Cook , Sasha Levin , Tom Gall , kernel-janitors@vger.kernel.org Date: Mon, 10 Jun 2024 08:10:06 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Stat-Signature: 4iwd39bczr4jr5ztbqju7yyorjbyg9nb X-Rspamd-Server: rspamout02 X-Rspamd-Queue-Id: 78A8D2F X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/URrnG2JSDjWd0RUikCCbtm2oHEn5ydVs= X-HE-Tag: 1718032207-742403 X-HE-Meta: U2FsdGVkX19MwJgcQLxo4qt7+AnP1so/ciY28kWy3vwL4tJBLJl3r1UMqaFxV0ty3xXRabPxx13rs0+4iRtAraGERowURFxYjhghoeuXEOrruzneU7DvTlpDJmuaE6UFWUJmy2FL3eUV4AC6/mioOnCY4q/RZV2G3sHikqNh+HNN/lpZhr3W24KOC9DLG4e4WqAGxyjX10c6hRdTbqu7AP2iLIsvMafc3XAOKamFg3kA9C8pYMQ2BQJKeuqXh/HeTEPYA6LguuDVUdmVpV7Pj6RUu0l8PeocJvdyBZWqQEqBJhVp4Ocd7eim2Tk3glluiYvEB4hSl1GmKPzrt0E4bAd1qEQsuhj65yrqjGUgbAn3CU5mI1YokyCl57oDAkVt On Mon, 2024-06-10 at 14:13 +0300, Dan Carpenter wrote: > This check looks for common words that probably indicate a patch > is a fix. For now the regex is: >=20 > (?:(?:BUG: K.|UB)SAN: |Call Trace:|stable\@|syzkaller)/) >=20 > Why are stable patches encouraged to have a fixes tag? Some people mark > their stable patches as "# 5.10" etc. This is useful but a Fixes tag is > still a good idea. For example, the Fixes tag helps in review. It > helps people to not cherry-pick buggy patches without also > cherry-picking the fix. >=20 > Also if a bug affects the 5.7 kernel some people will round it up to > 5.10+ because 5.7 is not supported on kernel.org. It's possible the Bad > Binder bug was caused by this sort of gap where companies outside of > kernel.org are supporting different kernels from kernel.org. >=20 > Should it be counted as a Fix when a patch just silences harmless > WARN_ON() stack trace. Yes. Definitely. >=20 > Is silencing compiler warnings a fix? It seems unfair to the original > authors, but we use -Werror now, and warnings break the build so let's > just add Fixes tags. I tell people that silencing static checker > warnings is not a fix but the rules on this vary by subsystem. >=20 > Is fixing a minor LTP issue (Linux Test Project) a fix? Probably? It's > hard to know what to do if the LTP test has technically always been > broken. >=20 > One clear false positive from this check is when someone updated their > debug output and included before and after Call Traces. Or when crashes > are introduced deliberately for testing. In those cases, you should > just ignore checkpatch. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > +# These indicate a bug fix > + if (!$in_header_lines && !$is_patch && > + $line =3D~ /^This reverts commit/) { > + $is_revert =3D 1; > + } > + > + if (!$in_header_lines && !$is_patch && > + $line =3D~ /(?:(?:BUG: K.|UB)SAN: |Call Trace:|stable\@|syzkaller)= /) { > + $needs_fixes_tag =3D 1; Maybe use $line =3D~ /((?:(?:BUG: K.|UB)SAN: |Call Trace:|stable\@|syzkaller))/= ) { $needs_fixes_tag =3D $1; > @@ -7697,6 +7715,12 @@ sub process { > ERROR("NOT_UNIFIED_DIFF", > "Does not appear to be a unified-diff format patch\n"); > } > + if ($is_patch && $has_commit_log && $chk_fixes_tag) { > + if ($needs_fixes_tag && !$is_revert && !$fixes_tag) { and + if ($needs_fixes_tag ne "" && !$is_revert && !$fixes_tag) { > + WARN("MISSING_FIXES_TAG", > + "This looks like a fix but there is no Fixes: tag\n"); and "The commit message has '$needs_fixes_tag', perhaps it also needs a= 'Fixes:' tag?\n");