Re: Misc 2.5 Fixes: cp-user-mpu401

Dipankar Sarma
2003-06-10T10:01:04Z

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:

_