lkml.org 
[lkml]   [1996]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: A minor bug in sr_ioctl.c for 2.1.13?
Date

On Mon, 25 Nov 1996 19:56:36 GMT, you wrote:

>
> Whenever I mount a cdrom with 2.1.13 I get this message:
>
> DEBUG: sr_audio: result for ioctl 5305: fffffff2
>
> which is saying that the code for CDROMREADTOCHDR returned
> -EFAULT.
>
> This is coming from the sr_audio_ioctl function in sr_ioctl.c
> where it says:
>
> if (copy_to_user(...))
> return -EFAULT;
>
> [my bone-headed erroneous garbage deleted]

Sorry about wasting electrons on my stupidity.

This time I realized I should see what's actually going on. At about line
341 in sr_ioctl.c where the code is

if (copy_to_user ((void *) arg, &tochdr, sizeof (struct cdrom_tochdr)))
result = -EFAULT;

I changed it to read

printk("get_fs = %lx; arg = %p; &tochdr = %p;\n",
(unsigned long)get_fs(), arg, &tochdr);
if (copy_to_user ((void *) arg, &tochdr, sizeof (struct cdrom_tochdr)))
result = -EFAULT;

and got

get_fs = 2b; arg = c0754f1a; &tochdr = c0754ede;

With these values, the __kernel_ok test fails as does __user_ok so
copy_to_user always fails. Something seems wrong here.

As always, I am confused.

Thanks.




\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.048 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site