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:   Sat, 29 Apr 2017 19:38:23 +0300
From:   Evgeniy Polyakov <zbr@...emap.net>
To:     Alexey Ignatov <lexszero@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] w1: w1-gpio: Fix double-free of platform_data

Hi Alexey

25.03.2017, 20:08, "Alexey Ignatov" <lexszero@...il.com>:
> struct w1_gpio_platform_data was allocated using devres when using
> device tree. Then it was assigned to dev.platform_data, which leaded
> to double free on device removal by devres and by direct
> kfree(platform_data) in platform_device_release)

If this patch is still relevant, please add someone from device-tree into copy, I would think this bug
affect anyone and we see alot of bug reports since probe failure ends up with double free.

Also a nit:

> @@ -143,12 +141,12 @@ static int w1_gpio_probe(struct platform_device *pdev)
>          int err;
>
>          if (of_have_populated_dt()) {
> - err = w1_gpio_probe_dt(pdev);
> - if (err < 0)
> - return err;
> + pdata = w1_gpio_probe_dt(pdev);
> + if (IS_ERR(pdata) < 0)
> + return PTR_ERR(pdata);

IS_ERR() should not be used this way

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ