copy_to_user check for sgiserial

copy_to_user check for sgiserial

Post by da.. » Fri, 16 May 2003 05:50:11



diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/sgi/char/sgiserial.c linux-2.5/drivers/sgi/char/sgiserial.c
--- bk-linus/drivers/sgi/char/sgiserial.c       2003-05-08 13:46:22.000000000 +0100

        tmp.close_delay = info->close_delay;
        tmp.closing_wait = info->closing_wait;
        tmp.custom_divisor = info->custom_divisor;
-       return copy_to_user(retinfo,&tmp,sizeof(*retinfo));
+       return copy_to_user(retinfo,&tmp,sizeof(*retinfo)) ? -EFAULT : 0;
 }

 static int set_serial_info(struct sgi_serial * info,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Question from newbie on copy_to_user

Hi,
   I am a kernel newbie and have a question that is related to the two
operations performed by copy_to_user. From what I read copy_to_user
verifies the memory in user space and then copies the data into it.
Are these two operations atomic.

  Is it possible that after the verification is done, the scheduler
schedules a different thread which deletes the memory that was
verified.

Thanks
Krishnan

2. suck scripts

3. copy_to_user Linux-2.2.12

4. Linux: The coolest OS ever... CHECK THIS OUT!!!

5. copy_to_user() problem

6. poll() details

7. [PATCH] radio-cadet.c bad copy_to_user

8. disksuite mirror/stripe

9. copy_to_user to a kmapped address

10. copy_from_user / copy_to_user from a bottom-halve

11. Linux macro function copy_to_user(to, from, len).

12. copy_to_user - (is the best way?)

13. efficient copy_to_user and copy_from_user routines in Linux Kernel