From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.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 719472E424F for ; Fri, 17 Apr 2026 13:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776432617; cv=none; b=NO/kgJsqr8Xx5survUFT862o4QkILZXTCS3uCVpf47JD4GlrmDZuAOcoLWrPp0muBSk16Uk+ERv6Xu1lVX16vDKMfRgbosRmtiM5FEO0diWGR6Ui09/7s0kHEONtLqU0iKfXB53dpeV94KGoG1g6B/ueCNn9GRTSMdL9hOz7s/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776432617; c=relaxed/simple; bh=mmFGveQqsE2c8/NM3AsDjz0c4xqesdBsl4N7CtWTYo8=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=E1pA4Ogtup/A1Kni7avTFdxWZkiAa2WobiU/4lEeRljHJgNNcY1o311wi/tAxslndJ0lRobzFD8lSRqepOawRklcSPU7G60URyml27ocEfRzY9+VxpqasEZXwhHpXUxmCseYzTlRGeWCslMohErf4fwwwt+cx5KSzE7/UgiSQ5s= 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.160.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-oa1-f69.google.com with SMTP id 586e51a60fabf-4240a9f9375so1355006fac.1 for ; Fri, 17 Apr 2026 06:30:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776432615; x=1777037415; 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=qh0vv5WbXi2nEkCrlyCYPYDCZL6I07bDA3VTMnickQY=; b=jy/oLnzPORpbdeqdqmlefcrwVTVPvTgw2NUAIMb6ok+tvwrtJQ8HxKH7/GRakIJQ2C QnL7PlRbmULRihubxLXRMLI6uHBjb8mBQNnSVNh8SywFl7L2rQEe2n77+P84tcypybzq BHPHt3SFVtTb40HRMuWxkJVa1NVK78FDz+mXYxQU/rB6z/sPFAFyykLevtc6Ri9CawXU WDOQrqvDlfK0VHip/xtexk8G29gmPj61RvungDZTcAf4o6wrcS4sM3B3JdA/1+lZA9ua ElcOuxRLHzEQn47JfRMD+PSwJqtSeJZnGuOhf5qBjy3289pu+sv23X6w8RZAYdUC7zSs hKoQ== X-Gm-Message-State: AOJu0YwqzoI0fiiETS3axlOtQ9vNT/q23Y3/QlOUvmt8JgBG1ks7Msxk fPrfTvhXlbCtOhfIeLejCIaVYIqce3oGmLDYjfNMup7CvR+AHVPtQOXQF7WsWN434bVkqkrXow9 UCq+6bH5nOTxOXU5FIkGO/7MIpGHX4mQvgw2K99q4JbLSou4ojHqLY9dLkH8= 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:99b:b0:68b:6c1d:2258 with SMTP id 006d021491bc7-69462eb9a9fmr1388731eaf.31.1776432615483; Fri, 17 Apr 2026 06:30:15 -0700 (PDT) Date: Fri, 17 Apr 2026 06:30:15 -0700 In-Reply-To: <69727142.050a0220.706b.0027.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e235e7.050a0220.1de265.0023.GAE@google.com> Subject: Forwarded: [PATCH v2] jfs: fix uninit-value and assert crash in txLock 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 v2] jfs: fix uninit-value and assert crash in txLock Author: tristmd@gmail.com #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master From: Tristan Madani Date: Thu, 17 Apr 2026 Subject: [PATCH v2] jfs: fix uninit-value and assert crash in txLock Two bugs in txLock(): 1) txInit() allocates the TxLock array with vmalloc(), which does not zero memory. The initialization loop only sets .next, leaving .tid uninitialized. When txLock() reads tlck->tid it hits uninitialized vmalloc data. Fix: vmalloc -> vzalloc. 2) The anonymous tlock list walk uses assert(last) inside a for-loop. On a corrupted filesystem image the list can be inconsistent, causing last == 0 before finding the target lid. This triggers BUG() via the assert macro. Fix: replace assert with graceful error + goto grantLock. Reported-by: syzbot+d3a57c32b9112d7b01ec@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=d3a57c32b9112d7b01ec Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- fs/jfs/jfs_txnmgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index 083dbbb0c..ec6217a2c 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c @@ -295,7 +295,7 @@ int txInit(void) * tlock id = 0 is reserved. */ size = sizeof(struct tlock) * nTxLock; - TxLock = vmalloc(size); + TxLock = vzalloc(size); if (TxLock == NULL) { vfree(TxBlock); return -ENOMEM; @@ -660,7 +660,10 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, for (last = jfs_ip->atlhead; lid_to_tlock(last)->next != lid; last = lid_to_tlock(last)->next) { - assert(last); + if (!last) { + jfs_err("txLock: lid %d not found in atl list", lid); + goto grantLock; + } } lid_to_tlock(last)->next = tlck->next; if (jfs_ip->atltail == lid) -- 2.43.0