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  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:   Wed, 12 Aug 2020 11:11:58 +0200
From:   Jiri Slaby <jirislaby@...nel.org>
To:     John Stultz <john.stultz@...aro.org>,
        Saravana Kannan <saravanak@...gle.com>
Cc:     lkml <linux-kernel@...r.kernel.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Todd Kjos <tkjos@...gle.com>,
        Amit Pundir <amit.pundir@...aro.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        linux-serial@...r.kernel.org
Subject: Re: [RFC][PATCH] tty: serial: qcom_geni_serial: Drop __init from
 qcom_geni_console_setup

On 11. 08. 20, 22:02, John Stultz wrote:
> On Tue, Aug 11, 2020 at 10:00 AM Saravana Kannan <saravanak@...gle.com> wrote:
>>
>> On Mon, Aug 10, 2020 at 7:50 PM John Stultz <john.stultz@...aro.org> wrote:
>>>
>>> When booting with heavily modularized config, the serial console
>>> may not be able to load until after init when modules that
>>> satisfy needed dependencies have time to load.
>>>
>>> Unfortunately, as qcom_geni_console_setup is marked as __init,
>>> the function may have been freed before we get to run it,
>>> causing boot time crashes such as:
>>
>> Btw, I thought non-__init functions calling __init functions would be
>> caught by the build system. Is that not correct? If it's correct, do
>> we know how this gets past that check?
> 
> I think it's because it's indirectly called through a function pointer.

Definitely.

Given there are lots of __init by *_console_setup, I wonder how many
console drivers return EPROBE_DEFER from probe and then register the
console from the same (but deferred) probe like this driver does...

In fact, it doesn't even matter if the probe returns EPROBE_DEFER. The
probe is not marked __init, so the setup shouldn't be either.

thanks,
-- 
js

Powered by blists - more mailing lists