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:   Wed, 28 Feb 2018 12:29:04 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Jean Delvare <jdelvare@...e.de>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        linux-acpi@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/4] x86/pci: Re-use new dmi_get_bios_year() helper

On Mon, 2018-02-26 at 17:28 +0100, Jean Delvare wrote:

> > -	if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year
> > < 2008) {
> > -		if (iomem_resource.end <= 0xffffffff)
> > -			pci_use_crs = false;
> > -	}
> > +	if ((dmi_get_bios_year() < 2008) && (iomem_resource.end <=
> > 0xffffffff))
> > +		pci_use_crs = false;
> 
> You are changing the behavior here, when DMI does not provide a BIOS
> date. Beforehand, the test would fail and pci_use_crs would be left
> alone. After your change, dmi_get_bios_year() will return 0, and
> "0 < 2008" is true, so pci_use_crs is set to false.

Hmm... Indeed.

> I have no opinion on what this driver should do in such case,

I would assume that no BIOS date is related to prehistoric firmwares and
 using _CRS would sound weird on them.

>  but I
> certainly wouldn't expect a change of behavior from a "use a helper
> instead of open-coding" kind of patch.

Agree.

> I don't think you can safely assume that the code calling
> dmi_get_bios_year() will always do the right thing when 0 is being
> returned. It's up to the calling code to decide what the default
> behavior should be.

That's correct.

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ