lkml.org 
[lkml]   [2000]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH #2] console lock grabbed too early in printk...
Chris Lattner wrote:
>
> > > 5. As such, a kernel developer may not invest as much thought into printk
> > > placement as, say, a new buffer cache design.
> >
> > The rules:
> >
> > 1. Don't pass user addresses to printk
>
> What makes an address a user address? When going through someone elses
> code, sometimes you can tell when it gets copied in, sometimes not... and
> should i have to do something like this everytime I want to printk?
>
> { char Buffer[1000];
> copyinto buffer
> printk(buffer);
> }
>
> ??? Whoops, hope I don't overflow the stack!?!? :(

Then use kmalloc or get_free_page(s).


> I think this is completely ridiculous.

Tough. Yes you must do something like the above every time you want to
print out something passed to you from userspace. Userspace addressing
is fundamentally different from kernel space, and always will be. Don't
expect printk to deal with userspace addresses.

Jeff



--
Jeff Garzik |
Building 1024 | Yossarian lives.
MandrakeSoft, Inc. |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site