lkml.org 
[lkml]   [2004]   [Jun]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 2 Jun 2004 21:25:47 -0700
FromPaul Jackson <>
SubjectRe: [PATCH] fix sys cpumap for > 352 NR_CPUS
Rusty wrote:
> 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?

That doesn't make sense.

My node_read_cpumap() routine is being passed a finite length buffer
into which it is supposed to put some characters.  Unless by contract
or passed value it knows the length of that buffer, it cannot safely
know how far it can write.

Apparently, from Andrews comments and from the line:

  buffer->page = (char *) get_zeroed_page(GFP_KERNEL);

in file.c:fill_read_buffer(), the length is PAGE_SIZE, by contract.

Greg - perhaps a comment in include/linux/sysdev.h, near the declarations
for the show() and store() routines, specifying the buffer sizing,
would be appropriate?

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373
-
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-2008