linux/drivers/char
H. Peter Anvin a01c780042 nvram: Fix write beyond end condition; prove to gcc copy is safe
In nvram_write, first of all, correctly handle the case where the file
pointer is already beyond the end; we should return EOF in that case.

Second, make the logic a bit more explicit so that gcc can statically
prove that the copy_from_user() is safe.  Once the condition of the
beyond-end filepointer is eliminated, the copy is safe but gcc can't
prove it, causing build failures for i386 allyesconfig.

Third, eliminate the entirely superfluous variable "len", and just use
the passed-in variable "count" instead.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <tip-*@git.kernel.org>
2009-12-11 15:48:23 -08:00
..
agp Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2009-12-10 21:56:47 -08:00
hw_random Merge branch 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-09 08:07:38 -08:00
ip2
ipmi sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
mwave mwave: fix read buffer overflow 2009-09-24 07:21:03 -07:00
pcmcia pcmcia: rework the irq_req_t typedef 2009-11-28 18:03:14 +01:00
rio tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
tpm tpm: autoload tpm_tis based on system PnP IDs 2009-11-03 12:05:50 +11:00
xilinx_hwicap const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
.gitignore
amiserial.c
apm-emulation.c const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
applicom.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
applicom.h
bfin_jtag_comm.c
bfin-otp.c const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
briq_panel.c
bsr.c
cd1865.h
ChangeLog
consolemap.c
cp437.uni
cs5535_gpio.c drivers: Remove BKL from cs5535_gpio 2009-10-14 17:36:48 +02:00
cyclades.c cyclades: fix read buffer overflow 2009-10-01 16:11:16 -07:00
defkeymap.c_shipped
defkeymap.map
digi1.h
digiFep1.h
digiPCI.h
ds1302.c
ds1620.c
dsp56k.c
dtlk.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
efirtc.c rtc: Remove BKL from efirtc 2009-10-14 17:36:51 +02:00
epca.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
epca.h
epcaconfig.h
esp.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
generic_nvram.c nvram: Drop the bkl from nvram_llseek() 2009-10-14 17:36:49 +02:00
generic_serial.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
genrtc.c headers: Fix build after <linux/sched.h> removal 2009-10-13 10:20:16 -07:00
hangcheck-timer.c
hpet.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
hvc_beat.c
hvc_console.c hvc_console: Provide (un)locked version for hvc_resize() 2009-09-24 15:12:47 +10:00
hvc_console.h hvc_console: Provide (un)locked version for hvc_resize() 2009-09-24 15:12:47 +10:00
hvc_irq.c
hvc_iseries.c
hvc_iucv.c hvc_console: Provide (un)locked version for hvc_resize() 2009-09-24 15:12:47 +10:00
hvc_rtas.c
hvc_udbg.c
hvc_vio.c
hvc_xen.c xen/hvc: make sure console output is always emitted, with explicit polling 2009-11-03 11:05:51 -08:00
hvcs.c
hvsi.c
i8k.c
isicom.c isicom: split the open method for the isicom device 2009-09-19 13:13:27 -07:00
istallion.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
Kconfig tty: Mark generic_serial users as BROKEN 2009-10-30 14:43:12 -07:00
keyboard.c Merge commit 'v2.6.32' into next 2009-12-02 23:38:13 -08:00
lp.c
Makefile drivers/char/uv_mmtimer.c: add memory mapped RTC driver for UV 2009-09-24 07:21:03 -07:00
mbcs.c [IA64] mbcs: fix printk format warnings 2009-09-15 08:42:00 -07:00
mbcs.h
mem.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
misc.c drivers: Remove BKL from misc_open 2009-10-14 17:33:32 +02:00
mmtimer.c
moxa.c
moxa.h
mspec.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
mxser.c tty: Char: mxser, use THRE for ASPP_OQUEUE ioctl 2009-09-19 13:13:38 -07:00
mxser.h
n_hdlc.c
n_r3964.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
n_tty.c n_tty: move echoctl check and clean up logic 2009-09-19 13:13:34 -07:00
nozomi.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
nsc_gpio.c
nvram.c nvram: Fix write beyond end condition; prove to gcc copy is safe 2009-12-11 15:48:23 -08:00
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c drivers: Remove BKL from pc8736x_gpio 2009-10-14 17:36:52 +02:00
ppdev.c
ps3flash.c
pty.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
random.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
raw.c Driver-Core: extend devnode callbacks to provide permissions 2009-09-19 12:50:38 -07:00
riscom8_reg.h
riscom8.c tty: riscom8, fix tty refcnt 2009-09-19 13:13:37 -07:00
riscom8.h
rocket_int.h
rocket.c
rocket.h
rtc.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
scc.h
scx200_gpio.c drivers: Remove BKL from scx200_gpio 2009-10-14 17:36:53 +02:00
selection.c
ser_a2232.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c serial167: fix read buffer overflow 2009-10-01 16:11:16 -07:00
snsc_event.c
snsc.c
snsc.h
sonypi.c headers: Fix build after <linux/sched.h> removal 2009-10-13 10:20:16 -07:00
specialix_io8.h
specialix.c
stallion.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
sx.c
sx.h
sxboards.h
sxwindow.h
synclink_gt.c
synclink.c
synclinkmp.c
sysrq.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
tb0219.c mips: Remove BKL from tb0219 2009-10-14 17:36:53 +02:00
tlclk.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
toshiba.c
tty_audit.c
tty_buffer.c tty: use the new 'flush_delayed_work()' helper to do ldisc flush 2009-10-14 09:20:41 -07:00
tty_io.c tty: Fix regressions caused by commit b50989dc 2009-09-27 13:35:16 -07:00
tty_ioctl.c tree-wide: fix a very frequent spelling mistake 2009-11-09 09:40:54 +01:00
tty_ldisc.c tty: Avoid dropping ldisc_mutex over hangup tty re-initialization 2009-10-03 21:44:21 -07:00
tty_port.c tty_port: handle the nonblocking open of a dead port corner case 2009-11-30 16:38:25 -08:00
uv_mmtimer.c drivers/char/uv_mmtimer.c: add memory mapped RTC driver for UV 2009-09-24 07:21:03 -07:00
vc_screen.c
viotape.c
virtio_console.c virtio: let header files include virtio_ids.h 2009-10-22 16:39:28 +10:30
vme_scc.c
vt_ioctl.c vt: Fix use of "new" in a struct field 2009-11-19 13:43:06 -08:00
vt.c vc: Add support for hiding the cursor when creating VTs 2009-11-13 15:54:27 -08:00