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]
Date:   Wed, 23 Nov 2022 16:23:36 +0100
From:   Juergen Gross <jgross@...e.com>
To:     Xiu Jianfeng <xiujianfeng@...wei.com>, boris.ostrovsky@...cle.com,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, jeremy@...p.org
Cc:     x86@...nel.org, xen-devel@...ts.xenproject.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] x86/xen: Fix memory leak issue

On 19.11.22 09:59, Xiu Jianfeng wrote:
> The new string allocated by kasprintf() is leaked on error path
> 
> Xiu Jianfeng (2):
>    x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
>    x86/xen: Fix memory leak in xen_init_lock_cpu()
> 
>   arch/x86/xen/smp.c      | 16 ++++++++++++----
>   arch/x86/xen/smp_pv.c   |  8 ++++++--
>   arch/x86/xen/spinlock.c |  3 ++-
>   3 files changed, 20 insertions(+), 7 deletions(-)
> 

Hmm, I think it would make more sense to always store the name generated
via kasprintf() in the percpu variable (independently from succeeding to
bind the irq), and in the related free function to always kfree() it and
set it to NULL again.

This would result in less code.


Juergen

Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ