public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: viro@ZenIV.linux.org.uk
To: minyard@acm.org
Cc: linux-kernel@vger.kernel.org
Subject: [RFC][CFLART] ipmi procfs bogosity
Date: Thu, 1 Sep 2005 07:43:13 +0100	[thread overview]
Message-ID: <20050901064313.GB26264@ZenIV.linux.org.uk> (raw)

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.

             reply	other threads:[~2005-09-01  6:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01  6:43 viro [this message]
2005-09-01 16:41 ` [RFC][CFLART] ipmi procfs bogosity 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050901064313.GB26264@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox