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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0MN0U1cZac2t-SE4=nzWfJ-WJCAz=zHAcAKofD_sM1_Q@mail.gmail.com>
Date:   Mon, 15 Apr 2019 21:00:46 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Corey Minyard <minyard@....org>
Cc:     Christoph Hellwig <hch@...radead.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        openipmi-developer@...ts.sourceforge.net,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ipmi: avoid atomic_inc in exit function

On Mon, Apr 15, 2019 at 7:39 PM Corey Minyard <minyard@....org> wrote:
>
> On Mon, Apr 15, 2019 at 09:40:22AM -0700, Christoph Hellwig wrote:
> > On Mon, Apr 15, 2019 at 05:55:00PM +0200, Arnd Bergmann wrote:
> > > This causes a link failure on ARM in certain configurations,
> > > when we reference each atomic operation from .alt.smp.init in
> > > order to patch out atomics on non-SMP systems:
> > >
> > > `.exit.text' referenced in section `.alt.smp.init' of drivers/char/ipmi/ipmi_msghandler.o: defined in discarded section `.exit.text' of drivers/char/ipmi/ipmi_msghandler.o
> > >
> > > In this case, we can trivially replace the atomic_inc() with
> > > an atomic_set() that has the same effect and does not require
> > > a fixup.
> >
> > I'd rather fіx the arm section management.  Using atomic in exit
> > routines is perfectly valid, and it would seem odd to forbid it.
>
> That was my first thought, too.  It's kind of hard to believe that
> the IPMI driver is the only thing that does an atomic_inc() in the
> exit code.

That's what I had thought as well at first, and I carried a patch
to work around this by not dropping the .text.exit section on ARM
when SMP patching is enabled for a few years. I never sent this
because that can waste a significant amount of kernel memory,
and I knew the warning is harmless.

When revisiting it now, I found that this one was the only instance
I ever hit. It seems to be that using atomics in module_exit() is
indeed odd, because the function is rarely concurrent with anything
else.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ