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] [day] [month] [year] [list]
Message-ID: <ZInInjGr6rufpC7u@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
Date:   Wed, 14 Jun 2023 16:03:10 +0200
From:   Alexander Gordeev <agordeev@...ux.ibm.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Philipp Rudo <prudo@...ux.ibm.com>,
        Michael Holzheu <holzheu@...ux.vnet.ibm.com>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-s390@...r.kernel.org
Subject: Re: [PATCH] s390/crash: Use the correct type for memory allocation

On Tue, Jun 13, 2023 at 10:30:28PM +0200, Christophe JAILLET wrote:
> get_elfcorehdr_size() returns a size_t, so there is no real point to
> store it in a u32.
> 
> Turn 'alloc_size' into a size_t.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Not sure if 'alloc_size' can overflow in real life application, but using
> the correct type looks harmless.
> 
> Should it be a real fix, either:
> Fixes: 8cce437fbb5c ("s390/kdump: Fix elfcorehdr size calculation")
> or
> Fixes: 60a0c68df263 ("[S390] kdump backend code")
> ---
>  arch/s390/kernel/crash_dump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
> index 8a617be28bb4..7af69948b290 100644
> --- a/arch/s390/kernel/crash_dump.c
> +++ b/arch/s390/kernel/crash_dump.c
> @@ -568,9 +568,9 @@ static size_t get_elfcorehdr_size(int mem_chunk_cnt)
>  int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size)
>  {
>  	Elf64_Phdr *phdr_notes, *phdr_loads;
> +	size_t alloc_size;
>  	int mem_chunk_cnt;
>  	void *ptr, *hdr;
> -	u32 alloc_size;
>  	u64 hdr_off;
>  
>  	/* If we are not in kdump or zfcp/nvme dump mode return */

Applied, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ