diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-10-14 05:26:30 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-30 06:06:39 (GMT) |
commit | 43ab85021e8286e1641928ab3cc542dd1e8c7f94 (patch) | |
tree | 91a933de6faa4fb6db27bea699faa78357d8a25e /net/ax25/af_ax25.c | |
parent | ac958154e9e1548933fe97e4ecbceb30e01e4a6f (diff) | |
download | linux-43ab85021e8286e1641928ab3cc542dd1e8c7f94.tar.xz |
ax25: unsigned cannot be less than 0 in ax25_ctl_ioctl()
struct ax25_ctl_struct member `arg' is unsigned and cannot be less
than 0.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25/af_ax25.c')
-rw-r--r-- | net/ax25/af_ax25.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index f05306f..f1e998b 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -369,6 +369,9 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg) if (ax25_ctl.digi_count > AX25_MAX_DIGIS) return -EINVAL; + if (ax25_ctl.arg > ULONG_MAX / HZ && ax25_ctl.cmd != AX25_KILL) + return -EINVAL; + digi.ndigi = ax25_ctl.digi_count; for (k = 0; k < digi.ndigi; k++) digi.calls[k] = ax25_ctl.digi_addr[k]; @@ -418,14 +421,10 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg) break; case AX25_T3: - if (ax25_ctl.arg < 0) - goto einval_put; ax25->t3 = ax25_ctl.arg * HZ; break; case AX25_IDLE: - if (ax25_ctl.arg < 0) - goto einval_put; ax25->idle = ax25_ctl.arg * 60 * HZ; break; |