kernel-ark/drivers/char
Stephen Tweedie 68f66feb30 [PATCH] Fix root hole in raw device
[Patch] Fix raw device ioctl pass-through

Raw character devices are supposed to pass ioctls through to the block
devices they are bound to.  Unfortunately, they are using the wrong
function for this: ioctl_by_bdev(), instead of blkdev_ioctl().

ioctl_by_bdev() performs a set_fs(KERNEL_DS) before calling the ioctl,
redirecting the user-space buffer access to the kernel address space.
This is, needless to say, a bad thing.

This was noticed first on s390, where raw IO was non-functioning.  The
s390 driver config does not actually allow raw IO to be enabled, which
was the first part of the problem.  Secondly, the s390 kernel address
space is distinct from user, causing legal raw ioctls to fail.  I've
reproduced this on a kernel built with 4G:4G split on x86, which fails
in the same way (-EFAULT if the address does not exist kernel-side;
returns success without actually populating the user buffer if it does.)

The patch below fixes both the config and address-space problems.  It's
based closely on a patch by Jan Glauber <jang@de.ibm.com>, which has
been tested on s390 at IBM.  I've tested it on x86 4G:4G (split address
space) and x86_64 (common address space).

Kernel-address-space access has been assigned CAN-2005-1264.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-05-16 21:07:21 -07:00
..
agp [PATCH] make lots of things static 2005-05-01 08:59:29 -07:00
drm
ftape
ip2
ipmi [PATCH] ipmi iomem annotations and fixes 2005-05-04 07:33:15 -07:00
mwave
pcmcia
rio [PATCH] make lots of things static 2005-05-01 08:59:29 -07:00
tpm
watchdog
amiserial.c
applicom.c
applicom.h
cd1865.h
ChangeLog
consolemap.c
cp437.uni
cyclades.c
decserial.c
defkeymap.c_shipped
defkeymap.map
digi1.h
digi.h
digiFep1.h
digiPCI.h
ds1286.c
ds1302.c
ds1620.c
dsp56k.c
dtlk.c [PATCH] misc verify_area cleanups 2005-05-01 08:59:08 -07:00
ec3104_keyb.c
efirtc.c
epca.c
epca.h
epcaconfig.h
esp.c
generic_nvram.c
generic_serial.c
genrtc.c
hangcheck-timer.c [PATCH] hangcheck-timer: Update to 0.9.0. 2005-05-01 08:59:08 -07:00
hpet.c
hvc_console.c
hvcs.c
hvsi.c
hw_random.c
i8k.c
ip2.c
ip2main.c
ip27-rtc.c
isicom.c
istallion.c
ite_gpio.c
Kconfig Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git 2005-05-04 19:52:45 -07:00
keyboard.c [PATCH] make some things static 2005-05-05 16:36:47 -07:00
lcd.c
lcd.h
lp.c
Makefile
mbcs.c [PATCH] mbcs trivial user annotations 2005-05-04 07:33:13 -07:00
mbcs.h [PATCH] mbcs trivial user annotations 2005-05-04 07:33:13 -07:00
mem.c
misc.c
mmtimer.c
moxa.c
mxser.c
mxser.h
n_hdlc.c
n_r3964.c
n_tty.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
ppdev.c
pty.c
qtronix.c
qtronixmap.c_shipped
qtronixmap.map
random.c
raw.c [PATCH] Fix root hole in raw device 2005-05-16 21:07:21 -07:00
riscom8_reg.h
riscom8.c
riscom8.h
rocket_int.h
rocket.c
rocket.h
rtc.c
s3c2410-rtc.c [PATCH] ARM: RTC: allow driver methods to return error 2005-04-30 12:19:28 +01:00
scan_keyb.c
scan_keyb.h
scc.h
scx200_gpio.c
selection.c
ser_a2232.c
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c
snsc_event.c
snsc.c
snsc.h
sonypi.c [PATCH] sonypi trivial user annotations 2005-05-04 07:33:14 -07:00
specialix_io8.h
specialix.c [PATCH] misc verify_area cleanups 2005-05-01 08:59:08 -07:00
stallion.c [PATCH] make lots of things static 2005-05-01 08:59:29 -07:00
sx.c
sx.h
sxboards.h
sxwindow.h
synclink.c
synclinkmp.c
sysrq.c
tb0219.c
tipar.c
toshiba.c
tty_io.c [PATCH] uninline tty_paranoia_check() 2005-05-05 16:36:42 -07:00
tty_ioctl.c
vc_screen.c
viocons.c
viotape.c
vme_scc.c
vr41xx_rtc.c
vt_ioctl.c [PATCH] convert that currently tests _NSIG directly to use valid_signal() 2005-05-01 08:59:14 -07:00
vt.c