Messages in this thread |  | | | Date | Tue, 04 Jul 2000 15:12:45 -0400 | | From | Jeff Garzik <> | | Subject | Re: [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/
|  |