From nobody Fri Apr 3 17:32:20 2026 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E3A42288E3 for ; Tue, 24 Mar 2026 01:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774316950; cv=none; b=qGxQZ3c5QYqfuXCDyYeRAr12ru8pxfp5Tfpg7Ea4CqqhRXt2qA/NT4/e8PJv2EJUVAwnTg174uZX+Hc6PKlFivBFsfIAJOPGM/wdbdAvmPveq0Ah9kC6v7Xo4OE2ahsLzl/9kwQh5+S2uK5ZWH+I6g7UJsza2gbTzajVBeJTWnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774316950; c=relaxed/simple; bh=PJTb/AF/+ls8CQJqjPzGEO2xeHVf+0t8npkJOStnBFg=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=byDRpI8zyhfesJ+DJZByOWMku4LubEWcR0+z4F//7VIPWtRAWbba77no+pv/VQ2V8G3jQC3LgvmM/XIz1jfPGfQ1Jiy+/T8IVJfqgVoEkQup5BaT/CcTVy/KxHddXzTbtGQCpyujJLfnCF26ZI8zdv/rJGBwbflnFaQd01q9SCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-67c7f139d4aso48828519eaf.3 for ; Mon, 23 Mar 2026 18:49:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774316948; x=1774921748; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SCyFeJvoH/ZSsVnnfqifjk2LQq6CS7qRXSe3e9gCEyY=; b=kdM3g/y4ajWKORL1qcbQb2d5A9RlAP0wMuzJaxNTwpETaKS3270zJD7D+VRl6WbxWv E9keti7f7ErQZj+oEj2c8lAalHIO7rYdA/n9qHTy/4GyAhRORCSVMu25SAoUkBEgVa5N XNuyiAKuX2tnNsT9CEXoegwkJHcrcNLhfryFqkxFc/MgEYv/thvIxqOrn59SX57NEfew 3QlVdY/A14+2wh04c0quczKO89LkUMhS9Yrmz3ti9q1inIMeSA4C0SkkGsR/GlPCd/xv OIUz5ieLgmLw7pptRKvd7knbATxb4ItQNWHBDbZSLtu6tKlAFzvi8vPouxQ1J7+uzM7A vnKg== X-Gm-Message-State: AOJu0YyEaERPR2yift7JUKbLw6EslHWncVbmmkqDz6HiQEySZDHcQumu baj0I78Y7emXw0gO/+LVzpKq/BQwb4Lnn0gzUSRxXT/n+h+0iIcD0oCrIj2SALstcg0gFHfN5qz j1tg2g4c8HmXgjk/aDf3MiymSVNuh5CMiRbq5Q0ADuX9q+d+On3DK8gvUMVg= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:168c:b0:67d:ebc4:1925 with SMTP id 006d021491bc7-67debc41b43mr4210638eaf.43.1774316948187; Mon, 23 Mar 2026 18:49:08 -0700 (PDT) Date: Mon, 23 Mar 2026 18:49:08 -0700 In-Reply-To: <69c19ef0.050a0220.3bf4de.00a9.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69c1ed94.a70a0220.3cae05.0004.GAE@google.com> Subject: Forwarded: [PATCH] gfs2: fix hung task in gfs2_jhead_process_page From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] gfs2: fix hung task in gfs2_jhead_process_page Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi= t master filemap_get_folio() can return an ERR_PTR if the folio is not present in the page cache. This can happen when a crafted or corrupted GFS2 filesystem image is mounted and journal recovery is triggered. gfs2_jhead_process_page() calls filemap_get_folio() without checking the return value, and passes the result directly to folio_wait_locked(). When an ERR_PTR is passed to folio_wait_locked(), the kernel task gets stuck in uninterruptible sleep (state D) forever, triggering the hung task watchdog. This was reported by syzbot. The reproducer mounts a crafted GFS2 image which causes gfs2_find_jhead() to call gfs2_jhead_process_page() on a page that was never properly submitted for I/O, causing filemap_get_folio() to return ERR_PTR(-ENOENT). Fix this by checking the return value of filemap_get_folio() and marking the journal head search as done if the folio is not found, allowing the caller to return an error gracefully. Reported-by: syzbot+9013411dc43f3582823a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D9013411dc43f3582823a Signed-off-by: Deepanshu Kartikey --- fs/gfs2/lops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 797931eb5845..c2bb262318bb 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -467,6 +467,11 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc = *jd, unsigned long index, =20 folio =3D filemap_get_folio(jd->jd_inode->i_mapping, index); =20 + if (IS_ERR(folio)) {=20 + *done =3D true; + return ; + } + folio_wait_locked(folio); if (!folio_test_uptodate(folio)) *done =3D true; --=20 2.43.0