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: <ZOY2nMjTOVe2ozIS@x1n>
Date:   Wed, 23 Aug 2023 12:41:00 -0400
From:   Peter Xu <peterx@...hat.com>
To:     Hugh Dickins <hughd@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Edward Liaw <edliaw@...gle.com>, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH mm-hotfixes-unstable] shmem: fix smaps BUG sleeping while
 atomic

On Tue, Aug 22, 2023 at 10:14:47PM -0700, Hugh Dickins wrote:
> smaps_pte_hole_lookup() is calling shmem_partial_swap_usage() with page
> table lock held: but shmem_partial_swap_usage() does cond_resched_rcu()
> if need_resched(): "BUG: sleeping function called from invalid context".
> 
> Since shmem_partial_swap_usage() is designed to count across a range, but
> smaps_pte_hole_lookup() only calls it for a single page slot, just break
> out of the loop on the last or only page, before checking need_resched().
> 
> Fixes: 230100321518 ("mm/smaps: simplify shmem handling of pte holes")
> Signed-off-by: Hugh Dickins <hughd@...gle.com>
> Cc: stable@...r.kernel.org # 5.16+

Oops.. thanks Hugh.

Acked-by: Peter Xu <peterx@...hat.com>

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ