Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev Pull up following revision(s) (requested by nat i...
details: https://anonhg.NetBSD.org/src/rev/0808e2e64fae
branches: netbsd-8
changeset: 434168:0808e2e64fae
user: snj <snj%NetBSD.org@localhost>
date: Tue Aug 01 23:23:00 2017 +0000
description:
Pull up following revision(s) (requested by nat in ticket #166):
sys/dev/auconv.c: revision 1.30
sys/dev/audio.c: revision 1.372
sys/dev/ic/ac97.c: revision 1.97
sys/dev/pci/azalia_codec.c: revision 1.81
Mixer device bounds checking.
Analysis by Ilja van Sprundel.
diffstat:
sys/dev/auconv.c | 6 +++---
sys/dev/audio.c | 6 +++---
sys/dev/ic/ac97.c | 6 +++---
sys/dev/pci/azalia_codec.c | 16 ++++++++--------
4 files changed, 17 insertions(+), 17 deletions(-)
diffs (153 lines):
diff -r a35cb25d0c3a -r 0808e2e64fae sys/dev/auconv.c
--- a/sys/dev/auconv.c Tue Aug 01 23:21:30 2017 +0000
+++ b/sys/dev/auconv.c Tue Aug 01 23:23:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $ */
+/* $NetBSD: auconv.c,v 1.26.2.3 2017/08/01 23:23:00 snj Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.3 2017/08/01 23:23:00 snj Exp $");
#include <sys/types.h>
#include <sys/audioio.h>
@@ -1391,7 +1391,7 @@
auconv_query_encoding(const struct audio_encoding_set *encodings,
audio_encoding_t *aep)
{
- if (aep->index >= encodings->size)
+ if (aep->index < 0 || aep->index >= encodings->size)
return EINVAL;
strlcpy(aep->name, encodings->items[aep->index].name,
MAX_AUDIO_DEV_LEN);
diff -r a35cb25d0c3a -r 0808e2e64fae sys/dev/audio.c
--- a/sys/dev/audio.c Tue Aug 01 23:21:30 2017 +0000
+++ b/sys/dev/audio.c Tue Aug 01 23:23:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.357.2.2 2017/06/30 06:43:07 snj Exp $ */
+/* $NetBSD: audio.c,v 1.357.2.3 2017/08/01 23:23:00 snj Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.2 2017/06/30 06:43:07 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.3 2017/08/01 23:23:00 snj Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -5123,7 +5123,7 @@
if (device_is_active(sc->sc_dev))
error = audio_get_port(sc, mc);
- else if (mc->dev >= sc->sc_nmixer_states)
+ else if (mc->dev < 0 || mc->dev >= sc->sc_nmixer_states)
error = ENXIO;
else {
int dev = mc->dev;
diff -r a35cb25d0c3a -r 0808e2e64fae sys/dev/ic/ac97.c
--- a/sys/dev/ic/ac97.c Tue Aug 01 23:21:30 2017 +0000
+++ b/sys/dev/ic/ac97.c Tue Aug 01 23:23:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ac97.c,v 1.96 2015/04/04 15:09:45 christos Exp $ */
+/* $NetBSD: ac97.c,v 1.96.10.1 2017/08/01 23:23:00 snj Exp $ */
/* $OpenBSD: ac97.c,v 1.8 2000/07/19 09:01:35 csapuntz Exp $ */
/*
@@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.96 2015/04/04 15:09:45 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.96.10.1 2017/08/01 23:23:00 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1677,7 +1677,7 @@
const char *name;
as = (struct ac97_softc *)codec_if;
- if (dip->index < as->num_source_info) {
+ if (dip->index >= 0 && dip->index < as->num_source_info) {
si = &as->source_info[dip->index];
dip->type = si->type;
dip->mixer_class = si->mixer_class;
diff -r a35cb25d0c3a -r 0808e2e64fae sys/dev/pci/azalia_codec.c
--- a/sys/dev/pci/azalia_codec.c Tue Aug 01 23:21:30 2017 +0000
+++ b/sys/dev/pci/azalia_codec.c Tue Aug 01 23:23:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: azalia_codec.c,v 1.80 2017/06/01 02:45:11 chs Exp $ */
+/* $NetBSD: azalia_codec.c,v 1.80.2.1 2017/08/01 23:23:00 snj Exp $ */
/*-
* Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.80 2017/06/01 02:45:11 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.80.2.1 2017/08/01 23:23:00 snj Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -2062,7 +2062,7 @@
{
const mixer_item_t *m;
- if (mc->dev >= this->nmixers)
+ if (mc->dev < 0 || mc->dev >= this->nmixers)
return ENXIO;
m = &this->mixers[mc->dev];
if (mc->type != m->devinfo.type)
@@ -2077,7 +2077,7 @@
{
const mixer_item_t *m;
- if (mc->dev >= this->nmixers)
+ if (mc->dev < 0 || mc->dev >= this->nmixers)
return ENXIO;
m = &this->mixers[mc->dev];
mc->type = m->devinfo.type;
@@ -2312,7 +2312,7 @@
uint32_t value;
int err;
- if (mc->dev >= this->nmixers)
+ if (mc->dev < 0 || mc->dev >= this->nmixers)
return ENXIO;
m = &this->mixers[mc->dev];
if (mc->type != m->devinfo.type)
@@ -2370,7 +2370,7 @@
{
const mixer_item_t *m;
- if (mc->dev >= this->nmixers)
+ if (mc->dev < 0 || mc->dev >= this->nmixers)
return ENXIO;
m = &this->mixers[mc->dev];
mc->type = m->devinfo.type;
@@ -2871,7 +2871,7 @@
uint32_t mask, bit;
int i, err;
- if (mc->dev >= this->nmixers)
+ if (mc->dev < 0 || mc->dev >= this->nmixers)
return ENXIO;
m = &this->mixers[mc->dev];
if (mc->type != m->devinfo.type)
@@ -2905,7 +2905,7 @@
uint32_t mask, bit, result;
int i, err;
- if (mc->dev >= this->nmixers)
+ if (mc->dev < 0 || mc->dev >= this->nmixers)
return ENXIO;
m = &this->mixers[mc->dev];
mc->type = m->devinfo.type;
Home |
Main Index |
Thread Index |
Old Index