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

[PATCH] fix security leaks and a crash in es1370

parent f100aab7
...@@ -889,8 +889,8 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a ...@@ -889,8 +889,8 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
} }
if (cmd == SOUND_MIXER_INFO) { if (cmd == SOUND_MIXER_INFO) {
mixer_info info; mixer_info info;
strlcpy(info.id, "ES1370", sizeof(info.id)); strncpy(info.id, "ES1370", sizeof(info.id));
strlcpy(info.name, "Ensoniq ES1370", sizeof(info.name)); strncpy(info.name, "Ensoniq ES1370", 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;
...@@ -898,8 +898,8 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a ...@@ -898,8 +898,8 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
} }
if (cmd == SOUND_OLD_MIXER_INFO) { if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info; _old_mixer_info info;
strlcpy(info.id, "ES1370", sizeof(info.id)); strncpy(info.id, "ES1370", sizeof(info.id));
strlcpy(info.name, "Ensoniq ES1370", sizeof(info.name)); strncpy(info.name, "Ensoniq ES1370", 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;
...@@ -2484,12 +2484,8 @@ static int es1370_midi_release(struct inode *inode, struct file *file) ...@@ -2484,12 +2484,8 @@ static int es1370_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)
DBG(printk(KERN_DEBUG "es1370: midi timed out??\n");) DBG(printk(KERN_DEBUG "es1370: 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