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: <CAMuHMdVSBFfmYQkYhu-R0i4y0wen0zMnVRZvkFL2SNOgVxhouA@mail.gmail.com>
Date:   Thu, 21 Nov 2019 15:08:00 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] driver core: Print device in really_probe() warning backtrace

Hi Greg,

On Thu, Nov 21, 2019 at 2:57 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
> On Wed, Nov 20, 2019 at 03:36:19PM +0100, Geert Uytterhoeven wrote:
> > If a device already has devres items attached before probing, a warning
> > backtrace is printed.  However, this backtrace does not reveal the
> > offending device, leaving the user uninformed.
> >
> > Use dev_WARN_ON() instead of WARN_ON() to fix this.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

> > --- a/drivers/base/dd.c
> > +++ b/drivers/base/dd.c
> > @@ -516,7 +516,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
> >       atomic_inc(&probe_count);
> >       pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
> >                drv->bus->name, __func__, drv->name, dev_name(dev));
> > -     WARN_ON(!list_empty(&dev->devres_head));
> > +     dev_WARN_ON(dev, !list_empty(&dev->devres_head));
>
> We really do not want WARN_ON() anywhere, as that causes systems with
> panic-on-warn to reboot.
>
> If this can happen, we should switch it to a real error message, with
> dev_err() and the like, and recover properly.

If this happens, there's something serious wrong with resource management,
beyond recovery.

> I don't want to make it easier to add WARN_ON() lines, like
> dev_WARN_ON() would allow, instead we should be removing them, as they
> encourage slopping programming habits.

OK, will respin, using dev_warn().

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ