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:   Thu, 9 Sep 2021 15:26:43 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Kees Cook <keescook@...omium.org>
Cc:     kernel test robot <lkp@...el.com>,
        Matt Porter <mporter@...nel.crashing.org>,
        Alexandre Bounine <alex.bou9@...il.com>,
        Jing Xiangfeng <jingxiangfeng@...wei.com>,
        Ira Weiny <ira.weiny@...el.com>,
        Souptick Joarder <jrdr.linux@...il.com>,
        "Gustavo A . R . Silva" <gustavoars@...nel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] rapidio: Avoid bogus __alloc_size warning

On 9/9/21 13:27, Andrew Morton wrote:
...
>>     include/linux/thread_info.h:213:4: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
>>       213 |    __bad_copy_to();
>>           |    ^~~~~~~~~~~~~~~
>>
>> But the allocation size and the copy size are identical:
>>
>> 	transfer = vmalloc(array_size(sizeof(*transfer), transaction.count));
>> 	if (!transfer)
>> 		return -ENOMEM;
>>
>> 	if (unlikely(copy_from_user(transfer,
>> 				    (void __user *)(uintptr_t)transaction.block,
>> 				    array_size(sizeof(*transfer), transaction.count)))) {
> 
> That's an "error", not a warning.  Or is this thanks to the new -Werror?
> 
> Either way, I'm inclined to cc:stable on this, because use of gcc-9 on
> older kernels will be a common thing down the ages.
> 
> If it's really an "error" on non-Werror kernels then definitely cc:stable.
> 

It looks like a hard error, not a warning upgraded by -Werror: I did a local
repro, then ran with V=1, removed all -Werror parts of the gcc invocation,
ran again, and still reproduced the error.

I also verified that the patch causes the error to go away.

Also, I can't find anything wrong with the diffs, so:

Reviewed-by: John Hubbard <jhubbard@...dia.com>


thanks,
-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ