From 80bd797737440239c13a7e01698dd0c518eb0ad3 Mon Sep 17 00:00:00 2001 From: backslashxx <118538522+backslashxx@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:53:15 +0800 Subject: [PATCH] kernel: ksud: remove remove read_iter requirement nothing uses this on old kernels, so even backporting this to file_operations is not really needed https://elixir.bootlin.com/linux/v3.16.85/source/include/linux/fs.h#L1487 Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> --- kernel/ksud.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/ksud.c b/kernel/ksud.c index 113bf24c..ae336a13 100644 --- a/kernel/ksud.c +++ b/kernel/ksud.c @@ -396,10 +396,12 @@ int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, if (orig_read) { fops_proxy.read = read_proxy; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) orig_read_iter = file->f_op->read_iter; if (orig_read_iter) { fops_proxy.read_iter = read_iter_proxy; } +#endif // replace the file_operations file->f_op = &fops_proxy; read_count_append = rc_count;