lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 27 Jul 2018 03:36:39 -0700
From:   Joe Perches <joe@...ches.com>
To:     David Laight <David.Laight@...LAB.COM>,
        'Andrew Morton' <akpm@...ux-foundation.org>,
        Andy Whitcroft <apw@...onical.com>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or
 union on stack

On Fri, 2018-07-27 at 10:21 +0000, David Laight wrote:
> From: Joe Perches Sent: 27 July 2018 11:09
> > On Fri, 2018-07-27 at 10:04 +0000, David Laight wrote:
> > > From: Andrew Morton Sent: 26 July 2018 20:28
> > > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton <akpm@...ux-foundation.org> wrote:
> > > > 
> > > > > I'll give it a spin, see how noisy it is.
> > > > 
> > > > Actually, I would prefer if the message, changelog and title
> > > > used the term "passed by value".  It's a more familiar term
> > > > and it is possible for a passed-by-value aggregate to in fact
> > > > be passed in registers.
> > > 
> > > You need to detect (and ignore) 'small' structures.
> > 
> > checkpatch is stupid and basically can't do that
> > as it has no context other than the current line.
> > 
> > It would need a list of specific struct types to
> > ignore.  Care to create and send that list to me?
> 
> Does it even have the type?

Yes, kinda.  But only on the line being matched.

i.e.: <const> [struct or union] [type] [name]

> If it has the prototype it could ignore aggregates that
> are marked 'const'.

checkpatch has no visibility of any prototype.

It might make sense for this sort of check to be
added to coccinelle or maybe as a compiler warning
when the struct is larger than some size.

Original thread for Julia:
https://lore.kernel.org/patchwork/patch/967890/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ