From nobody Sat Feb 7 07:10:25 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 CDCA3221721 for ; Mon, 2 Feb 2026 13:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770037266; cv=none; b=ObdyLve6K3mq1KwuBhN1/8D7T4SLCMAjKE+7a20mp/iljPSkpdgY+i6woNwg3VvBjXBh6iXspj83jIA5qpPePcc31d2qqfyWOYcmpJvoTO8od9o7cbXpYKPxf8Zh1p7GPLsDfnwY5d4IU6dxwxwU3RGuh5ShNuaJ22pNsF6PVwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770037266; c=relaxed/simple; bh=RP6S1ivaYAK6Fs5+VhDcT3M8k5FicM0n51mqRABDv7k=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Bdi1CtzBcDdZaUoSrGBPPjJh9hj6O4EPjNpJ+YiMVRwIpmnbtVVthYec8X/Ma9Id9SsG47Jau8VOD+HJ3teOoNvBzOpDtX2j5/XT98ADYt+dzanrQcspE34EAehHsm1RYQ84DWYD3ovlyYTQerHHQPrA0A/eTQbz3k1JGiinjaQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fddfBVP8; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fddfBVP8" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-81e8b1bdf0cso2727374b3a.3 for ; Mon, 02 Feb 2026 05:01:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770037264; x=1770642064; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=n05z2JgZ055VI92yGkVjhSrgVttdCiXX4GMR4DMFah4=; b=fddfBVP8UIFQqZbOTkv2622/ujj7xN6O5ywbBO2It8D89SfN0y7G8RyqQvqDdBJV4O j40HB9YGKNcXxPk51dkhJAgvQmeoIRBf7nheI2FpJc33HvEh9Zu0UM+kMxHo3Y62wLny yd0Clmi9Q7jkMGgIi0DTp0J1/z+LXFt/2gF+K0dnmqH3exi5yPfuSaLw37jN+qiqAnJ2 1hIQoJdYN5QNefGZd1kvZjn3S7LjjnbOXGV0XpqJVFB+8yrkQpE7HSiVvvGs3a66CSLg zWBjjy1yuOhoBqpVIokNPRY0tNE/VZoLiBBchRvtUiiP4xcVOy3CRajNufMQVQumoazB bVhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770037264; x=1770642064; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=n05z2JgZ055VI92yGkVjhSrgVttdCiXX4GMR4DMFah4=; b=v37kfcV8XpwcYNJ1P2GPc3fiE6671tF2cqtgFJ84vXecjfh9SRbELkJNDKxd8bJcJ6 LIbDwJy4PyEcsNR3eUP0+td7yx+HN39RjGvUXZqocV/Qr4otMdQfhHvmiZGzCICx1b8W soxtUOGIE/ckMOrLSYbeyQ82Lw0RVxLCwwodkPtZ3jvogS3MlGkK6G+7vASrPKVYblrX G+OssHp4PNRYrOhcWuDr3TUxHXfwUiMz4QxewlAfjF6m/lO6VxppZzrYAo2weLj/1Meq aHoHmMg4yjKVOXLlFTLnS2wTRbkwCkC8w3Tfwtf6G9hODEqsHh/ULCnBKc43QB3s9+TB jiKg== X-Forwarded-Encrypted: i=1; AJvYcCWFlzscCTbCLUtAQksX8ia84UYIT5+HaX0T68Joywf0O71dzLdg/f4evqzawM1ar/1tIKB7E/QxD31u7Ow=@vger.kernel.org X-Gm-Message-State: AOJu0Yysl4EAqAh5c4ANuhZJNojfWHt/uwSPNMrX9ERbvzYy6njtBbaS W0Qinhs114cUvyPZNEOTRZax97UGkcfJrgCJZKAXGVndfAFryToeBEQx X-Gm-Gg: AZuq6aJz0cY7VUB7qZ/jIbjxoVPEVDifQNZaPl9RCJFozK4OVgX36LGpKlav19mpcOT SyvmspYBLkS9C11yrv+Y6HgeDgBN0spItIRMtJZl0BZH6kFYP9srYVWfUS/F5RNf40SGNUMGNhl h5sP+tK0PsAst5ILW2yZZ5zaENyC79bUoJd/IwgtqCfk5U4DooOsL+zu1wWGQNwxzp9hoKNwH6X iHblLCz2EOSKHqkSjGmKYFbfbRA0gGl/+2kTciVbnQQORFLAnPDJHdLIRTVLP903CItVNgU7OUj TMYABJQO7SKoFMcuKfLnDJog7btZSq1G9undcaV87gphacOFHV88W3LFISlToGGFBJdkb+X2cyO 1EhxOJEcaaIcY/H+P13F1rOQKUEpNA4hu3JRD44uZ1Ekucus7IXqfhkkJ0Yn0UeK4RyHR3R7rlr kWcU/f3eg00XzdEOmmXaF5Mgh2rngHifle7SL/lg7iCBHnkgDvx6K1KpCjQAWzQUfjQFSsTPAaJ p4wnAsKSV9NRDlnAH5x9AGxwpXGSTDfKdVCefP/83hwJg== X-Received: by 2002:a05:6a21:2d4a:b0:38b:e70c:63f5 with SMTP id adf61e73a8af0-392e0163a0cmr11067617637.70.1770037263916; Mon, 02 Feb 2026 05:01:03 -0800 (PST) Received: from lorddaniel-VivoBook-ASUSLaptop-K3502ZA-S3502ZA.www.tendawifi.com ([14.139.108.62]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b6ed92dsm149584745ad.93.2026.02.02.05.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 05:01:03 -0800 (PST) From: Piyush Patle To: brauner@kernel.org Cc: djwong@kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+bd5ca596a01d01bfa083@syzkaller.appspotmail.com Subject: [PATCH] iomap: handle iterator position advancing beyond current mapping Date: Mon, 2 Feb 2026 18:30:44 +0530 Message-Id: <20260202130044.567989-1-piyushpatle228@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" syzbot reports a WARN_ON in iomap_iter_done() when iter->pos advances past the end of the current iomap during buffered writes. This happens when a write completes and updates iter->pos beyond the mapped extent before a new iomap is obtained, violating the invariant that iter->pos must lie within the active iomap range. Detect this condition early and mark the mapping stale so the iterator restarts with a fresh iomap covering the current position. Fixes: a66191c590b3b58eaff05d2277971f854772bd5b ("iomap: tighten iterator s= tate validation") Tested-by: Piyush Patle Signed-off-by: Piyush Patle Reported-by: syzbot+bd5ca596a01d01bfa083@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?id=3Dbd5ca596a01d01bfa083 --- fs/iomap/iter.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/iomap/iter.c b/fs/iomap/iter.c index c04796f6e57f..466a12b0c094 100644 --- a/fs/iomap/iter.c +++ b/fs/iomap/iter.c @@ -111,6 +111,13 @@ int iomap_iter(struct iomap_iter *iter, const struct i= omap_ops *ops) &iter->iomap, &iter->srcmap); if (ret < 0) return ret; + if (iter->iomap.length && + iter->iomap.offset + iter->iomap.length <=3D iter->pos) { + iter->iomap.flags |=3D IOMAP_F_STALE; + iomap_iter_reset_iomap(iter); + return 1; + } + iomap_iter_done(iter); return 1; } --=20 2.34.1