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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <91acdece-92a1-c23b-f835-34c8e8f3aad0@web.de>
Date:   Tue, 23 Jun 2020 18:26:15 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     Chen Tao <chentao107@...wei.com>, linux-afs@...ts.infradead.org
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        David Howells <dhowells@...hat.com>
Subject: Re: [PATCH] afs: Fix the memory leak in afs_mkdir

…
> +++ b/fs/afs/dir.c
> @@ -1599,17 +1599,17 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
…
>  	scb = kcalloc(2, sizeof(struct afs_status_cb), GFP_KERNEL);
>  	if (!scb)
>  		goto error_scb;

I suggest to adjust also this jump target so that a call of the function “kfree”
with a null pointer can be avoided.


…
> @@ -1645,10 +1645,10 @@  static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
…
>  error_key:
>  	key_put(key);
> +error_scb:
> +	kfree(scb);
>  error:
>  	d_drop(dentry);
…

Can an other label than “error” be nicer here?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ