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, 13 Aug 2020 11:08:41 -0400
From:   Josef Bacik <josef@...icpanda.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     hch@....de, viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH] proc: use vmalloc for our kernel buffer

On 8/13/20 10:59 AM, Matthew Wilcox wrote:
> On Thu, Aug 13, 2020 at 10:53:05AM -0400, Josef Bacik wrote:
>> +/**
>> + * vmemdup_user - duplicate memory region from user space and NUL-terminate
> 
> vmemdup_user_nul()
> 
>> +void *vmemdup_user_nul(const void __user *src, size_t len)
>> +{
>> +	void *p;
>> +
>> +	p = kvmalloc(len, GFP_USER);
> 
> len+1, shirley?
> 
>> +	if (!p)
>> +		return ERR_PTR(-ENOMEM);
>> +
>> +	if (copy_from_user(p, src, len)) {
>> +		kvfree(p);
>> +		return ERR_PTR(-EFAULT);
>> +	}
> 
> I think you forgot
> 
>          p[len] = '\0';
> 

Sweet lord I need more sleep, my bad.  Thanks,

Josef

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ