Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/sys/dev Pull up following revision(s) (requested by nat...
details: https://anonhg.NetBSD.org/src/rev/02a1fbb7d457
branches: netbsd-7-0
changeset: 801344:02a1fbb7d457
user: snj <snj%NetBSD.org@localhost>
date: Wed Aug 09 06:20:10 2017 +0000
description:
Pull up following revision(s) (requested by nat in ticket #1460):
sys/dev/auconv.c: revision 1.30 via patch
sys/dev/ic/ac97.c: revision 1.97 via patch
sys/dev/pci/azalia_codec.c: revision 1.81 via patch
Mixer device bounds checking.
Analysis by Ilja van Sprundel.
diffstat:
sys/dev/auconv.c | 6 +++---
sys/dev/ic/ac97.c | 6 +++---
sys/dev/pci/azalia_codec.c | 16 ++++++++--------
3 files changed, 14 insertions(+), 14 deletions(-)
diffs (126 lines):
diff -r 65635f583465 -r 02a1fbb7d457 sys/dev/auconv.c
--- a/sys/dev/auconv.c Wed Jul 26 16:04:26 2017 +0000
+++ b/sys/dev/auconv.c Wed Aug 09 06:20:10 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auconv.c,v 1.25 2011/11/23 23:07:31 jmcneill Exp $ */
+/* $NetBSD: auconv.c,v 1.25.28.1 2017/08/09 06:20:10 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.25 2011/11/23 23:07:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.25.28.1 2017/08/09 06:20:10 snj Exp $");
#include <sys/types.h>
#include <sys/audioio.h>
@@ -1162,7 +1162,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 65635f583465 -r 02a1fbb7d457 sys/dev/ic/ac97.c
--- a/sys/dev/ic/ac97.c Wed Jul 26 16:04:26 2017 +0000
+++ b/sys/dev/ic/ac97.c Wed Aug 09 06:20:10 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ac97.c,v 1.95.12.1 2015/07/05 20:37:01 snj Exp $ */
+/* $NetBSD: ac97.c,v 1.95.12.1.2.1 2017/08/09 06:20:10 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.95.12.1 2015/07/05 20:37:01 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.95.12.1.2.1 2017/08/09 06:20:10 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 65635f583465 -r 02a1fbb7d457 sys/dev/pci/azalia_codec.c
--- a/sys/dev/pci/azalia_codec.c Wed Jul 26 16:04:26 2017 +0000
+++ b/sys/dev/pci/azalia_codec.c Wed Aug 09 06:20:10 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: azalia_codec.c,v 1.79 2011/11/23 23:07:35 jmcneill Exp $ */
+/* $NetBSD: azalia_codec.c,v 1.79.28.1 2017/08/09 06:20:10 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.79 2011/11/23 23:07:35 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.79.28.1 2017/08/09 06:20:10 snj Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -2074,7 +2074,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)
@@ -2089,7 +2089,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;
@@ -2328,7 +2328,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)
@@ -2386,7 +2386,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;
@@ -2895,7 +2895,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)
@@ -2929,7 +2929,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