[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <7187C142-99F1-4A96-9BE6-650B10C9B22D@gmail.com>
Date: Tue, 22 Nov 2011 23:28:24 -0500
From: Xi Wang <xi.wang@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Joerg Reuter <jreuter@...na.de>,
Ralf Baechle <ralf@...ux-mips.org>,
David Miller <davem@...emloft.net>, linux-hams@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH 1/2] ax25: integer overflows in ax25_setsockopt()
ax25_setsockopt() misses several upper-bound checks on the
user-controlled value.
Reported-by: Fan Long <longfancn@...il.com>
Signed-off-by: Xi Wang <xi.wang@...il.com>
---
net/ax25/af_ax25.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index e7c69f4..be6a8cf 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -571,7 +571,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;
case AX25_T1:
- if (opt < 1) {
+ if (opt < 1 || opt > 30) {
res = -EINVAL;
break;
}
@@ -580,7 +580,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;
case AX25_T2:
- if (opt < 1) {
+ if (opt < 1 || opt > 20) {
res = -EINVAL;
break;
}
@@ -596,7 +596,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;
case AX25_T3:
- if (opt < 1) {
+ if (opt < 0 || opt > 3600) {
res = -EINVAL;
break;
}
@@ -604,7 +604,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;
case AX25_IDLE:
- if (opt < 0) {
+ if (opt < 0 || opt > 65535) {
res = -EINVAL;
break;
}
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists