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>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 08 Feb 2023 08:21:58 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Jiasheng Jiang" <jiasheng@...as.ac.cn>,
        "Oded Gabbay" <ogabbay@...nel.org>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        ttayar@...ana.ai, dliberman@...ana.ai, obitton@...ana.ai,
        osharabi@...ana.ai, dhirschfeld@...ana.ai
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] habanalabs: Fix freeing uninitialized pointers

On Wed, Feb 8, 2023, at 08:05, Jiasheng Jiang wrote:
> As the memory allocated by kcalloc has not been set to zero, it may
> contain uninitialized pointers.
> Therefore, free the non-NULL pointers may cause undefined behaviour.
>
> Fixes: 5574cb2194b1 ("habanalabs: Assign each CQ with its own work queue")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>

Did you run into a bug here or find that by inspection?

kcalloc() is definitely meant to return zeroed memory, so I don't see
a bug here:


static inline __alloc_size(1, 2) void *kcalloc(size_t n, size_t size, gfp_t flags)
{
        return kmalloc_array(n, size, flags | __GFP_ZERO);
}


       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ