From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (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 2B96F3B7754 for ; Fri, 17 Apr 2026 10:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776420769; cv=none; b=oKKJDPa6vOdYSTgD24EsM3/SOBiycUCbxao0xwYiP/hwN9ie9whfnOweTPJlVXt9Kmv0f4GHUvxEbFlN0/xRWNMi8lzZN5ApUnTbI2P7OrwjdOGn9dAxNn5D8ExtVRBCEaivn83yjktanTb1nqc4txQOfMnp2XwIlZnTMDPwW1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776420769; c=relaxed/simple; bh=Ojbcb+IhtIUWXrF/9KXYDwuW8QH6JEKng/7w6rM/kXo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=szwziHCw0pkp884f13WPgwAMW+SDKsXViEw00sEg3UAyp44+KCHdE8CRH2nIkmnnMc0CPXoLDJm8yD+dyLciNTKSAntg90qR18W+bfrTYmC7+SYWb0aeqc17iv09Ph8iHSvtFJ1u0DdG2XSfPHA+eMfVsMZBu9xX0GVL//SDAto= 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.69 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-f69.google.com with SMTP id 006d021491bc7-679c51b2d6cso763302eaf.2 for ; Fri, 17 Apr 2026 03:12:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776420766; x=1777025566; 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=FcYS420z/m5/pJrf96MyltqMylr6eAGFzUhn1WHkpQQ=; b=T+5EjVsv7+wsihpQuDCd+d52re0Wm1LFxwgIQcSCy79gsrdM7QBzfb1IOhR2fXfYh9 5xV8Vig1v99X4PgcQDlFNJaCseH6zGFw/M+/IomRjJjxuEIz0zcfE53s5HT0lgp08rNY 9xUKuojxw5T0kJ247xdH1YlTJCinSU88wHx+mNoGd7+00UWuTe4YzPSrycoG2B6CGyAu dLI+4JluPLf/xgATdEjfCyjqgqY2KWHwhRir+/tj2EHQwHut6MDrjoE77LlfvMtjGvbV RLp2NCek+7UYJ8ky34obUfq/jIICDJC4v+realsBWjTP2TPOQzGSN8AkzHtEIyX3knpS QINw== X-Gm-Message-State: AOJu0Yyd4uTsWxY4IAPiPeHhypsu1LU3Hal/i8+V+0HHjHUAD5TIHMmB fAspoWW+cHHN/vyxICeYwo3WzxgAKhNzCDXDqlYoacG6qMtSh4DJ4txrYN3CkxwAsQ+KZK/f4B7 cDPWf8/PVBE24JzRaSelIa5qUi3NEW1BXQ0ZUIEq+lobkLfFzgSmRZ/1OuLA= 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:98a:b0:68e:e069:7a21 with SMTP id 006d021491bc7-69462f2fc95mr1126269eaf.43.1776420766037; Fri, 17 Apr 2026 03:12:46 -0700 (PDT) Date: Fri, 17 Apr 2026 03:12:46 -0700 In-Reply-To: <000000000000ca86690612e7cacd@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e2079e.a00a0220.1cdc.000f.GAE@google.com> Subject: Forwarded: [PATCH] gfs2: remove WARN_ON_ONCE in gfs2_check_blk_type From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com 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: remove WARN_ON_ONCE in gfs2_check_blk_type Author: tristmd@gmail.com From: Tristan Madani #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master gfs2_check_blk_type() calls gfs2_rbm_from_block() and wraps the error check in WARN_ON_ONCE(): error = gfs2_rbm_from_block(&rbm, no_addr); if (!WARN_ON_ONCE(error)) { When the block address falls outside the resource group (which happens with corrupted on-disk metadata), gfs2_rbm_from_block() returns an error and the WARN_ON_ONCE fires, producing a kernel stack trace. The error is already handled correctly by the function -- the block type test is skipped and the error code propagates to the caller. Only the WARNING itself is problematic. Replace the WARN_ON_ONCE with a plain error check and map the error to -ESTALE for the caller (gfs2_fh_to_dentry). Reported-by: syzbot+26e96d7e92eed8a21405@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=26e96d7e92eed8a21405 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- fs/gfs2/rgrp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index XXXXXXX..XXXXXXX 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -2627,7 +2627,10 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type) rbm.rgd = rgd; error = gfs2_rbm_from_block(&rbm, no_addr); - if (!WARN_ON_ONCE(error)) { + if (error) { + error = -ESTALE; + } else { /* * No need to take the local resource group lock here; the * inode glock of @no_addr provides the necessary -- 2.43.0