History log of /freebsd-10-stable/sys/compat/linux/linux_ioctl.c
Revision Date Author Comments
# 358941 13-Mar-2020 hselasky

MFC r358838:
Add support for the device statistics IOCTL, needed by the coming
linux_libusb upgrade.

Sponsored by: Mellanox Technologies


# 332064 05-Apr-2018 emaste

MFC r332042: Fix kernel memory disclosure in linux_ioctl_socket

strlcpy is used to copy a string into a buffer to be copied to userland,
previously leaving uninitialized data after the terminating NUL. Zero
the buffer first to avoid a kernel memory disclosure.

admbugs: 765, 811
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by: Vlad Tsyrklevich
Sponsored by: The FreeBSD Foundation


# 332063 05-Apr-2018 emaste

MFC r332034: linux_ioctl_hdio: fix kernel memory disclosure

Stack-allocated struct linux_hd_big_geometry has undeclared padding
copied to userland.

admbugs: 765
Reported by: Vlad Tsyrklevich
Security: Kernel memory disclosure
Sponsored by: The FreeBSD Foundation


# 321025 15-Jul-2017 dchagin

MFC r298071 (by pfg@):

compat/linux: for pointers replace 0 with NULL.

plvc is a pointer, no functional change.

Found with devel/coccinelle.


# 306294 24-Sep-2016 dchagin

MFC r305896:

Implement BLKSSZGET ioctl for the Linuxulator.

PR: 212700


# 301430 05-Jun-2016 dchagin

MFC r300569:

Don't leak fp in case where fo_ioctl() returns an error.

Reported by: C Turt <ecturt@gmail.com>


# 301054 31-May-2016 glebius

Merge r301053:

Fix kernel stack disclosures in the Linux and 4.3BSD compat layers.

Security: SA-16:20
Security: SA-16:21


# 293596 09-Jan-2016 dchagin

MFC r283496:

The latest cp tool is trying to use the btrfs clone operation that is
implemented via ioctl interface. First of all return ENOTSUP for this
operation as a cp fallback to usual method in that case. Secondly, do
not print out the message about unimplemented operation.


# 293584 09-Jan-2016 dchagin

MFC r283483:

Convert signal number to native for VT_SETMODE ioctl and remove
strange and invalid ISSIGVALID macro.
The code has not been tested right way but it was originally broken.


# 293529 09-Jan-2016 dchagin

MFC r283423:

Move FEATURE macros for v4l and v4l2 to the common module.


# 293527 09-Jan-2016 dchagin

MFC r283421:

Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c


# 280258 19-Mar-2015 rwatson

Merge r263233 from HEAD to stable/10:

Update kernel inclusions of capability.h to use capsicum.h instead; some
further refinement is required as some device drivers intended to be
portable over FreeBSD versions rely on __FreeBSD_version to decide whether
to include capability.h.

Sponsored by: Google, Inc.


# 272204 27-Sep-2014 mav

MFC r272059:
Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

Approved by: re (kib)


# 268255 04-Jul-2014 mav

MFC r267051:
- Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support
scatter/gather lists.
- Return error for still unsupported SG 3.x API read/write calls.


# 268139 02-Jul-2014 mav

MFC r266981:
Overhaul CAM SG driver IOCTL interfaces.

Make it really work for native FreeBSD programs. Before this it was broken
for years due to different number of pointer dereferences in Linux and
FreeBSD IOCTL paths, permanently returning errors to FreeBSD programs.
This change breaks the driver FreeBSD IOCTL ABI, making it more strict,
but since it was not working any way -- who bother.

Add shims for 32-bit programs on 64-bit host, translating the argument
of the SG_IO IOCTL for both FreeBSD and Linux ABIs.

With this change I was able to run 32-bit Linux sg3_utils tools and simple
32 and 64-bit FreeBSD test tools on both 32 and 64-bit FreeBSD systems.


# 280258 19-Mar-2015 rwatson

Merge r263233 from HEAD to stable/10:

Update kernel inclusions of capability.h to use capsicum.h instead; some
further refinement is required as some device drivers intended to be
portable over FreeBSD versions rely on __FreeBSD_version to decide whether
to include capability.h.

Sponsored by: Google, Inc.


# 272204 27-Sep-2014 mav

MFC r272059:
Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

Approved by: re (kib)


# 268255 04-Jul-2014 mav

MFC r267051:
- Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support
scatter/gather lists.
- Return error for still unsupported SG 3.x API read/write calls.


# 268139 02-Jul-2014 mav

MFC r266981:
Overhaul CAM SG driver IOCTL interfaces.

Make it really work for native FreeBSD programs. Before this it was broken
for years due to different number of pointer dereferences in Linux and
FreeBSD IOCTL paths, permanently returning errors to FreeBSD programs.
This change breaks the driver FreeBSD IOCTL ABI, making it more strict,
but since it was not working any way -- who bother.

Add shims for 32-bit programs on 64-bit host, translating the argument
of the SG_IO IOCTL for both FreeBSD and Linux ABIs.

With this change I was able to run 32-bit Linux sg3_utils tools and simple
32 and 64-bit FreeBSD test tools on both 32 and 64-bit FreeBSD systems.