OT: kernel oops

Jason White jason at jasonjgw.net
Thu Jul 18 19:43:02 EDT 2013


Chris Brannon <chris at the-brannons.com> wrote:
> Don Raikes <don.raikes at oracle.com> writes:
> 
> > The section of code that is having problems looks like this:
> *SNIP*
> > if (copy_from_user(&tbuf, buf, count))
> 
> This line is your problem.  You are passing a
> pointer-to-pointer-to-character (char **) as the first argument to
> copy_from_user, but you should be passing char * instead.  So ditch the
> ampersand, and all will be right with the world!
> I could give you a thorough explanation of why this is failing, if you
> like, but to make a long story short, this line of code is smashing the
> stack!

In other words, you're passing it the address of the pointer to the buffer,
rather than the pointer itself, which holds the address of the buffer.



More information about the Speakup mailing list