On Mon, 10 Mar 2025 15:22:50 -0700 Kees Cook wrote:
> When a character array without a terminating NUL character has a static
> initializer, GCC 15's -Wunterminated-string-initialization will only
> warn if the array lacks the "nonstring" attribute[1]. Mark the arrays
> with __nonstring to and corr
On Wed, 26 Feb 2025 10:49:35 -0800 Saeed Mahameed wrote:
> On 26 Feb 13:47, Gustavo A. R. Silva wrote:
> >-struct mlx5e_umr_wqe {
> >+struct mlx5e_umr_wqe_hdr {
> > struct mlx5_wqe_ctrl_seg ctrl;
> > struct mlx5_wqe_umr_ctrl_seg uctrl;
> > struct mlx5_mkey_seg mkc;
> >
On Thu, 6 Feb 2025 15:07:07 +1030 Gustavo A. R. Silva wrote:>
> Here is another alternative for this. And similarly to the
> struct_group_tagged()
> change above, no struct members should be added before or after `struct
> mlx5e_umr_wqe_hdr hdr;` in `struct mlx5e_umr_wqe`:
Gustavo, could you su
On Wed, 19 Feb 2025 14:14:35 +0200 Tariq Toukan wrote:
> On 18/02/2025 23:13, Jakub Kicinski wrote:
> > On Tue, 18 Feb 2025 17:53:14 +0200 Tariq Toukan wrote:
> >> Maybe it wasn't clear enough.
> >> We prefer the original patch, and provided the Reviewed-by tag fo
On Mon, 17 Feb 2025 22:25:02 +0200 Gal Pressman wrote:
> diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c
> index af7c99845948..6d97be6bc7fa 100644
> --- a/net/sched/act_tunnel_key.c
> +++ b/net/sched/act_tunnel_key.c
> @@ -572,7 +572,7 @@ static int tunnel_key_geneve_opts_dump(
On Tue, 18 Feb 2025 17:53:14 +0200 Tariq Toukan wrote:
> Maybe it wasn't clear enough.
> We prefer the original patch, and provided the Reviewed-by tag for it.
Can you explain what do you mean by "cleaner"?
I like the alternative much more.
On Wed, 12 Feb 2025 20:13:28 +0200 Gal Pressman wrote:
> > You could leave this macro inplace and just change `(info) + 1` to
> > `(info)->options` avoiding changes in lots of files and adding casts
> > everywhere.
+1
> I'd rather not, having a macro to do 'info->options' doesn't help code
> re
On Tue, 11 Feb 2025 20:59:24 +0200 Gal Pressman wrote:
> > Everything else looks very good, though, yes, I would agree with the
> > alignment comments made down-thread. This was "accidentally correct"
> > before in the sense that the end of the struct would be padded for
> > alignment, but isn't gu
On Thu, 16 Jan 2025 13:39:52 -0800 Roman Kisel wrote:
> On 1/16/2025 1:19 PM, Thorsten Blum wrote:
> > Replace the deprecated one-element array with a modern flexible array
> > member in the struct nvsp_1_message_send_receive_buffer_complete.
> >
> > Use struct_size_t(,,1) instead of sizeof() to m
On Mon, 9 Dec 2024 12:59:40 -0800 Christopher Ferris wrote:
> It looks like the way this was fixed in the ethtool.h uapi header was to
> revert the usage of __struct_group. Should something similar happen for
> pkt_cls.h? Or would it be easier to simply remove the usage of the TAG in
> the _struct_
htool CLI doesn't but looks like NetworkManager does.
So as you say we'll cross that bridge...
Reviewed-by: Jakub Kicinski
Thanks!
On Mon, 11 Nov 2024 20:34:07 -0600 Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally
RFC is fine, but please don't post anything intended for merging until
we have clarity on the C++ vs uAPI headers issue.
On Sat, 9 Nov 2024 10:02:13 -0800 Jakub Kicinski wrote:
> $ g++ /tmp/t.cpp -I../linux -o /dev/null -c -W -Wall -O2
gcc version 14.2.1 20240912 (Red Hat 14.2.1-3) (GCC)
On Tue, 29 Oct 2024 15:55:35 -0600 Gustavo A. R. Silva wrote:
> Use the `__struct_group()` helper to create a new tagged
> `struct ethtool_link_settings_hdr`. This structure groups together
> all the members of the flexible `struct ethtool_link_settings`
> except the flexible array. As a result, th
On Mon, 4 Nov 2024 14:25:02 -0800 Kees Cook wrote:
> I think for getname() (and similar interfaces) we *do* want to use
> sockaddr_storage, but there is kind of an argument to instead use
> a struct with a flexible array, e.g.:
>
> struct sockaddr_unspec {
> sa_family_t sa_family;
>
On Thu, 24 Oct 2024 15:11:24 -0600 Gustavo A. R. Silva wrote:
> + * This is the legacy form of `struct sockaddr`. The original `struct
> sockaddr`
> + * was modified in commit b5f0de6df6dce ("net: dev: Convert sa_data to
> flexible
> + * array in struct sockaddr") due to the fact that "One of the
On Tue, 29 Oct 2024 13:18:56 -0600 Gustavo A. R. Silva wrote:
> By priority I mean if preserving the reverse xmas tree is a most
> after any changes that mess in some way with it. As in the case below,
> where things were already messed up:
>
> + const struct ethtool_link_settings_hdr *base
On Tue, 29 Oct 2024 12:48:32 -0600 Gustavo A. R. Silva wrote:
> >> Is this going to be a priority for any other netdev patches in the future?
> >>
> >
> > It's been the preferred formatting for a decade or more.
> > Which is why the net/ethtool/ code you're touching follows
> > this convention.
On Tue, 29 Oct 2024 12:18:56 -0600 Gustavo A. R. Silva wrote:
> >> I don't think you want to change this. `lsettings` is based on
> >> `ksettings`. So,
> >> `ksettings` should go first. The same scenario for the one below.
> >
> > In which case you need to move the init out of line.
>
> So,
On Tue, 29 Oct 2024 10:55:14 -0600 Gustavo A. R. Silva wrote:
> On 29/10/24 07:58, Jakub Kicinski wrote:
> > On Mon, 21 Oct 2024 13:02:27 -0600 Gustavo A. R. Silva wrote:
> >> @@ -3025,7 +3025,7 @@ static int bnxt_set_link_ksettings(struct net_device
> >> *dev,
>
On Mon, 21 Oct 2024 13:02:27 -0600 Gustavo A. R. Silva wrote:
> @@ -3025,7 +3025,7 @@ static int bnxt_set_link_ksettings(struct net_device
> *dev,
> {
> struct bnxt *bp = netdev_priv(dev);
> struct bnxt_link_info *link_info = &bp->link_info;
> - const struct ethtool_link_settings
On Mon, 28 Oct 2024 20:37:13 -0600 Gustavo A. R. Silva wrote:
> The rest will essentially remain the same as the change in
> include/linux/ethtool.h triggers a cascade of changes across
> the rest of the files in this patch.
>
> So, you tell me if you still want me to split this patch. In any case
On Mon, 28 Oct 2024 17:32:53 -0600 Gustavo A. R. Silva wrote:
> >> Additionally, update the type of some variables in various functions
> >> that don't access the flexible-array member, changing them to the
> >> newly created `struct ethtool_link_settings_hdr`.
> >
> > Why? Please avoid unnecess
On Mon, 21 Oct 2024 13:02:27 -0600 Gustavo A. R. Silva wrote:
> Fix 3338 of the following -Wflex-array-member-not-at-end warnings:
>
> include/linux/ethtool.h:214:38: warning: structure containing a flexible
> array member is not at the end of another structure
> [-Wflex-array-member-not-at-end]
On Wed, 4 Sep 2024 10:27:18 +0800 Hongbo Li wrote:
> However, with these modifications, I'm not sure whether Willem and Jakub
> agree with the changes. If they don't agree, then I'll have to remove
> this example in the next version.
This and, to be clear, patch 4 as well.
> In the future, we c
On Mon, 2 Sep 2024 09:10:33 +0300 Gal Pressman wrote:
> > You don't explain the 'why'. How is this an improvement?
> > nack on this and 2 similar networking changes you sent
>
> Are you against the concept of string_choices in general, or this
> specific change?
Willem verbalized my opinion bette
On Sat, 31 Aug 2024 17:58:38 +0800 Hongbo Li wrote:
> Use str_disabled_enabled() helper instead of open
> coding the same.
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 6fe5e8f7017c..29647704bda8 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -3178,7 +3178,7 @@ stat
On Fri, 9 Aug 2024 09:42:03 -0700 Stephen Hemminger wrote:
> Tested this with iproute2-next and clang and no problem.
>
> The patch might be better split into two parts?
Fair point, a small two-patch series would be ideal.
--
pw-bot: cr
On Mon, 5 Aug 2024 09:35:46 -0600 Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
>
> Move the conflicting declaration to the end of the structure. Notice
> that `struct zones_ht_key` is a flexible structure -
On Thu, 8 Aug 2024 12:41:32 -0600 Gustavo A. R. Silva wrote:
> >> .../chelsio/cxgb4/cxgb4_tc_u32_parse.h| 2 +-
> >> include/uapi/linux/pkt_cls.h | 23 +++
> >
> > Took me a minute to realize you're changing uAPI.
> > Please fix the subject.
>
> Wha
On Mon, 5 Aug 2024 10:24:30 -0600 Gustavo A. R. Silva wrote:
> Subject: [PATCH][next] cxgb4: Avoid -Wflex-array-member-not-at-end warning
> Date: Mon, 5 Aug 2024 10:24:30 -0600
> .../chelsio/cxgb4/cxgb4_tc_u32_parse.h| 2 +-
> include/uapi/linux/pkt_cls.h | 23 ++
On Wed, 31 Jul 2024 07:53:46 +0300 Dmitry Antipov wrote:
> + reuse = kzalloc(struct_size(reuse, socks, max_socks), GFP_ATOMIC);
>
> if (!reuse)
another nit -- no empty lines between function call and its error check
:)
Two bits of docs to look at before sending v3:
https://www.kernel.
On Tue, 30 Jul 2024 19:04:49 +0300 Dmitry Antipov wrote:
> - unsigned int size = sizeof(struct sock_reuseport) +
> - sizeof(struct sock *) * max_socks;
> - struct sock_reuseport *reuse = kzalloc(size, GFP_ATOMIC);
> + struct sock_reuseport *reuse =
> + kzal
On Sat, 8 Jun 2024 12:20:33 +0200 Erick Archer wrote:
> It is preferred to use sizeof(*pointer) instead of sizeof(type)
> due to the type of the variable can change and one needs not
> change the former (unlike the latter).
>
> At the same time remove some unnecessary initializations and
> refact
On Thu, 30 May 2024 17:37:02 +0300 Leon Romanovsky wrote:
> Once you are ok with this patch, let me create shared branch for it.
> It is -rc1 and Konstantin already submitted some changes to qp.c
> https://lore.kernel.org/all/1716366242-558-1-git-send-email-kotara...@linux.microsoft.com/
>
> This
On Tue, 28 May 2024 22:35:55 -0700 Shradha Gupta wrote:
> + save_table = kcalloc(apc->indir_table_sz, sizeof(u32), GFP_KERNEL);
> + if (!save_table)
> + return -ENOMEM;
> +
> if (rxfh->indir) {
> - for (i = 0; i < MANA_INDIRECT_TABLE_SIZE; i++)
> +
On Thu, 23 May 2024 09:55:14 -0700 Shradha Gupta wrote:
> Allow variable size indirection table allocation in MANA instead
> of using a constant value MANA_INDIRECT_TABLE_SIZE.
> The size is now derived from the MANA_QUERY_VPORT_CONFIG and the
> indirection table is allocated dynamically.
>
> Sign
On Fri, 03 May 2024 21:31:25 +0100 Simon Horman wrote:
> This short patchset provides two minor cleanups for the gve driver.
>
> These were found by tooling as mentioned in each patch,
> and otherwise by inspection.
>
> No change in run time behaviour is intended.
> Each patch is compile tested o
On Tue, 7 May 2024 14:39:37 +0200 Alexander Lobakin wrote:
> There are several instances of the structure embedded into other
> structures, but also there's ongoing effort to remove them and we
> could in the meantime declare &net_device properly.
Is there a reason you're reposting this before th
On Thu, 11 Apr 2024 13:58:39 +0300 Leon Romanovsky wrote:
> I prepared mana-ib-flex branch
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=mana-ib-flex
> and merge ti to our wip branch
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=wip/leon-for-ne
On Tue, 9 Apr 2024 18:01:40 +0100 Edward Cree wrote:
> > Shared branch would be good. Ed has some outstanding patches
> > to refactor the ethtool RSS API.
>
> For the record I am extremely unlikely to have time to get those
> done this cycle :(
> Though in any case fwiw it doesn't look like th
On Mon, 8 Apr 2024 14:07:30 +0300 Leon Romanovsky wrote:
> Jakub, do you want shared branch for this series or should I take
> everything through RDMA tree as netdev part is small enough?
Shared branch would be good. Ed has some outstanding patches
to refactor the ethtool RSS API.
On Thu, 28 Mar 2024 19:17:10 -0600 Gustavo A. R. Silva wrote:
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c
> @@ -34,8 +34,11 @@ enum nfp_dumpspec_type {
>
> /* generic type plus length */
> struct nfp_dump_tl {
> -
On Tue, 26 Mar 2024 17:41:15 +0100 Alexander Lobakin wrote:
> To ease maintaining of virtchnl2.h, which already is messy enough,
> make it self-contained by adding missing if_ether.h include due to
> %ETH_ALEN usage.
> At the same time, virtchnl2_lan_desc.h is not used anywhere in the
> file, so re
On Tue, 12 Mar 2024 11:55:19 -0600 Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
> ready to enable it globally.
## Form letter - net-next-closed
The merge window for v6.9 has begun and we have already posted our pull
request. Therefore net-nex
On Wed, 6 Mar 2024 05:16:16 -0800 Breno Leitao wrote:
> 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
On Mon, 4 Mar 2024 15:32:51 +0100 Alexander Lobakin wrote:
> > 100% I should have linked to the thread that led to Kees's work.
> > Adding directly to net_device would be way better but there's
> > a handful of drivers which embed the struct.
>
> I think it's okay to embed a struct with flex arr
On Fri, 1 Mar 2024 15:30:03 +0100 Alexander Lobakin wrote:
> I like the idea of declaring priv explicitly rather than doing size +
> ptr magic. But maybe we could just add this flex array to struct
> net_device and avoid introducing a new structure.
100% I should have linked to the thread that led
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 ma
On Thu, 29 Feb 2024 11:08:58 -0800 Kees Cook wrote:
> > And some seem to be cargo-culted from out-of-tree code and are unused :S
>
> Ah, which can I remove?
The one in igc.h does not seem to be referenced by anything in the igc
directory. Pretty sure it's unused.
> As a further aside, this cod
On Wed, 28 Feb 2024 19:03:12 -0600 Gustavo A. R. Silva wrote:
> On 2/28/24 18:57, Jakub Kicinski wrote:
> > On Wed, 28 Feb 2024 18:49:25 -0600 Gustavo A. R. Silva wrote:
> >> struct net_device {
> >>struct_group_tagged(net_device_hdr, hdr,
> >>
On Wed, 28 Feb 2024 18:49:25 -0600 Gustavo A. R. Silva wrote:
> struct net_device {
> struct_group_tagged(net_device_hdr, hdr,
> ...
> u32 priv_size;
> );
> u8 priv_data[] __counted_by(priv_size)
> __aligned(NET
On Wed, 28 Feb 2024 16:01:49 -0800 Kees Cook wrote:
> So, I found several cases where struct net_device is included in the
> middle of another structure, which makes my proposal more awkward. But I
> also don't understand why it's in the _middle_. Shouldn't it always be
> at the beginning (with pri
On Wed, 28 Feb 2024 13:46:10 -0800 Kees Cook wrote:
> I really don't like hiding these trailing allocations from the compiler.
> Why can't something like this be done (totally untested):
>
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 118c40258d07..dae6df4fb177 10
On Fri, 9 Feb 2024 17:16:42 -0800 Kees Cook wrote:
> The size of the imsf_slist_flex member is determined by imsf_numsrc, so
> annotate it as such.
Acked-by: Jakub Kicinski
On Wed, 7 Feb 2024 20:04:44 +0100 Borislav Petkov wrote:
> On Wed, Feb 07, 2024 at 07:35:53PM +0100, Matthieu Baerts wrote:
> > Sorry, I'm sure I understand your suggestion: do you mean not including
> > KFENCE in hardening.config either, but in another one?
> >
> > For the networking tests, we ar
On Fri, 1 Dec 2023 20:39:44 -0800 Kees Cook wrote:
> > We are reading nla->nla_len, which is the first 2 bytes of the structure.
> > And then we check if the structure is... there?
>
> I'm not debating whether it's there or not -- I'm saying the _contents_ of
> "nlattr::nla_len", in the face of
On Fri, 1 Dec 2023 10:17:02 -0800 Kees Cook wrote:
> > > -static inline int nla_len(const struct nlattr *nla)
> > > +static inline u16 nla_len(const struct nlattr *nla)
> > > {
> > > - return nla->nla_len - NLA_HDRLEN;
> > > + return nla->nla_len > NLA_HDRLEN ? nla->nla_len - NLA_HDRLEN : 0;
> > >
On Thu, 30 Nov 2023 14:00:33 -0800 Kees Cook wrote:
> Applied to for-next/hardening, thanks!
>
> [1/1] net: mdio: replace deprecated strncpy with strscpy
> https://git.kernel.org/kees/c/3247bb945786
newer version of this was posted...
On Thu, 30 Nov 2023 14:00:28 -0800 Kees Cook wrote:
> [1/1] qlcnic: replace deprecated strncpy with strscpy
> https://git.kernel.org/kees/c/f8bef1ef8095
You asked for changes yourself here, please drop all the networking
patches you applied today :|
On Thu, 30 Nov 2023 13:59:48 -0800 Kees Cook wrote:
> [1/1] net: ena: replace deprecated strncpy with strscpy
> https://git.kernel.org/kees/c/111f5a435d33
Again, please drop, Arthur requested for the commit message
to be changed.
On Thu, 30 Nov 2023 13:59:58 -0800 Kees Cook wrote:
> Applied to for-next/hardening, thanks!
>
> [1/1] net: dsa: lan9303: use ethtool_sprintf() for lan9303_get_strings()
> https://git.kernel.org/kees/c/f1c7720549bf
Please drop this, it got changes requested on our end because
I figured Alex
On Thu, 30 Nov 2023 12:01:01 -0800 Kees Cook wrote:
> This has the additional benefit of being defensive in the face of nlattr
> corruption or logic errors (i.e. nla_len being set smaller than
> NLA_HDRLEN).
As Johannes predicted I'd rather not :(
The callers should put the nlattr thru nla_ok() d
On Thu, 12 Oct 2023 20:53:30 + Justin Stitt wrote:
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
This driver no longer exists. Praise be.
--
pw-bot: reject
On Tue, 10 Oct 2023 17:47:31 -0700 Jakub Kicinski wrote:
> Please do read the netdev rules Jesse pointed you at.
> Maybe it's the combined flow of strncpy and __counted_by patches
> but managing the state of the "hardening" patches is getting
> a bit tedious :(
On Tue, 10 Oct 2023 14:41:10 -0700 Justin Stitt wrote:
> > Thanks Justin for these patches, please make sure you mark the subject
> > line as per the netdev rules:
> > [PATCH net-next v1] etc etc
>
> Sure, I'll resend!
Please do read the netdev rules Jesse pointed you at.
Maybe it's the combine
On Fri, 6 Oct 2023 01:58:54 +0530 Ayush Sawal wrote:
> The current maintainer for cxgb4 driver is Sourabh Sagar
> , I have added him in the CC.
> He will update the MAINTAINERS file for cxgb4 driver.
Thanks & looking forward to the update!
On Fri, 29 Sep 2023 12:44:45 -0700 Kees Cook wrote:
> On Fri, Sep 29, 2023 at 11:11:44AM -0700, Kees Cook wrote:
> > Hi,
> >
> > This annotates several chelsio structures with the coming __counted_by
> > attribute for bounds checking of flexible arrays at run-time. For more
> > details,
> > see c
On Wed, 27 Sep 2023 08:57:36 -0700 Kees Cook wrote:
> > Since the element count member must be set before accessing the annotated
> > flexible array member, some patches also move the member's initialization
> > earlier. (These are noted in the individual patches.)
>
> Hi, just checking on this
69 matches
Mail list logo