Re: [PATCH #2] console lock grabbed too early in printk...

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Tue Jul 04 2000 - 14:12:45 EST


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/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:15 EST