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: <OFD4BB6876.6D903346-ON8525798A.00550E62-8525798A.005562A3@gdeb.com>
Date:	Thu, 19 Jan 2012 10:32:36 -0500
From:	Michael D Labriola <mlabriol@...b.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	"H. Peter Anvin" <hpa@...or.com>,
	Kushal Koolwal <kushalkoolwal@...il.com>,
	linux-kernel@...r.kernel.org, michael.d.labriola@...il.com,
	Ingo Molnar <mingo@...e.hu>,
	Matthew Garrett <mjg59@...f.ucam.org>, support@...salogic.com,
	Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org
Subject: Re: [PATCH] x86, reboot: skip DMI checks if reboot set by user

Alan Cox <alan@...rguk.ukuu.org.uk> wrote on 01/17/2012 02:58:41 PM:

> On Tue, 17 Jan 2012 10:16:03 -0500
> Michael D Labriola <mlabriol@...b.com> wrote:
> 
> > This commit causes DMI checks for vendor specific reboot
> > quirks to be skipped if the user passed in a reboot= arg
> > on the command line.
> > 
> > Signed-off-by: Michael D Labriola <mlabriol@...b.com>
> > ---
> >  arch/x86/kernel/reboot.c |   16 ++++++++++++++--
> >  1 files changed, 14 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> > index 37a458b..4240d58 100644
> > --- a/arch/x86/kernel/reboot.c
> > +++ b/arch/x86/kernel/reboot.c
> > @@ -38,6 +38,7 @@ static const struct desc_ptr no_idt = {};
> >  static int reboot_mode;
> >  enum reboot_type reboot_type = BOOT_ACPI;
> >  int reboot_force;
> > +int reboot_user;
> 
> static ...

Oops, good point.

> >                 case 'f':
> >                         reboot_force = 1;
> > +                       reboot_user = 1;
> 
> Cleaner would be to add a 
> 
> BOOT_ACPI_FORCE perhaps so you can tell ACPI v ACPI specified by user
> 
> >                         break;
> >                 }
> > 
> > @@ -316,7 +322,10 @@ static struct dmi_system_id __initdata 
> > reboot_dmi_table[] = {
> > 
> >  static int __init reboot_init(void)
> >  {
> > -       dmi_check_system(reboot_dmi_table);
> > +       /* Skip the DMI check if user set reboot= on the command line 
*/
> > +       if (!reboot_user) {
> 
> then do
> 
>    if (reboot_type == BOOT_ACPI)
> > +               dmi_check_system(reboot_dmi_table);
> > +       }

This seems a little less obvious to the casual observer than the way I
implemented it... but maybe that's just me.  It would indeed disable DMI
checking if reboot_type's value is anything other than BOOT_ACPI (which
is the default), but that does assume BOOT_ACPI is the default.  What if
that's ever changed?  Seems likely to me that whoever changes the default
in the future could very easily re-break this at that point.

Thoughts?

I'm going to resubmit this patche anyway, as Ingo pointed out I've got
line-wrap issues.

---
Michael D Labriola
Electric Boat
mlabriol@...b.com
401-848-8871 (desk)
401-848-8513 (lab)
401-316-9844 (cell)


 


--
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