PATCH: fix security leaks and a crash in es1370

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Jul 11 2003 - 13:12:56 EST


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.75/sound/oss/es1370.c linux-2.5.75-ac1/sound/oss/es1370.c
--- linux-2.5.75/sound/oss/es1370.c 2003-07-10 21:15:34.000000000 +0100
+++ linux-2.5.75-ac1/sound/oss/es1370.c 2003-07-11 17:10:35.000000000 +0100
@@ -889,8 +889,8 @@
         }
         if (cmd == SOUND_MIXER_INFO) {
                 mixer_info info;
- strlcpy(info.id, "ES1370", sizeof(info.id));
- strlcpy(info.name, "Ensoniq ES1370", sizeof(info.name));
+ strncpy(info.id, "ES1370", sizeof(info.id));
+ strncpy(info.name, "Ensoniq ES1370", sizeof(info.name));
                 info.modify_counter = s->mix.modcnt;
                 if (copy_to_user((void *)arg, &info, sizeof(info)))
                         return -EFAULT;
@@ -898,8 +898,8 @@
         }
         if (cmd == SOUND_OLD_MIXER_INFO) {
                 _old_mixer_info info;
- strlcpy(info.id, "ES1370", sizeof(info.id));
- strlcpy(info.name, "Ensoniq ES1370", sizeof(info.name));
+ strncpy(info.id, "ES1370", sizeof(info.id));
+ strncpy(info.name, "Ensoniq ES1370", sizeof(info.name));
                 if (copy_to_user((void *)arg, &info, sizeof(info)))
                         return -EFAULT;
                 return 0;
@@ -2484,12 +2484,8 @@
                                 break;
                         if (signal_pending(current))
                                 break;
- if (file->f_flags & O_NONBLOCK) {
- remove_wait_queue(&s->midi.owait, &wait);
- set_current_state(TASK_RUNNING);
- unlock_kernel();
- return -EBUSY;
- }
+ if (file->f_flags & O_NONBLOCK)
+ break;
                         tmo = (count * HZ) / 3100;
                         if (!schedule_timeout(tmo ? : 1) && tmo)
                                 DBG(printk(KERN_DEBUG "es1370: midi timed out??\n");)
-
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 : Tue Jul 15 2003 - 22:00:41 EST