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]
Date:   Fri, 31 May 2019 15:27:00 +0200
From:   Sebastian Reichel <sre@...nel.org>
To:     Pavel Machek <pavel@...x.de>
Cc:     kernel list <linux-kernel@...r.kernel.org>,
        dmitry.torokhov@...il.com, gregkh@...uxfoundation.org,
        teheo@...e.de
Subject: Re: devm_* vs. PROBE_DEFFER: memory leaks?

Hi,

On Fri, May 31, 2019 at 10:52:10AM +0200, Pavel Machek wrote:
> Is devm_ supposed to work with EPROBE_DEFFER?

Sure.

> Probe function is now called multiple times;
> is memory freed between calling probe()?

Yes, EPROBE_DEFER is an error code, so devm resources
are released.

> Will allocations from failed probe()s remain after the driver is
> inserted successfully, leaking memory?

devm_ is connected to the device, not to the driver.

Since code is better than words, check drivers/base/dd.c yourself.
The relevant function name is really_probe(), interesting part for
you starts at ret = drv->probe(dev) line.

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ