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] [day] [month] [year] [list]
Message-ID: <CAL+tcoAeN_CpW6BBZ5HHGUEzNFT8e-m0uQLaapR=i6yWdeEKww@mail.gmail.com>
Date: Wed, 2 Oct 2024 19:34:52 +0900
From: Jason Xing <kerneljasonxing@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com, 
	willemdebruijn.kernel@...il.com, willemb@...gle.com, netdev@...r.kernel.org, 
	Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next v2] net-timestamp: namespacify the sysctl_tstamp_allow_data

On Wed, Oct 2, 2024 at 7:30 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Wed, Oct 2, 2024 at 12:27 PM Jason Xing <kerneljasonxing@...il.com> wrote:
> >
> > Hello Eric,
> >
> > On Wed, Oct 2, 2024 at 4:41 PM Eric Dumazet <edumazet@...gle.com> wrote:
> > >
> > > On Wed, Oct 2, 2024 at 6:18 AM Jason Xing <kerneljasonxing@...il.com> wrote:
> > > >
> > > > From: Jason Xing <kernelxing@...cent.com>
> > > >
> > > > Let it be tuned in per netns by admins.
> > > >
> > > > Signed-off-by: Jason Xing <kernelxing@...cent.com>
> > > > ---
> > > > v2
> > > > Link: https://lore.kernel.org/all/66fa81b2ddf10_17948d294bb@willemb.c.googlers.com.notmuch/
> > > > 1. remove the static global from sock.c
> > > > 2. reorder the tests
> > > > 3. I removed the patch [1/3] because I made one mistake
> > > > 4. I also removed the patch [2/3] because Willem soon will propose a
> > > > packetdrill test that is better.
> > > > Now, I only need to write this standalone patch.
> > > > ---
> > > >  include/net/netns/core.h   |  1 +
> > > >  include/net/sock.h         |  2 --
> > > >  net/core/net_namespace.c   |  1 +
> > > >  net/core/skbuff.c          |  2 +-
> > > >  net/core/sock.c            |  2 --
> > > >  net/core/sysctl_net_core.c | 18 +++++++++---------
> > > >  6 files changed, 12 insertions(+), 14 deletions(-)
> > > >
> > > > diff --git a/include/net/netns/core.h b/include/net/netns/core.h
> > > > index 78214f1b43a2..ef8b3105c632 100644
> > > > --- a/include/net/netns/core.h
> > > > +++ b/include/net/netns/core.h
> > > > @@ -23,6 +23,7 @@ struct netns_core {
> > > >  #if IS_ENABLED(CONFIG_RPS) && IS_ENABLED(CONFIG_SYSCTL)
> > > >         struct cpumask *rps_default_mask;
> > > >  #endif
> > > > +       int     sysctl_tstamp_allow_data;
> > > >  };
> > >
> > > This adds another hole for no good reason.
> > > Please put this after sysctl_txrehash.
> >
> > Thanks for your reminder.
> >
> > Before this patch:
> > struct netns_core {
> >         struct ctl_table_header *  sysctl_hdr;           /*     0   0x8 */
> >         int                        sysctl_somaxconn;     /*   0x8   0x4 */
> >         int                        sysctl_optmem_max;    /*   0xc   0x4 */
> >         u8                         sysctl_txrehash;      /*  0x10   0x1 */
> >
> >         /* XXX 7 bytes hole, try to pack */
> >
> >         struct prot_inuse *        prot_inuse;           /*  0x18   0x8 */
> >         struct cpumask *           rps_default_mask;     /*  0x20   0x8 */
> >
> >         /* size: 40, cachelines: 1, members: 6 */
> >         /* sum members: 33, holes: 1, sum holes: 7 */
> >         /* last cacheline: 40 bytes */
> > };
> >
> > After this patch:
> > struct netns_core {
> >         struct ctl_table_header *  sysctl_hdr;           /*     0   0x8 */
> >         int                        sysctl_somaxconn;     /*   0x8   0x4 */
> >         int                        sysctl_optmem_max;    /*   0xc   0x4 */
> >         u8                         sysctl_txrehash;      /*  0x10   0x1 */
> >
> >         /* XXX 7 bytes hole, try to pack */
> >
> >         struct prot_inuse *        prot_inuse;           /*  0x18   0x8 */
> >         struct cpumask *           rps_default_mask;     /*  0x20   0x8 */
> >         int                        sysctl_tstamp_allow_data; /*  0x28   0x4 */
> >
> >         /* size: 48, cachelines: 1, members: 7 */
> >         /* sum members: 37, holes: 1, sum holes: 7 */
> >         /* padding: 4 */
> >         /* last cacheline: 48 bytes */
> > };
> >
> > See this line "/* sum members: 37, holes: 1, sum holes: 7 */", so I
> > don't think I introduce a new hole here.
>
> You certainly did.  /* padding: 4 */
>
> Overall size grew by 8 bytes, while adding one 4 byte field.

Oh, I learned. Thanks for your instructions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ