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, 12 Jun 2023 17:09:37 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     James Clark <james.clark@....com>
Cc:     Shuai Xue <xueshuai@...ux.alibaba.com>,
        alexander.shishkin@...ux.intel.com, peterz@...radead.org,
        kirill@...temov.name, mingo@...hat.com, acme@...nel.org,
        mark.rutland@....com, jolsa@...nel.org, namhyung@...nel.org,
        irogers@...gle.com, adrian.hunter@...el.com,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org
Subject: Re: [PATCH 2/2] perf/ring_buffer: Fix high-order allocations for AUX
 space with correct MAX_ORDER limit

On Mon, Jun 12, 2023 at 09:45:38AM +0100, James Clark wrote:

[...]

> > @@ -609,8 +609,8 @@ static struct page *rb_alloc_aux_page(int node, int order)
> >  {
> >  	struct page *page;
> >  
> > -	if (order > MAX_ORDER)
> > -		order = MAX_ORDER;
> > +	if (order >= MAX_ORDER)
> > +		order = MAX_ORDER - 1;
> >  
> >  	do {
> >  		page = alloc_pages_node(node, PERF_AUX_GFP, order);
> 
> 
> It seems like this was only just recently changed with this as the
> commit message (23baf83):
> 
>    mm, treewide: redefine MAX_ORDER sanely
> 
>   MAX_ORDER currently defined as number of orders page allocator
>   supports: user can ask buddy allocator for page order between 0 and
>   MAX_ORDER-1.
> 
>   This definition is counter-intuitive and lead to number of bugs all
>   over the kernel.
> 
>   Change the definition of MAX_ORDER to be inclusive: the range of
>   orders user can ask from buddy allocator is 0..MAX_ORDER now.
> 
> It might be worth referring to this in the commit message or adding a
> fixes: reference. Or maybe this new change isn't quite right?

Good point.  If so, we don't need this patch anymore.

Thanks for reminding, James.

Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ