From: Breno Leitao <leitao@debian•org>
To: Jakub Kicinski <kuba@kernel•org>, keescook@chromium•org
Cc: "David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Paolo Abeni <pabeni@redhat•com>,
Andy Shevchenko <andriy.shevchenko@linux•intel.com>,
"Gustavo A. R. Silva" <gustavoars@kernel•org>,
netdev@vger•kernel.org, linux-hardening@vger•kernel.org,
Simon Horman <horms@kernel•org>, Jiri Pirko <jiri@resnulli•us>,
Daniel Borkmann <daniel@iogearbox•net>,
Coco Li <lixiaoyan@google•com>,
Amritha Nambiar <amritha.nambiar@intel•com>,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH] netdev: Use flexible array for trailing private bytes
Date: Wed, 6 Mar 2024 05:16:16 -0800 [thread overview]
Message-ID: <ZehsoPb/WZzUcFHa@gmail.com> (raw)
In-Reply-To: <20240229225910.79e224cf@kernel.org>
On Thu, Feb 29, 2024 at 10:59:10PM -0800, Jakub Kicinski wrote:
> On Thu, 29 Feb 2024 13:30:22 -0800 Kees Cook wrote:
> > Introduce a new struct net_device_priv that contains struct net_device
> > but also accounts for the commonly trailing bytes through the "size" and
> > "data" members.
>
> I'm a bit unclear on the benefit. Perhaps I'm unaccustomed to "safe C".
>
> > As many dummy struct net_device instances exist still,
> > it is non-trivial to but this flexible array inside struct net_device
>
> put
>
> Non-trivial, meaning what's the challenge?
> We also do somewhat silly things with netdev lifetime, because we can't
> assume netdev gets freed by netdev_free(). Cleaning up the "embedders"
> would be beneficial for multiple reasons.
I've been looking at some of these embedders as reported by Kees[1], and
most of them are for dummy interfaces. I.e, they are basically used for
schedule NAPI poll.
From that list[1], most of the driver matches with:
# git grep init_dummy_netdev
That said, do you think it is still worth cleaning up embedders for
dummy net_devices?
[1] https://lore.kernel.org/all/202402281554.C1CEEF744@keescook/
next prev parent reply other threads:[~2024-03-06 13:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 21:30 [PATCH] netdev: Use flexible array for trailing private bytes Kees Cook
2024-02-29 22:15 ` Gustavo A. R. Silva
2024-03-01 6:59 ` Jakub Kicinski
2024-03-01 8:03 ` Eric Dumazet
2024-03-01 12:58 ` Alexander Lobakin
2024-03-01 13:25 ` Eric Dumazet
2024-03-01 14:30 ` Alexander Lobakin
2024-03-01 17:35 ` Jakub Kicinski
2024-03-04 14:32 ` Alexander Lobakin
2024-03-04 15:24 ` Jakub Kicinski
2024-03-01 11:41 ` Greg KH
2024-03-06 13:16 ` Breno Leitao [this message]
2024-03-06 15:06 ` Jakub Kicinski
2024-03-06 23:42 ` Kees Cook
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=ZehsoPb/WZzUcFHa@gmail.com \
--to=leitao@debian$(echo .)org \
--cc=amritha.nambiar@intel$(echo .)com \
--cc=andriy.shevchenko@linux$(echo .)intel.com \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=gustavoars@kernel$(echo .)org \
--cc=horms@kernel$(echo .)org \
--cc=jiri@resnulli$(echo .)us \
--cc=keescook@chromium$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-hardening@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=lixiaoyan@google$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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