Re: [RFC][CFLART] ipmi procfs bogosity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 01, 2005 at 11:41:42AM -0500, Corey Minyard wrote:
> Indeed, this function is badly written.  In rewriting, I couldn't find a
> nice function for reading integers from userspace, and the proc_dointvec
> stuff didn't seem terribly suitable.  So I wrote my own general
> function, which I can move someplace else if someone likes.  Patch is
> attached.  It should not affect correct usage of this file.

Eeeek...  Much, _much_ simpler approach would be to have

	char buf[10];
	if (count > 9)
		return -EINVAL;
	if (copy_from_user(buf, buffer, count))
		return -EFAULT;
	buf[count] = '\0';
	/* use sscanf() or anything normal */

Would that change behaviour in any cases you care about?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux