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: <556F1E9A.7030601@amd.com>
Date:	Wed, 3 Jun 2015 10:34:50 -0500
From:	Aravind Gopalakrishnan <aravind.gopalakrishnan@....com>
To:	Borislav Petkov <bp@...en8.de>
CC:	<dougthompson@...ssion.com>, <mchehab@....samsung.com>,
	<linux-edac@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<x86@...nel.org>
Subject: Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use
 string arguments

On 6/3/2015 9:50 AM, Borislav Petkov wrote:
> On Tue, Jun 02, 2015 at 03:35:56PM -0500, Aravind Gopalakrishnan wrote:
>
>
>> +
>> +	buf[cnt - 1] = 0;
>> +
>> +	/* strip whitespaces.. */
>> +	strstrip(buf);
> Didn't your compiler trigger that:
>
> drivers/edac/mce_amd_inj.c: In function ‘flags_write’:
> drivers/edac/mce_amd_inj.c:146:2: warning: ignoring return value of ‘strstrip’, declared with attribute warn_unused_result [-Wunused-result]
>    strstrip(buf);
>    ^
>
> ?


Oddly, No. The only thing I got was:
arch/x86/kernel/cpu/microcode/intel_early.c: In function 
âget_matching_model_microcode.isra.2.constprop.7â:
arch/x86/kernel/cpu/microcode/intel_early.c:348:1: warning: the frame 
size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  }
  ^



>
> Because it is a valid warning. You need to take the return value. I
> fixed it up like this:

Thanks for fixing it.

-Aravind.

> ---
> diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c
> index c129a8da34b2..5c847fe6e9bd 100644
> --- a/drivers/edac/mce_amd_inj.c
> +++ b/drivers/edac/mce_amd_inj.c
> @@ -128,7 +128,7 @@ static ssize_t flags_read(struct file *filp, char __user *ubuf,
>   static ssize_t flags_write(struct file *filp, const char __user *ubuf,
>   			   size_t cnt, loff_t *ppos)
>   {
> -	char buf[MAX_FLAG_OPT_SIZE];
> +	char buf[MAX_FLAG_OPT_SIZE], *__buf;
>   	int err;
>   	size_t ret;
>   
> @@ -142,12 +142,12 @@ static ssize_t flags_write(struct file *filp, const char __user *ubuf,
>   
>   	buf[cnt - 1] = 0;
>   
> -	/* strip whitespaces.. */
> -	strstrip(buf);
> +	/* strip whitespace */
> +	__buf = strstrip(buf);
>   
> -	err = __set_inj(buf);
> +	err = __set_inj(__buf);
>   	if (err) {
> -		pr_err("%s: Invalid flags value: %s\n", __func__, buf);
> +		pr_err("%s: Invalid flags value: %s\n", __func__, __buf);
>   		return err;
>   	}
>
>

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