From nobody Sat Feb 7 04:47:22 2026 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 21EA336CE04 for ; Mon, 2 Feb 2026 15:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770046843; cv=none; b=C7HJ9iEW8rG8wwsO0OEOuXfgFuOSsuHZTocDdQ0XQR0+nokZY9yjpmgoACogC/fYudvCghxvtS2sqFtXTHbw2EaY2Ap0qMiXk3YIMRxBX1/zmznZDXzIwxsE/XRwtVxQ+MN6PMKqZOLmqgKwuE594peGsBv8x88AgrCB2IMJyhk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770046843; c=relaxed/simple; bh=RP6S1ivaYAK6Fs5+VhDcT3M8k5FicM0n51mqRABDv7k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nVmHs0O3RS9KLxy+7UDKNk1BQbqkOeia5amC6cZABMbEXsrb8530xgGW+0BdjNNPn/voY0CUzXd2uB4ZA/6u1y7UwVFxtDVmwgoz0e31fDCHzqPHOYVzRY+WS1aCA5yLuCUdSpU/w96cQ8F2X0dGr6hNJhJHtAlnEX9CmK3TteE= 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=kAQzHm5p; arc=none smtp.client-ip=209.85.210.174 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="kAQzHm5p" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-82311f4070cso2948820b3a.0 for ; Mon, 02 Feb 2026 07:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770046841; x=1770651641; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n05z2JgZ055VI92yGkVjhSrgVttdCiXX4GMR4DMFah4=; b=kAQzHm5pTWygrkNcCvwyQzPkeb3zpZ1/rPtCqNQ/srl24eOOYRxh3hFsf2L1I23R5z Ib0UCnjBi1f2Ddp64smUrCpzhSHN73Q3nHbpcJo8RP9m70biXvQuxFIltD3kLsZdAJWa kvISTxR9gTS6PaGBpztbHS5WBOj4BeLX3h8kW7c/q/EJ/PgAwLwxmv+lzESVFqOHU1xe gQqWcUV1QaunUWmCIFcR7hSbSf2TAA6YVP4ATqrk7eqVyU3TeToApfDtI2bzlO2OarxS YcXn5y+XpnwPOHa/zQHe5ZxcCFqNWbWsldbU0l1xfiptEo6Vhkwl8cc1svydgnH6tR41 4U5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770046841; x=1770651641; h=content-transfer-encoding:mime-version:references:in-reply-to :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=GUsb3OLM7EoxSz3U6pssNE8AOalF30FAl7uo/vjOJ8z9MtCib6NMBU//9qAWl+4ouX PDoec8J4XcW7SM83RCb6cIi+BBB3e3BrlhnOa+/J+qKsS/IZUrtdL6qjK4tuQsaT4X/3 465GNGueCKysU/wtsPxmo1zDEZk7w7eTff2epplQkT4UXnyOGWiy+KorckKccZS+leuQ u0RVFRQ/heLfJjPgxKHXgwLnIlks5fADElXlHrUCfM5+jmO5Y26fuz3dOUbQPi1Q/MJw KaEggZqzOSp4HVroLuAU401HSTFwOtLcaDXsvrfKOIsiSg8WjSnzdI8Zx0JQRbJwrArT cAXA== X-Forwarded-Encrypted: i=1; AJvYcCXTvFSjjw4A+p6hRJQu5s7IW7/Ufc4+nIi4RjHSCZ87zlw1+YrvSFKoQ4nsL7/h5/PKwmDIYLTw4c4sEA4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8WqpZsSEyBR3OPsGX73WI52+FzcI5/Sgqthphv/sqYto/8lNK XwNCqIaP5p7aAeuHHv5Ljl/jLBCRpwoeR/i9GxJ4FNGQnYk15bFmTIE1 X-Gm-Gg: AZuq6aJn7ui0pAu5OSpqNMbWwk1tT2pyvKOfwtpdk+9m5Ysnc3KV5VZGoegxREDdu9P +7E4fcrY4gageyvW7wngOwdPrPHvjhlFpg457ACW1sF7k5HdtdV/7RyQYjN35QxfbwQ5quuY0hW /HBJVwxRkkQd5uaAzo3naZpbyKrz2/Jf6Wv9SFFEH/TNNFL1p3g0NDFXq2aNmbpGEbE+Bbv3+3F /MZUQe7O24tuRCcXcShbWLnqxaFO4BBjYGCcFpvUn64H30pmanFj1lfcqNG1FZu1ATYreLeWVol d1bwCsIvLCGR9L3IE1Q77XgKLO3h1kb8wKIM42Bjxfadabi99Z9O8E3TSLqEPMBnju3b52Clbga sX9501KW/jZ7+SwP0xXcELDKd8VEAlVrEJsQM4kGjQSqgKPn+iEvu/AgESOjg/9toFiv7aNFADu GVltE51IAYz49sR2SpjSRBRcniZyIPnVyB/afYCqzfL54vXkR4ZtrkI86zthg+Ag1ZzFbZi3XB2 dP0XZxpM59PDwSZNUL4WEPH4KIHGsSj4/fMdLcny0AFew== X-Received: by 2002:a05:6a00:218d:b0:81f:804f:af26 with SMTP id d2e1a72fcca58-823920f2aaemr18442535b3a.19.1770046841306; Mon, 02 Feb 2026 07:40:41 -0800 (PST) Received: from lorddaniel-VivoBook-ASUSLaptop-K3502ZA-S3502ZA.www.tendawifi.com ([14.139.108.62]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379b2305fsm19783019b3a.10.2026.02.02.07.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 07:40:40 -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 21:10:30 +0530 Message-Id: <20260202154030.644730-1-piyushpatle228@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260202130044.567989-1-piyushpatle228@gmail.com> References: <20260202130044.567989-1-piyushpatle228@gmail.com> 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