Commit f6538692 authored by Alan Cox's avatar Alan Cox Committed by Steve French

[PATCH] fix security leak and crash in esssolo

parent f0d46320
...@@ -721,8 +721,8 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar ...@@ -721,8 +721,8 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
} }
if (cmd == SOUND_MIXER_INFO) { if (cmd == SOUND_MIXER_INFO) {
mixer_info info; mixer_info info;
strlcpy(info.id, "Solo1", sizeof(info.id)); strncpy(info.id, "Solo1", sizeof(info.id));
strlcpy(info.name, "ESS Solo1", sizeof(info.name)); strncpy(info.name, "ESS Solo1", sizeof(info.name));
info.modify_counter = s->mix.modcnt; info.modify_counter = s->mix.modcnt;
if (copy_to_user((void *)arg, &info, sizeof(info))) if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
...@@ -730,8 +730,8 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar ...@@ -730,8 +730,8 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
} }
if (cmd == SOUND_OLD_MIXER_INFO) { if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info; _old_mixer_info info;
strlcpy(info.id, "Solo1", sizeof(info.id)); strncpy(info.id, "Solo1", sizeof(info.id));
strlcpy(info.name, "ESS Solo1", sizeof(info.name)); strncpy(info.name, "ESS Solo1", sizeof(info.name));
if (copy_to_user((void *)arg, &info, sizeof(info))) if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -1972,12 +1972,8 @@ static int solo1_midi_release(struct inode *inode, struct file *file) ...@@ -1972,12 +1972,8 @@ static int solo1_midi_release(struct inode *inode, struct file *file)
break; break;
if (signal_pending(current)) if (signal_pending(current))
break; break;
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK)
remove_wait_queue(&s->midi.owait, &wait); break;
set_current_state(TASK_RUNNING);
unlock_kernel();
return -EBUSY;
}
tmo = (count * HZ) / 3100; tmo = (count * HZ) / 3100;
if (!schedule_timeout(tmo ? : 1) && tmo) if (!schedule_timeout(tmo ? : 1) && tmo)
printk(KERN_DEBUG "solo1: midi timed out??\n"); printk(KERN_DEBUG "solo1: midi timed out??\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment