netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: David Laight <David.Laight@aculab.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v4 1/4] ethtool: improve compat ioctl handling
Date: Tue, 24 Nov 2020 20:42:52 +0100	[thread overview]
Message-ID: <CAK8P3a3tqW8J65nyLg2YY+2ZEfhtqsOpR9cZDJgtSenT+1BENQ@mail.gmail.com> (raw)
In-Reply-To: <4d1a587e7a9e4b65ac3a0c20554abdd3@AcuMS.aculab.com>

On Tue, Nov 24, 2020 at 5:19 PM David Laight <David.Laight@aculab.com> wrote:
>
> From: Arnd Bergmann
> > Sent: 24 November 2020 15:18
> >
> > The ethtool compat ioctl handling is hidden away in net/socket.c,
> > which introduces a couple of minor oddities:
> >
> ...
> > +
> > +static int ethtool_rxnfc_copy_from_compat(struct ethtool_rxnfc *rxnfc,
> > +                                       const struct compat_ethtool_rxnfc __user *useraddr,
> > +                                       size_t size)
> > +{
>
> I think this (and possibly others) want a 'noinline_for_stack'.
> So that both the normal and compat structures aren't both on the
> stack when the real code is called.

Yes, makes sense. I checked that the difference is small unless
CONFIG_KASAN_STACK is enabled, and that gcc is smart enough
not to inline these by default, but adding noinline_for_stack is
both consistent with the rest of the file and the safe bet here.

     Arnd

  reply	other threads:[~2020-11-24 19:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 15:18 [PATCH net-next v4 0/4] remove compat_alloc_user_space() Arnd Bergmann
2020-11-24 15:18 ` [PATCH v4 1/4] ethtool: improve compat ioctl handling Arnd Bergmann
2020-11-24 16:19   ` David Laight
2020-11-24 19:42     ` Arnd Bergmann [this message]
2020-11-24 15:18 ` [PATCH v4 2/4] net: socket: rework SIOC?IFMAP ioctls Arnd Bergmann
2020-11-24 16:13   ` David Laight
2020-11-24 19:05     ` Arnd Bergmann
2020-11-24 22:12       ` David Laight
2020-11-24 15:18 ` [PATCH v4 3/4] net: socket: simplify dev_ifconf handling Arnd Bergmann
2020-11-24 20:52   ` Jakub Kicinski
2020-11-24 15:18 ` [PATCH v4 4/4] net: socket: rework compat_ifreq_ioctl() Arnd Bergmann
2021-01-27 18:19 ` [PATCH net-next v4 0/4] remove compat_alloc_user_space() Christoph Hellwig

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=CAK8P3a3tqW8J65nyLg2YY+2ZEfhtqsOpR9cZDJgtSenT+1BENQ@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=arnd@arndb.de \
    --cc=hch@lst.de \
    --cc=netdev@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).