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
> We do check for an error in that function, so returning any negative
> error value for a show() sysfs callback will be handled properly.

If a show() function returns an error, you handle it - good. As it
should be.

But if a show() function overwrites the page buffer provided to it,
before returning, then there is nothing you can do beyond sending
condolences to the next of kin.

This PATCH and email thread came about because the buffer size is not
passed into the show() function, nor, so far as I can tell, is it
documented anywhere other than implicitly in the fill_read_buffer()
code:

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

So we were getting confused as to what size buffer we had, when
coding defensively to avoid buffer overrun.

--
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    [W:0.095 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site