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:   Fri, 4 Nov 2022 17:47:05 +0800
From:   Chen Zhongjin <chenzhongjin@...wei.com>
To:     Liao Chang <liaochang1@...wei.com>, <linux@...linux.org.uk>,
        <linus.walleij@...aro.org>, <ardb@...nel.org>, <nico@...xnic.net>,
        <rmk+kernel@...linux.org.uk>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ARM: module: Reclaim the unwind list of module on kmalloc
 failed

On 2022/11/3 9:17, Liao Chang wrote:
> When unwind table allocation failed, it needs to reclaim the unwind list
> of module to avoid potential NULL pointer exception and memory leakage.
>
> Fixes: b6f21d14f1ac ("ARM: 9204/2: module: Add all unwind tables when load module")
> Signed-off-by: Liao Chang <liaochang1@...wei.com>
> Cc: Chen Zhongjin <chenzhongjin@...wei.com>
> ---
>   arch/arm/kernel/module.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
> index d59c36dc0494..cc637dcdcb10 100644
> --- a/arch/arm/kernel/module.c
> +++ b/arch/arm/kernel/module.c
> @@ -485,6 +485,10 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
>   						s->sh_size,
>   						txt_sec->sh_addr,
>   						txt_sec->sh_size);
> +			if (!table) {
> +				module_arch_cleanup(mod);
> +				return -ENOMEM;
> +			}
>   
>   			list_add(&table->mod_list, unwind_list);
>   

Looks good to me.

Reviewed-by: Chen Zhongjin <chenzhongjin@...wei.com>


Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ