mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] fs: fix and deduplicate whence handling in default_llseek()
@ 2026-11-01  6:00 Siddharth Chintamaneni
  2026-11-01  6:00 ` [PATCH v1 1/2] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE " Siddharth Chintamaneni
  2026-11-01  6:00 ` [PATCH v1 2/2] fs: use must_set_pos() " Siddharth Chintamaneni
  0 siblings, 2 replies; 3+ messages in thread
From: Siddharth Chintamaneni @ 2026-11-01  6:00 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner
  Cc: Jan Kara, linux-fsdevel, linux-kernel, apais, rlmenge, hargar,
	Siddharth Chintamaneni

This series fixes negative offset validation for SEEK_DATA and SEEK_HOLE
in default_llseek() and deduplicates its whence handling with
must_set_pos().

Patch 1 updates default_llseek() to read the inode size once via
i_size_read(inode) and compare (unsigned long long)offset >= eof for
SEEK_DATA and SEEK_HOLE so negative offsets fail with -ENXIO instead of
bypassing the range check.

Patch 2 replaces the open-coded switch (whence) block in
default_llseek() with a call to must_set_pos().

Siddharth Chintamaneni (2):
  fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in
    default_llseek()
  fs: use must_set_pos() in default_llseek()

 fs/read_write.c | 48 ++++++++++++++----------------------------------
 1 file changed, 14 insertions(+), 34 deletions(-)


base-commit: 36aad21d50d1af3f6954bb0c988257a908202477
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-01  6:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-01  6:00 [PATCH v1 0/2] fs: fix and deduplicate whence handling in default_llseek() Siddharth Chintamaneni
2026-11-01  6:00 ` [PATCH v1 1/2] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE " Siddharth Chintamaneni
2026-11-01  6:00 ` [PATCH v1 2/2] fs: use must_set_pos() " Siddharth Chintamaneni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®