mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/4] f2fs: require write permission for ioctls that change per-file state
@ 2026-11-12 21:42 Hungyu Lin
  2026-11-12 21:43 ` [PATCH v2 1/4] f2fs: require write permission for F2FS_IOC_SET_PIN_FILE Hungyu Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Hungyu Lin @ 2026-11-12 21:42 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: daehojeong, linux-f2fs-devel, linux-kernel, dennylin0707

F2FS_IOC_SET_PIN_FILE, F2FS_IOC_RELEASE_COMPRESS_BLOCKS,
F2FS_IOC_RESERVE_COMPRESS_BLOCKS and F2FS_IOC_IO_PRIO change the state
of the inode behind the file descriptor without checking who the
caller is, so any user who can open a file read-only can change that
state. Each patch requires write permission on the inode in one of
these ioctls.

inode_permission() does not depend on how the file was opened, so
f2fs_io can keep using read-only file descriptors and does not need to
change. It does refuse write access to immutable files, so these ioctls
now fail on immutable files as well.

Changes since v1:
- Check write permission with inode_permission() instead of
  inode_owner_or_capable(), as suggested by Chao Yu.
- Split into one patch per ioctl.

v1: https://lore.kernel.org/all/20261108045722.12091-1-dennylin0707@gmail.com/

Hungyu Lin (4):
  f2fs: require write permission for F2FS_IOC_SET_PIN_FILE
  f2fs: require write permission for F2FS_IOC_RELEASE_COMPRESS_BLOCKS
  f2fs: require write permission for F2FS_IOC_RESERVE_COMPRESS_BLOCKS
  f2fs: require write permission for F2FS_IOC_IO_PRIO

 fs/f2fs/file.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.43.0


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

end of thread, other threads:[~2026-11-12 21:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 21:42 [PATCH v2 0/4] f2fs: require write permission for ioctls that change per-file state Hungyu Lin
2026-11-12 21:43 ` [PATCH v2 1/4] f2fs: require write permission for F2FS_IOC_SET_PIN_FILE Hungyu Lin
2026-11-12 21:43 ` [PATCH v2 2/4] f2fs: require write permission for F2FS_IOC_RELEASE_COMPRESS_BLOCKS Hungyu Lin
2026-11-12 21:43 ` [PATCH v2 3/4] f2fs: require write permission for F2FS_IOC_RESERVE_COMPRESS_BLOCKS Hungyu Lin
2026-11-12 21:43 ` [PATCH v2 4/4] f2fs: require write permission for F2FS_IOC_IO_PRIO Hungyu Lin

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®