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: <0c47ee47-35a0-65ee-4da1-e1745f882947@de.ibm.com>
Date:   Mon, 11 Nov 2019 17:40:52 +0100
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     Markus Elfring <Markus.Elfring@....de>, linux-s390@...r.kernel.org,
        Harald Freudenberger <freude@...ux.ibm.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        Ingo Franzki <ifranzki@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Joe Perches <joe@...ches.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org, Kangjie Lu <kjlu@....edu>,
        Navid Emamdoost <emamd001@....edu>,
        Stephen McCamant <smccaman@....edu>
Subject: Re: [PATCH v4] s390/pkey: Fix memory leak in error case by using
 memdup_user() rather than open coding


On 11.11.19 15:45, Markus Elfring wrote:
> Date: Mon, 11 Nov 2019 15:20:44 +0100
> 
> Reuse existing functionality from memdup_user() instead of keeping
> duplicate source code.
> 
> Generated by: scripts/coccinelle/api/memdup_user.cocci
> 
> * The function "_copy_apqns_from_user" contained a memory leak
>   because of a misssing function call "kfree(kapqns)" for an if branch.
>   Link: https://lore.kernel.org/r/833d7d5e-6ede-6bdd-a2cc-2da7f0b03908@de.ibm.com/
> 
>   Thus complete the exception handling by this code replacement.
> 
> * Delete local variables which became unnecessary with this refactoring
>   in two function implementations.
> 
> Fixes: f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d ("s390/pkey: add CCA AES cipher key support")
> Signed-off-by: Markus Elfring <Markus.Elfring@....de>
> ---
> 
> v4:
> Further changes were requested by Christian Bornträger.
> https://lore.kernel.org/r/040f3e18-d97a-fc32-b237-20e7553e1733@de.ibm.com/
> 
> * An other patch subject was selected.
> 
> * An other email address was used for the tag “Signed-off-by” this time.

applied. [...]

> +	if (!uapqns || nr_apqns <= 0)

While applying I changed that to 
	if (!uapqns || nr_apqns == 0)

as nr_apqns is size_t and thus unsigned. 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ