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>] [day] [month] [year] [list]
Message-ID: <BANLkTinC10VapWniyuEE3RLgVRC6fm1EcQ@mail.gmail.com>
Date:	Fri, 6 May 2011 15:09:22 -0500
From:	Mike Waychison <mikew@...gle.com>
To:	Matt Domsch <Matt_Domsch@...l.com>
Cc:	Randy Dunlap <randy.dunlap@...cle.com>,
	lkml <linux-kernel@...r.kernel.org>,
	akpm <akpm@...ux-foundation.org>,
	"matthew.e.tolentino@...el.com" <matthew.e.tolentino@...el.com>,
	Greg Kroah-Hartman <gregkh@...e.de>
Subject: Re: [PATCH] efivars: prevent oops on unload when efi is not enabled

On Fri, May 6, 2011 at 3:04 PM, Matt Domsch <Matt_Domsch@...l.com> wrote:
> On Fri, May 06, 2011 at 02:57:02PM -0500, Randy Dunlap wrote:
>> From: Randy Dunlap <randy.dunlap@...cle.com>
>>
>> unregister_efivars() should check for efi_enabled and not undo
>> allocations when efi is not enabled.  Otherwise there is an Oops
>> during module unload:
>
> Thanks Randy.
>
> I'm not sure why the driver is still loaded at all if efi_enabled==0.
>
> static int __init
> efivars_init(void)
> {
> ...
>        if (!efi_enabled)
>                return 0;
>
>
>
> That return 0 should be return -ENODEV I think.  Mike?

Ya, I changed efivars so that others could still use the
register_efivars/unregister_efivars interfaces when !efi_enabled.
They are used by the drivers/firmware/google/gsmi.c driver currently
pending in linux-next.

I think the right approach in this case would be to do

        if (efi_enabled) {
               unregister_efivars(&__efivars);
               kobject_put(efi_kobj);
        }

in efivars_exit().

>
> Thanks,
> Matt
>
> --
> Matt Domsch
> Technology Strategist
> Dell | Office of the CTO
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ