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: <YsMVuVBoCVWUawsq@linux.ibm.com>
Date:   Mon, 4 Jul 2022 19:30:49 +0300
From:   Mike Rapoport <rppt@...ux.ibm.com>
To:     Lukas Bulwahn <lukas.bulwahn@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>, llvm@...ts.linux.dev,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] secretmem: drop unneeded initialization in
 secretmem_file_create()

Hi Lukas,

On Mon, Jul 04, 2022 at 11:26:05AM +0200, Lukas Bulwahn wrote:
> Drop the unneeded initialization of the local variable file in function
> secretmem_file_create().
> 
> No functional change and no change in the resulting object code.
> 
> This unneeded initialization was already introduced with the introduction
> of secretmem in commit 1507f51255c9 ("mm: introduce memfd_secret system
> call to create "secret" memory areas"). This minor code-stylistic issue
> was discovered as a dead store with clang-analyzer.

You are right and in the current code the initialization is unneeded, but
there's a pending patch that relies of this initialization:

https://lore.kernel.org/all/Yr1jKwz2+SGxjcuW@kernel.org/

Let's wait and see how that fix develops.

> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
> ---
> Mike, please ack.
> 
> Andrew, please pick this minor stylistic clean-up patch. Thanks.
> 
>  mm/secretmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/secretmem.c b/mm/secretmem.c
> index 7584aab54d20..46b431d62761 100644
> --- a/mm/secretmem.c
> +++ b/mm/secretmem.c
> @@ -171,7 +171,7 @@ static struct vfsmount *secretmem_mnt;
>  
>  static struct file *secretmem_file_create(unsigned long flags)
>  {
> -	struct file *file = ERR_PTR(-ENOMEM);
> +	struct file *file;
>  	struct inode *inode;
>  	const char *anon_name = "[secretmem]";
>  	const struct qstr qname = QSTR_INIT(anon_name, strlen(anon_name));
> -- 
> 2.17.1
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ