From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) (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 B9AFA1632E7 for ; Sat, 18 Jul 2026 02:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784340348; cv=none; b=QE/9jEBgyY9G82ytoGL6jIpI5saCoGrrOT+SsKDV3wbsGskZPR9Uu9U4YLDKNT82G9MnAOe7mtwzUHoIbiA/Tp7qSA0pt8HstdKXpjhH46FVVoaCW2wEGrnLkg1ihnhvc+MzzcgIZ3mdqFVWRZwuoeQfgQXOzzdCQI07nSX69Hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784340348; c=relaxed/simple; bh=K7xajJCbib1sxRVLDkk1W6j1ZaDsqO4DwS05r8S7p1s=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=OCtGetiuVx6gXflHVr6tvJtwaId9+E/1kjyd8x4t+u9URlEaYvTTZUG0Gh66nc4er0PDKhN7lt4hzOG+vVu5VHrZ5QfVORpxC/0aZ4gxmeSW0aOwUSkisE2c0nAn76rUa6SqpkYTRb2a/mGNW9pTGm8g4hYjQrhHbf5in/Bb/3o= 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.200 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-f200.google.com with SMTP id 5614622812f47-4a45b3f0bdfso7842121b6e.1 for ; Fri, 17 Jul 2026 19:05:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784340345; x=1784945145; 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=ygLlnWgjMES8PFaS+rF/LtJ8BvTGyFYs8/CNb0chHzs=; b=e5/tlg2/+9SR9JRK76v+ubVcJPgok1rTadwKLs4AFJUGgnaGmW/W+hSO1ebYpY4nLf IRQzGUP3XhRNIgHWxu119sJyDXjsC+XIUHELCC8+ykjAphLSpLlW8k8qfM72sHWJTHM9 KEmYhjwCJNe4vkgz3NYrJPJtMnr6wSsEjV+oKyC9yVOY1Qn+j3zU2yjA3Bj9GDqemDbB 2pk5JUI0P6deL24ikSnK2bvROxxa0685Qas+OZnf/DMNCICgnYgj2TypfXOywlASdgh+ G81vcvraQ2PBwQ38I19NWQ+vtRLsq1hKi2LJ0cVO9sAvxiqVPnBXRVIOsaJnIi4yN4fm 7QFA== X-Gm-Message-State: AOJu0YxuwlU1ZSF6iOGYeuJ3dRI7loXqnkvrAiybkCjlsIes4akaF/dk X0is+LK06MQEI87Bn4QkM4YWiwP9xww9IB+jUouZwmDfbPmUPzrKBKL7I+SNPPg0f92IsFrU3vb 3R3SyG2V5qZ/LsAA4PBkp6IiM9BF7Dc3i5CJvk+t3BOzIB3hogYMglHTNrOA= 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:f94:b0:4a4:c623:4c0b with SMTP id 5614622812f47-4a4d03233a0mr2388193b6e.4.1784340345675; Fri, 17 Jul 2026 19:05:45 -0700 (PDT) Date: Fri, 17 Jul 2026 19:05:45 -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: <6a5adf79.42649fcc.6186.0063.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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 8045e4ff270c..53d783235da9 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -812,7 +812,14 @@ 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); + brelse(iloc.bh); + folio_unlock(folio); + folio_put(folio); + return -EIO; + } /* * ei->i_inline_off may have changed since -- 2.43.0