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: <20201112141411.6fe75fbd@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Thu, 12 Nov 2020 14:14:11 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Heiner Kallweit <hkallweit1@...il.com>
Cc:     David Miller <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH RFC] net: core: support managed resource allocation in
 ndo_open

On Wed, 11 Nov 2020 21:56:10 +0100 Heiner Kallweit wrote:
> Quite often certain resources (irq, bigger chunks of memory) are
> allocated not at probe time but in ndo_open. This requires to relaese
> such resources in the right order in ndo_stop(), and in ndo_open()
> error paths. Having said that the requirements are basically the same
> as for releasing probe-time allocated resources in remove callback
> and probe error paths.
> So why not use the same mechanism to faciliate this? We have a big
> number of device-managed resource allocation functions, so all we
> need is a device suited for managed ndo_open resource allocation.
> This RFC patch adds such a device to struct net_device. All we need
> is a dozen lines of code. Resources then can be allocated with e.g.
> 
> struct device *devm = &dev->devres_up;
> devm_kzalloc(devm, size, gfp);
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>

This will not work well with the best known practice on how to change
rings parameters at runtime (allocate new set, swap, free old set).

Personally I'm not a fan of the managed stuff, and I think neither is
Dave. It just makes code harder to prove correct.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ