hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/fs/ioctl.c
....@@ -790,6 +790,22 @@
790790 }
791791 EXPORT_SYMBOL(compat_ptr_ioctl);
792792
793
+/**
794
+ * compat_ptr_oob_ioctl - generic implementation of .compat_oob_ioctl file operation
795
+ *
796
+ * The equivalent of compat_ptr_ioctl, dealing with out-of-band ioctl
797
+ * calls. Management of this handler is delegated to the code
798
+ * implementing the out-of-band ioctl() syscall in the companion core.
799
+ */
800
+long compat_ptr_oob_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
801
+{
802
+ if (!file->f_op->oob_ioctl)
803
+ return -ENOIOCTLCMD;
804
+
805
+ return file->f_op->oob_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
806
+}
807
+EXPORT_SYMBOL(compat_ptr_oob_ioctl);
808
+
793809 COMPAT_SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd,
794810 compat_ulong_t, arg)
795811 {