Re: Misc 2.5 Fixes: cp-user-mpu401

From: Dipankar Sarma (dipankar@in.ibm.com)
Date: Tue Jun 10 2003 - 05:15:03 EST


Use copy_to_user to copy mpu_synth_ioctl arg.

 sound/oss/mpu401.c | 3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN sound/oss/mpu401.c~cp-user-mpu401 sound/oss/mpu401.c
--- linux-2.5.70-ds/sound/oss/mpu401.c~cp-user-mpu401 2003-06-08 02:59:48.000000000 +0530
+++ linux-2.5.70-ds-dipankar/sound/oss/mpu401.c 2003-06-08 02:59:48.000000000 +0530
@@ -792,7 +792,8 @@ static int mpu_synth_ioctl(int dev,
         {
 
                 case SNDCTL_SYNTH_INFO:
- memcpy((&((char *) arg)[0]), (char *) &mpu_synth_info[midi_dev], sizeof(struct synth_info));
+ if(copy_to_user((&((char *) arg)[0]), (char *) &mpu_synth_info[midi_dev], sizeof(struct synth_info)))
+ return -EFAULT;
                         return 0;
 
                 case SNDCTL_SYNTH_MEMAVL:

_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:23 EST