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, 26 Sep 2022 14:02:17 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Florian Westphal <fw@...len.de>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org, vbabka@...e.cz,
        akpm@...ux-foundation.org, urezki@...il.com,
        netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
        Martin Zaharinov <micron10@...il.com>
Subject: Re: [PATCH mm] mm: fix BUG with kvzalloc+GFP_ATOMIC

On Mon 26-09-22 12:08:00, Florian Westphal wrote:
> Michal Hocko <mhocko@...e.com> wrote:
> > +		old_tbl = rht_dereference_rcu(ht->tbl, ht);
> > +		size = tbl->size;
> > +
> > +		data = ERR_PTR(-EBUSY);
> > +
> > +		if (rht_grow_above_75(ht, tbl))
> > +			size *= 2;
> > +		/* Do not schedule more than one rehash */
> > +		else if (old_tbl != tbl)
> > +			return data;
> > +
> > +		data = ERR_PTR(-ENOMEM);
> > +
> > +		rcu_read_unlock();
> > +		new_tbl = bucket_table_alloc(ht, size, GFP_KERNEL);
> > +		rcu_read_lock();
> 
> I don't think this is going to work, there can be callers that
> rely on rcu protected data structures getting free'd.

The caller of this function drops RCU for each retry, why should be the
called function any special?
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists