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

[PATCH] fix security leaks in cmpci

parent 3d4dcdfc
...@@ -1272,8 +1272,8 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg) ...@@ -1272,8 +1272,8 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
VALIDATE_STATE(s); VALIDATE_STATE(s);
if (cmd == SOUND_MIXER_INFO) { if (cmd == SOUND_MIXER_INFO) {
mixer_info info; mixer_info info;
strlcpy(info.id, "cmpci", sizeof(info.id)); strncpy(info.id, "cmpci", sizeof(info.id));
strlcpy(info.name, "C-Media PCI", sizeof(info.name)); strncpy(info.name, "C-Media PCI", 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;
...@@ -1281,8 +1281,8 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg) ...@@ -1281,8 +1281,8 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
} }
if (cmd == SOUND_OLD_MIXER_INFO) { if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info; _old_mixer_info info;
strlcpy(info.id, "cmpci", sizeof(info.id)); strncpy(info.id, "cmpci", sizeof(info.id));
strlcpy(info.name, "C-Media cmpci", sizeof(info.name)); strncpy(info.name, "C-Media cmpci", 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;
......
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