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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 May 2020 18:39:06 +0200
From:   Andrew Lunn <>
To:     Bartosz Golaszewski <>
Cc:     Rob Herring <>,
        "David S . Miller" <>,
        Matthias Brugger <>,
        John Crispin <>,
        Sean Wang <>,
        Mark Lee <>,
        Jakub Kicinski <>,
        Arnd Bergmann <>,
        Fabien Parent <>,
        Heiner Kallweit <>,
        Edwin Peer <>,,,,,,
        Stephane Le Provost <>,
        Pedro Tsai <>,
        Andrew Perepech <>,
        Bartosz Golaszewski <>
Subject: Re: [PATCH v2 05/14] net: core: provide priv_to_netdev()

On Mon, May 11, 2020 at 05:07:50PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <>
> Appropriate amount of extra memory for private data is allocated at
> the end of struct net_device. We have a helper - netdev_priv() - that
> returns its address but we don't have the reverse: a function which
> given the address of the private data, returns the address of struct
> net_device.
> This has caused many drivers to store the pointer to net_device in
> the private data structure, which basically means storing the pointer
> to a structure in this very structure.

To some extent, that is the way it is done now. To do anything else
just makes your driver different and so harder to maintain. Is 4/8
bytes for a pointer really worth being different?

Powered by blists - more mailing lists