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>] [day] [month] [year] [list]
Message-Id: <20250226-20250221-warning-in-shmem_writepage-v1-1-5ad19420e17e@igalia.com>
Date: Wed, 26 Feb 2025 13:26:27 +0100
From: Ricardo Cañuelo Navarro <rcn@...lia.com>
To: Hugh Dickins <hughd@...gle.com>, 
 Andrew Morton <akpm@...ux-foundation.org>, 
 David Hildenbrand <david@...hat.com>, Yosry Ahmed <yosry.ahmed@...ux.dev>, 
 Luis Chamberlain <mcgrof@...nel.org>, Davidlohr Bueso <dave@...olabs.net>
Cc: Christian Brauner <brauner@...nel.org>, linux-mm@...ck.org, 
 linux-kernel@...r.kernel.org, Florent Revest <revest@...omium.org>, 
 kernel-dev@...lia.com, Pengfei Xu <pengfei.xu@...el.com>
Subject: [PATCH] mm: shmem: remove unnecessary warning in shmem_writepage()

Although the scenario where shmem_writepage() is called with info->flags
& VM_LOCKED is unlikely to happen, it's still possible, as evidenced by
syzbot [1]. However, the warning in this case isn't necessary because
the situation is already handled correctly [2].

[2] https://lore.kernel.org/lkml/8afe1f7f-31a2-4fc0-1fbd-f9ba8a116fe3@google.com/

Reported-by: Pengfei Xu <pengfei.xu@...el.com>
Closes: https://lore.kernel.org/lkml/ZZ9PShXjKJkVelNm@xpf.sh.intel.com/ [1]
Suggested-by: Hugh Dickins <hughd@...gle.com>
Cc: Florent Revest <revest@...omium.org>
Signed-off-by: Ricardo Cañuelo Navarro <rcn@...lia.com>
Fixes: 9a976f0c847b ("shmem: skip page split if we're not reclaiming")
---
 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 4ea6109a80431e5eeae15278064d5c86412f9fc9..a5eaad03038e8ca56a54d096159892e01c7a5bfe 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1548,7 +1548,7 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
 	if (WARN_ON_ONCE(!wbc->for_reclaim))
 		goto redirty;
 
-	if (WARN_ON_ONCE((info->flags & VM_LOCKED) || sbinfo->noswap))
+	if ((info->flags & VM_LOCKED) || sbinfo->noswap)
 		goto redirty;
 
 	if (!total_swap_pages)

---
base-commit: ac9c34d1e45a4c25174ced4fc0cfc33ff3ed08c7
change-id: 20250226-20250221-warning-in-shmem_writepage-e7f8f273317c

Cheers,
Ricardo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ