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:   Mon, 13 Jun 2022 11:14:04 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     wuchi <wuchi.zero@...il.com>
Cc:     alexs@...nel.org, sjhuang@...vatar.ai, sfr@...b.auug.org.au,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lib/genalloc: Set chunk size to real size which
 gen_pool managed.

On Sun, 12 Jun 2022 18:59:37 +0800 wuchi <wuchi.zero@...il.com> wrote:

> The demand size (chunk->avail > size > round_down(chunk->avail)) will
> lead to meaningless algo calls in gen_pool_alloc_algo_owner without the
> patch, alse move the follow code:
> 	size = nbits << order
> out of read-side critical section.
> 

Nobody has seriously worked on this code in a long time :(

Please expand more on the flaw.  What are "algo calls"?  Why are they
meaningless, etc?  What are the runtime effects of this error?

> --- a/lib/genalloc.c
> +++ b/lib/genalloc.c
> @@ -193,6 +193,7 @@ int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt, phys_addr_t ph
>  	if (unlikely(chunk == NULL))
>  		return -ENOMEM;
>  
> +	size = nbits << pool->min_alloc_order;

If we're going to do this then gen_pool_add_owner() no longer needs its
`size' argument.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ