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]
Date:   Fri, 27 Oct 2017 11:59:35 -0700
From:   David Daney <ddaney@...iumnetworks.com>
To:     Abderrahmane Benbachir <abderrahmane.benbachir@...ymtl.ca>
Cc:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
        mingo@...nel.org, akpm@...ux-foundation.org, keescook@...omium.org,
        jeyu@...hat.com, rostedt@...dmis.org, mhocko@...e.com,
        viresh.kumar@...aro.org, thomas.lendacky@....com
Subject: Re: [PATCH] init/main.c: check for null pointer before calling
 initcall

On 10/27/2017 11:53 AM, Abderrahmane Benbachir wrote:
> 
> David Daney <ddaney@...iumnetworks.com> a écrit :
> 
>> On 10/27/2017 11:22 AM, Thomas Gleixner wrote:
>>> On Fri, 27 Oct 2017, David Daney wrote:
>>>
>>>> On 10/27/2017 09:47 AM, Abderrahmane Benbachir wrote:
>>>>> Simple check to prevent kernel panic when initcall does not exit
>>>>
>>>> Interesting, under what circumstances do you observe the panic?
>>>>
>>>> It would be best to include this information in the patch changelog.
>>>
>>> device_initcall(NULL);
>>>
>>> might do that, but then it rightfully crashes on boot.
>>>
>>
>> That was kind of my point.  The module loader case already checks for 
>> a non-NULL pointer, and any NULLs in the in-kernel initializer tables 
>> would indicate a bigger problem that should be fixed instead.
>>
>> David Daney
> 
> But this code can still be written :
> 
> static initcall_t __initcall_mymod \
>     __used __section(".initcall6.init") = NULL;
> 
> In fact, I'm using the code below to assign at runtime (dynamically) which
> function to be executed or not.
> 

Just use the standard initcall macros pointing to real functions.  If 
you want to do something tricky, put it in your own init function, and 
don't mess with the core kernel code that has been working fine for decades.

David Daney

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ