All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: David Laight <David.Laight@aculab.com>
Cc: 'Guru Mehar Rachaputi' <gurumeharrachaputi@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: pi433: modify bit_rate from u16 to u32
Date: Fri, 3 Feb 2023 01:13:06 +0300	[thread overview]
Message-ID: <Y9w1crEwTInJzlWE@kadam> (raw)
In-Reply-To: <08b38578bb0f4088aeedbf4b179d9c59@AcuMS.aculab.com>

On Thu, Feb 02, 2023 at 10:02:25PM +0000, David Laight wrote:
> From: Dan Carpenter
> > Sent: 01 February 2023 13:23
> > 
> > On Wed, Feb 01, 2023 at 12:34:50PM +0000, David Laight wrote:
> > > In reality having a uapi structure with embedded padding should
> > > be banned.
> > > But that would need a compiler attribute to enforce it.
> > 
> > It would be simple enough to grep the names of all the UAPI struct and
> > use pahole to make a list of the existing structs which have holes.
> > Then re-run the script every week and complain when new holey struct
> > types are added.
> > 
> > You could do a similar thing with Smatch looking at copy_to/from_user()
> > struct types.
> 
> Would it be possible to add aa attribute and check to sparse?
> 
> Might persuade people to use it instead of 'packed' for structures
> that map defined byte layouts and so mustn't be holey - but are
> never actually misaligned in memory.

I mean, it's kind of a before and after thing where we have to allow
all the existing code and complain about new code.  But yeah, we could
use the __user annotation as well.  If we encountered a
`struct oldabi_stat64 __user *statbuf` then complain if oldabi_stat64
had a hole.  At the end, delete all the warnings that existed in the
previously tested kernel.

regards,
dan carpenter


      reply	other threads:[~2023-02-02 22:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31  2:11 [PATCH] staging: pi433: modify bit_rate from u16 to u32 Guru Mehar Rachaputi
2023-01-31  5:22 ` Greg Kroah-Hartman
2023-01-31 10:19   ` Guru Mehar Rachaputi
2023-01-31 10:41     ` Greg Kroah-Hartman
2023-01-31 10:52       ` Guru Mehar Rachaputi
2023-01-31 11:14         ` Dan Carpenter
2023-01-31 18:18           ` Guru Mehar Rachaputi
2023-02-01 12:34     ` David Laight
2023-02-01 13:22       ` Dan Carpenter
2023-02-02 22:02         ` David Laight
2023-02-02 22:13           ` Dan Carpenter [this message]

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=Y9w1crEwTInJzlWE@kadam \
    --to=error27@gmail.com \
    --cc=David.Laight@aculab.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gurumeharrachaputi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.