aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 34cf03cd791f..410ed188faa1 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -579,69 +579,6 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, void __user *argp)
579#define HIDPGETCONNLIST _IOR('H', 210, int) 579#define HIDPGETCONNLIST _IOR('H', 210, int)
580#define HIDPGETCONNINFO _IOR('H', 211, int) 580#define HIDPGETCONNINFO _IOR('H', 211, int)
581 581
582#ifdef CONFIG_BLOCK
583struct raw32_config_request
584{
585 compat_int_t raw_minor;
586 __u64 block_major;
587 __u64 block_minor;
588} __attribute__((packed));
589
590static int get_raw32_request(struct raw_config_request *req, struct raw32_config_request __user *user_req)
591{
592 int ret;
593
594 if (!access_ok(VERIFY_READ, user_req, sizeof(struct raw32_config_request)))
595 return -EFAULT;
596
597 ret = __get_user(req->raw_minor, &user_req->raw_minor);
598 ret |= __get_user(req->block_major, &user_req->block_major);
599 ret |= __get_user(req->block_minor, &user_req->block_minor);
600
601 return ret ? -EFAULT : 0;
602}
603
604static int set_raw32_request(struct raw_config_request *req, struct raw32_config_request __user *user_req)
605{
606 int ret;
607
608 if (!access_ok(VERIFY_WRITE, user_req, sizeof(struct raw32_config_request)))
609 return -EFAULT;
610
611 ret = __put_user(req->raw_minor, &user_req->raw_minor);
612 ret |= __put_user(req->block_major, &user_req->block_major);
613 ret |= __put_user(req->block_minor, &user_req->block_minor);
614
615 return ret ? -EFAULT : 0;
616}
617
618static int raw_ioctl(unsigned fd, unsigned cmd,
619 struct raw32_config_request __user *user_req)
620{
621 int ret;
622
623 switch (cmd) {
624 case RAW_SETBIND:
625 default: { /* RAW_GETBIND */
626 struct raw_config_request req;
627 mm_segment_t oldfs = get_fs();
628
629 if ((ret = get_raw32_request(&req, user_req)))
630 return ret;
631
632 set_fs(KERNEL_DS);
633 ret = sys_ioctl(fd,cmd,(unsigned long)&req);
634 set_fs(oldfs);
635
636 if ((!ret) && (cmd == RAW_GETBIND)) {
637 ret = set_raw32_request(&req, user_req);
638 }
639 break;
640 }
641 }
642 return ret;
643}
644#endif /* CONFIG_BLOCK */
645 582
646struct serial_struct32 { 583struct serial_struct32 {
647 compat_int_t type; 584 compat_int_t type;
@@ -1501,10 +1438,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd,
1501 case MTIOCGET32: 1438 case MTIOCGET32:
1502 case MTIOCPOS32: 1439 case MTIOCPOS32:
1503 return mt_ioctl_trans(fd, cmd, argp); 1440 return mt_ioctl_trans(fd, cmd, argp);
1504 /* Raw devices */
1505 case RAW_SETBIND:
1506 case RAW_GETBIND:
1507 return raw_ioctl(fd, cmd, argp);
1508#endif 1441#endif
1509 /* Serial */ 1442 /* Serial */
1510 case TIOCGSERIAL: 1443 case TIOCGSERIAL: