public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][CFLART] ipmi procfs bogosity
@ 2005-09-01  6:43 viro
  2005-09-01 16:41 ` Corey Minyard
  0 siblings, 1 reply; 9+ messages in thread
From: viro @ 2005-09-01  6:43 UTC (permalink / raw)
  To: minyard; +Cc: linux-kernel

drivers/char/ipmi/ipmi_poweroff.c::proc_write_chassctrl()
	a) does sscanf on userland pointer
	b) does sscanf on array that is not guaranteed to have NUL in it
	c) interprets input in incredibly cretinous way:
if strings doesn't start with a decimal number => as if it was "0".
if it starts with decimal number equal to 0 (e.g. is "-0000splat") - as if
it was "0".
if it starts with decimal number equal to 2 (e.g. is "00002FOAD") - as if
it was "2".
otherwise - -EINVAL.
	In any case that doesn't end up with -EINVAL, pretend that entire
buffer had been written.

(a) and (b) are immediate bugs; (c) is a valid reason for immediate severe
LARTing of the pervert who had done _that_ in a user-visible API.

Note that API _is_ user-visible, so we can't blindly change it - not without
checking WTF do its users actually write to /proc/ipmi/poweroff_control.

Could somebody comment on the actual uses of that FPOS?  My preference would
be to remove the damn thing completely - it's too ugly to live.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-09-05 19:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-01  6:43 [RFC][CFLART] ipmi procfs bogosity viro
2005-09-01 16:41 ` Corey Minyard
2005-09-01 19:32   ` viro
2005-09-01 20:00     ` Corey Minyard
2005-09-01 20:30       ` Alexey Dobriyan
2005-09-05 10:51         ` Ingo Oeser
2005-09-05 19:38           ` Alexey Dobriyan
2005-09-01 19:41   ` Andrew Morton
2005-09-01 23:03     ` Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox