aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2008-08-02 12:25:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-04 20:03:26 -0400
commit82e68f7ffec3800425f2391c8c86277606860442 (patch)
treedd0133edc67252f786d16541a7475dfe52b845d8
parent82248a5e92793014d156a12dbcbba633794ce9f8 (diff)
sound: ensure device number is valid in snd_seq_oss_synth_make_info
snd_seq_oss_synth_make_info() incorrectly reports information to userspace without first checking for the validity of the device number, leading to possible information leak (CVE-2008-3272). Reported-By: Tobias Klein <tk@trapkit.de> Acked-and-tested-by: Takashi Iwai <tiwai@suse.de> Cc: stable@kernel.org Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--sound/core/seq/oss/seq_oss_synth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
index 558dadbf45f1..e024e4588b82 100644
--- a/sound/core/seq/oss/seq_oss_synth.c
+++ b/sound/core/seq/oss/seq_oss_synth.c
@@ -604,6 +604,9 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
604{ 604{
605 struct seq_oss_synth *rec; 605 struct seq_oss_synth *rec;
606 606
607 if (dev < 0 || dev >= dp->max_synthdev)
608 return -ENXIO;
609
607 if (dp->synths[dev].is_midi) { 610 if (dp->synths[dev].is_midi) {
608 struct midi_info minf; 611 struct midi_info minf;
609 snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf); 612 snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf);