aboutsummaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-10-26 17:59:25 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-10-26 17:59:25 +0000
commited34a7fcf26fc1a36cf7b27d1a2d501bfd6b93df (patch)
treedc1efd1ecce565e0e8ea9909023209760c09ba9f /sys/compat
parent91b528c3b2c97f06cb6024159bdda4ca8544fe2e (diff)
downloadsrc-ed34a7fcf26fc1a36cf7b27d1a2d501bfd6b93df.tar.gz
src-ed34a7fcf26fc1a36cf7b27d1a2d501bfd6b93df.zip
Move 32-bit compat support for FIODGNAME to the right place.
ioctl(2) commands only have meaning in the context of a file descriptor so translating them in the syscall layer is incorrect. The new handler users an accessor to retrieve/construct a pointer from the last member of the passed structure and relies on type punning to access the other member which requires no translation. Unlike r339174 this change supports both places FIODGNAME is handled. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17475
Notes
Notes: svn path=/head/; revision=339779
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/freebsd32/freebsd32_ioctl.c20
-rw-r--r--sys/compat/freebsd32/freebsd32_ioctl.h6
2 files changed, 0 insertions, 26 deletions
diff --git a/sys/compat/freebsd32/freebsd32_ioctl.c b/sys/compat/freebsd32/freebsd32_ioctl.c
index 414178a7bffd..db6946246b90 100644
--- a/sys/compat/freebsd32/freebsd32_ioctl.c
+++ b/sys/compat/freebsd32/freebsd32_ioctl.c
@@ -59,22 +59,6 @@ __FBSDID("$FreeBSD$");
CTASSERT(sizeof(struct mem_range_op32) == 12);
static int
-freebsd32_ioctl_fiodgname(struct thread *td,
- struct freebsd32_ioctl_args *uap, struct file *fp)
-{
- struct fiodgname_arg fgn;
- struct fiodgname_arg32 fgn32;
- int error;
-
- if ((error = copyin(uap->data, &fgn32, sizeof fgn32)) != 0)
- return (error);
- CP(fgn32, fgn, len);
- PTRIN_CP(fgn32, fgn, buf);
- error = fo_ioctl(fp, FIODGNAME, (caddr_t)&fgn, td->td_ucred, td);
- return (error);
-}
-
-static int
freebsd32_ioctl_memrange(struct thread *td,
struct freebsd32_ioctl_args *uap, struct file *fp)
{
@@ -237,10 +221,6 @@ freebsd32_ioctl(struct thread *td, struct freebsd32_ioctl_args *uap)
}
switch (uap->com) {
- case FIODGNAME_32:
- error = freebsd32_ioctl_fiodgname(td, uap, fp);
- break;
-
case MEMRANGE_GET32: /* FALLTHROUGH */
case MEMRANGE_SET32:
error = freebsd32_ioctl_memrange(td, uap, fp);
diff --git a/sys/compat/freebsd32/freebsd32_ioctl.h b/sys/compat/freebsd32/freebsd32_ioctl.h
index 1d2312b41c14..0c0b18496a04 100644
--- a/sys/compat/freebsd32/freebsd32_ioctl.h
+++ b/sys/compat/freebsd32/freebsd32_ioctl.h
@@ -38,11 +38,6 @@
typedef __uint32_t caddr_t32;
-struct fiodgname_arg32 {
- int len;
- caddr_t32 buf;
-};
-
struct mem_range_op32
{
caddr_t32 mo_desc;
@@ -60,7 +55,6 @@ struct pci_bar_mmap32 {
int pbm_memattr;
};
-#define FIODGNAME_32 _IOW('f', 120, struct fiodgname_arg32)
#define MEMRANGE_GET32 _IOWR('m', 50, struct mem_range_op32)
#define MEMRANGE_SET32 _IOW('m', 51, struct mem_range_op32)
#define SG_IO_32 _IOWR(SGIOC, 0x85, struct sg_io_hdr32)