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] [day] [month] [year] [list]
Date:   Wed, 22 Jun 2022 07:39:41 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Pavel Machek <pavel@...x.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
        Borislav Petkov <bp@...e.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
Subject: Re: [PATCH 4.9 13/20] x86/speculation/mmio: Add mitigation for
 Processor MMIO Stale Data



On 6/22/22 04:48, Pavel Machek wrote:
> Hi!
> 
> 
>> +static int __init mmio_stale_data_parse_cmdline(char *str)
>> +{
>> +	if (!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA))
>> +		return 0;
>> +
>> +	if (!str)
>> +		return -EINVAL;
>> +
>> +	if (!strcmp(str, "off")) {
>> +		mmio_mitigation = MMIO_MITIGATION_OFF;
>> +	} else if (!strcmp(str, "full")) {
>> +		mmio_mitigation = MMIO_MITIGATION_VERW;
>> +	} else if (!strcmp(str, "full,nosmt")) {
>> +		mmio_mitigation = MMIO_MITIGATION_VERW;
>> +		mmio_nosmt = true;
>> +	}
>> +
>> +	return 0;
>> +}
> 
> This is wrong, AFAICT. Returning 0 will pollute init's environment;
> Randy was cleaning those lately and we are even seeing them in
> -stable. See for example b793a01000122d2bd133ba451a76cc135b5e162c.
> 
> The early return 0 should disappear, too; we should validate the
> option even on non-buggy machines.

It's good to be on the lookout for such problems, but __setup()
functions (like I was cleaning) are the opposite (sad:(  of
early_param() functions, which this one is.

early_param() does return 0 on success and non-zero
on error, so this looks OK to me.

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ