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:   Sun, 7 May 2017 16:59:46 -0700
From:   Guru Das Srinagesh <gurooodas@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     oleg.drokin@...el.com, andreas.dilger@...el.com,
        jsimmons@...radead.org, gregkh@...uxfoundation.org,
        lustre-devel@...ts.lustre.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: lustre: llite: Fix variable length array
 warning

On Sun, May 07, 2017 at 04:24:51PM -0700, Joe Perches wrote:
> On Sun, 2017-05-07 at 02:23 -0700, Guru Das Srinagesh wrote:
> > Fix sparse warning "warning: Variable length array is used." by using
> > kmalloc_array to allocate the required amount of memory instead and
> > kfree to deallocate memory after use.
> []
> > diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
> []
> > @@ -86,13 +86,17 @@ ll_xattr_set_common(const struct xattr_handler *handler,
> >  		    const char *name, const void *value, size_t size,
> >  		    int flags)
> >  {
> > -	char fullname[strlen(handler->prefix) + strlen(name) + 1];
> > +	int fullname_len = strlen(handler->prefix) + strlen(name) + 1;
> > +	char *fullname = kmalloc_array(fullname_len, sizeof(char), GFP_KERNEL);
> 
> Are you sure about using GFP_KERNEL and that sleeping is
> allowed for this function allocation?
> 
I'm not sure about that. Would GFP_ATOMIC be a better flag to use?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ