lkml.org 
[lkml]   [2004]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix sys cpumap for > 352 NR_CPUS
On Thu, Jun 03, 2004 at 10:22:36AM +1000, Rusty Russell wrote:
> On Thu, 2004-06-03 at 09:11, Paul Jackson wrote:
> > + /*
> > + * Hack alert:
> > + * 1) This could overwrite a buffer w/o warning. Someone should
> > + * pass us a buffer size (count) or use seq_file or something
> > + * to avoid buffer overrun risks.
>
> Then just use -1UL as the arg to scnprintf, if you don't have a real
> number. That way the overflow will at least have a chance of detection
> in the sysfs code, which I think it should check in
> file.c:fill_read_buffer(). Greg?

We do check for an error in that function, so returning any negative
error value for a show() sysfs callback will be handled properly.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [from the cache]
©2003-2011 Jasper Spaans