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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 Oct 2016 08:33:43 -0500
From:   Rob Herring <robh@...nel.org>
To:     Laszlo Ersek <lersek@...hat.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        main kernel list <linux-kernel@...r.kernel.org>
Subject: Re: CONFIG_DEBUG_TEST_DRIVER_REMOVE causes unremovable drivers to
 bind devices twice

On Mon, Oct 10, 2016 at 8:17 AM, Laszlo Ersek <lersek@...hat.com> wrote:
> Hi,
>
> Greg asked me to stick to email with this bug report, so I'm reposting
> the original kernel bugzilla report to personal addresses, and lkml.
>
> Thanks,
> Laszlo
>
> https://bugzilla.kernel.org/show_bug.cgi?id=177021
>
>             Bug ID: 177021
>            Summary: [driver core] CONFIG_DEBUG_TEST_DRIVER_REMOVE causes
>                     unremovable drivers to bind devices twice
>            Product: Drivers
>            Version: 2.5
>     Kernel Version: v4.8-2283-ga3443cd (4.9.0-0.rc0.git2.1.fc26.aarch64)
>           Hardware: All
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>           Assignee: drivers_other@...nel-bugs.osdl.org
>           Reporter: lersek@...hat.com
>                 CC: arnd@...db.de, greg@...ah.com
>         Regression: No
>
> CONFIG_DEBUG_TEST_DRIVER_REMOVE was added in the following commit:
>
>> commit bea5b158ff0da9c7246ff391f754f5f38e34577a
>> Author: Rob Herring <robh@...nel.org>
>> Date:   Thu Aug 11 10:20:58 2016 -0500
>>
>>     driver core: add test of driver remove calls during probe

[...]

> This is almost a regression because the kernel crashes with valid
> drivers. It is not an error for a driver to not provide a remove()
> callback, so in this instance CONFIG_DEBUG_TEST_DRIVER_REMOVE does not
> expose a driver bug, it breaks with a valid driver. Not a regression for
> the upstream kernel after all, because the Kconfig documentation
> suggests N as default.
>
> Proposed solution: if none of the remove() methods exist, or the
> remove() method that exists fails, then don't release any resources, and
> don't re-probe the device.

I was thinking no remove method meant the driver didn't need to do any
explicit clean-up as all resources used devres, but I guess that's not
going to cover things like subsystem de-registration. I'll prepare a
fix.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ