From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (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 131993ECBC8 for ; Fri, 17 Jul 2026 13:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784295706; cv=none; b=qm6bu4VPTfYdQWXB+CfHeFrVwn3NFZvYZDh8aMO7lx5NoLOb+umqVH49HMeJ4QLv9a5vc6uBTSN7YaC/+hIrE3LbCAzzNBwLeNCjOdBPvfaNPw+gtFiWDU7HKBO3t03jxTSgoBErAJL9GlWHpEg9yDybhOBveQgZjHyhXelfkvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784295706; c=relaxed/simple; bh=JMTMkNz5eqt1NkhpUZ+PDvrXdEx6icBlUM4JGG5t11c=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=f2+vL8ylhI2Tbu7Eg62MDgEMv4jEpViVV2oMf/PXbJ9ih6uIfhR6Hcd0YkcFNGveFqupRIYvR9/goGyUoff1iezxB8mR+w6c5gFrZujQzMCd5opOReqhIMlPxTjt2vwGioFLlKFTQedzo40bZuPJdenc24Bq0GYN2k7IaeFTzog= 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.167.198 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-oi1-f198.google.com with SMTP id 5614622812f47-4a41f46d629so6660046b6e.3 for ; Fri, 17 Jul 2026 06:41:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784295703; x=1784900503; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=VZnxYSNLOvg+ss583IGUZEtSKI9EmCJPon4GPTAJ3qs=; b=CpD+FmM1CuCeXj9X585vEvnqz3UUaSQqccVp+4uvQqoKLl9ME+mFxp9S0hO1Vpueil QXOMnmeRgfjztc/zvun+uW43tSzrrWOmu3n8bsJBSbwbNxsTh0EWmWFEFClyweGzDUuv Ay2buzyhBuUsEVB9bIJjPPlyvmtDQ6LyDepFusa1iUwbWLjf9yCD7aszjp9iWrWaKtKf fr0lc6cdMitqdUEaLRDhHo85wzzm2pzacuVYG3/NgsIGX+EO+yWMJ1IPs13TJ6s8ZEQ9 5spRWT4GzDj6leBC+dVt+hQor1LPu1emqjfrdBqetBOWVcNonuQMFwyQPEhPqprDpGsP /S0A== X-Gm-Message-State: AOJu0YwhCYOjC5Rd2ixNh4/9HMT1TN7PMhl+IoP6tsHDrxW3f4spE8i8 F1oMMDlHsIUPINs+siUovbnI29pZgl0Mc3ppDzVQvAyrlWzRF6bkMB6wgN83NUjM1dkDROszyB0 jWdxPZRsyMCyZmwmPHY6XT7mPMzmPzQ+5ENPCCPeIevyqACOntxclmFt3EL0= 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:6808:1245:b0:495:dd83:6b8e with SMTP id 5614622812f47-4a4d05658femr1159225b6e.33.1784295703756; Fri, 17 Jul 2026 06:41:43 -0700 (PDT) Date: Fri, 17 Jul 2026 06:41:43 -0700 In-Reply-To: <6a588d44.c96faac9.59e0.0012.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a5a3117.42649fcc.6186.001a.GAE@google.com> Subject: Forwarded: [PATCH] ext4: handle inline-to-block file conversion race with error return 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] ext4: handle inline-to-block file conversion race with error return Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci Replace fatal BUG_ON(!ext4_has_inline_data(inode)) with a defensive check that returns -EIO when a file has been converted from inline to block storage during write completion. A file can transition from inline to block storage via concurrent paths (mmap, readahead, truncate) while a write completion is in flight. If this occurs, the write is in an inconsistent state and should not silently succeed. Returning -EIO signals the error to the caller, allowing proper retry and preventing silent data corruption. Reported-by: syzbot+293a57918b36cfae3d48@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=293a57918b36cfae3d48 Signed-off-by: Deepanshu Kartikey --- fs/ext4/inline.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 8045e4ff270c..887a153924af 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -812,7 +812,11 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, goto out; } ext4_write_lock_xattr(inode, &no_expand); - BUG_ON(!ext4_has_inline_data(inode)); + /* File may have been converted to block storage by concurrent path */ + if (!ext4_has_inline_data(inode)) { + ext4_write_unlock_xattr(inode, &no_expand); + return -EIO; + } /* * ei->i_inline_off may have changed since -- 2.43.0