linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Marco Elver <elver@google.com>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Subject: Re: [PATCH] checkpatch: warn about direct use of send_sig_info and force_sig_info
Date: Thu, 6 May 2021 18:02:08 +0200	[thread overview]
Message-ID: <CAKXUXMx4dOSb8xub+JtOR8HBrLi_WtGL+L_+3c-rdQQc3XEPLw@mail.gmail.com> (raw)
In-Reply-To: <CABJPP5D_azxBiKq08_m_WVmcEy8qbMCa0EsAgu57t2T+eDJA0A@mail.gmail.com>

On Thu, May 6, 2021 at 5:02 PM Dwaipayan Ray <dwaipayanray1@gmail.com> wrote:
>
> On Thu, May 6, 2021 at 6:59 PM Marco Elver <elver@google.com> wrote:
> >
> > Setting up siginfo and using send_sig_info() and force_sig_info()
> > directly is discouraged. Instead, new code wanting to generate signals
> > should use the appropriate helper specific to the signal.
> >
> > Eric mentioned that he'd like to make these static at some point, but
> > until that can happen, let's try to avoid introducing new users of them.
> >
> > Cc: Eric W. Biederman <ebiederm@xmission.com>
> > Signed-off-by: Marco Elver <elver@google.com>
> > ---
> > Eric,
> >
> > While siginfo doesn't need changing often, when it does, it's quite the
> > adventure. We now have the various static asserts. The other thing is
> > usage of {send,force}_sig_info.
> >
> > I think the best option right now is to teach checkpatch.pl about it
> > until they become static.
> >
> > Fyi, I noticed one such new user here:
> > https://lkml.kernel.org/r/20210421024826.13529-1-wangjunqiang@iscas.ac.cn
> >
> > Thanks,
> > -- Marco
> > ---
> >  scripts/checkpatch.pl | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index ccb412a74725..3a86aafc3bcd 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -7153,6 +7153,12 @@ sub process {
> >                              "Where possible, use lockdep_assert_held instead of assertions based on spin_is_locked\n" . $herecurr);
> >                 }
> >
> > +# check for direct use of send_sig_info(), force_sig_info()
> > +               if ($line =~ /\b((force|send)_sig_info)\(/) {
>
> I think this might be a little better as:
> if ($line =~ /\b((?:force|send)_sig_info)\(/) {
>
> Otherwise it's good as it is.
> Tested-by: Dwaipayan Ray <dwaipayanray1@gmail.com>
>

Dwaipayan, do you want to also document this new rule on the
checkpatch documentation?
Marco, maybe you can assist us here with some pointer (lore.kernel.org
link) to the original discussion you had.

Lukas

  parent reply	other threads:[~2021-05-06 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 13:28 [PATCH] checkpatch: warn about direct use of send_sig_info and force_sig_info Marco Elver
2021-05-06 15:02 ` Dwaipayan Ray
2021-05-06 15:22   ` [PATCH v2] " Marco Elver
2021-05-06 21:41     ` Joe Perches
2021-05-07 11:47       ` Marco Elver
2021-05-06 16:02   ` Lukas Bulwahn [this message]
2021-05-06 16:11     ` [PATCH] " Marco Elver
2021-05-06 17:51       ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKXUXMx4dOSb8xub+JtOR8HBrLi_WtGL+L_+3c-rdQQc3XEPLw@mail.gmail.com \
    --to=lukas.bulwahn@gmail.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=elver@google.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).