Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278257
b: refs/heads/master
c: be639ac
h: refs/heads/master
i:
  278255: fb0f4cc
v: v3
  • Loading branch information
Ralf Baechle authored and David S. Miller committed Nov 29, 2011
1 parent 10d8dc7 commit 99aa64c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b1588593097b7d71f44c4b7b435bf28924316e0
refs/heads/master: be639ac6901a082894771f55c8047d5772de5c27
17 changes: 11 additions & 6 deletions trunk/net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,14 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
break;

case AX25_T1:
if (ax25_ctl.arg < 1)
if (ax25_ctl.arg < 1 || ax25_ctl.arg > ULONG_MAX / HZ)
goto einval_put;
ax25->rtt = (ax25_ctl.arg * HZ) / 2;
ax25->t1 = ax25_ctl.arg * HZ;
break;

case AX25_T2:
if (ax25_ctl.arg < 1)
if (ax25_ctl.arg < 1 || ax25_ctl.arg > ULONG_MAX / HZ)
goto einval_put;
ax25->t2 = ax25_ctl.arg * HZ;
break;
Expand All @@ -422,10 +422,15 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
break;

case AX25_T3:
if (ax25_ctl.arg > ULONG_MAX / HZ)
goto einval_put;
ax25->t3 = ax25_ctl.arg * HZ;
break;

case AX25_IDLE:
if (ax25_ctl.arg > ULONG_MAX / (60 * HZ))
goto einval_put;

ax25->idle = ax25_ctl.arg * 60 * HZ;
break;

Expand Down Expand Up @@ -571,7 +576,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;

case AX25_T1:
if (opt < 1) {
if (opt < 1 || opt > ULONG_MAX / HZ) {
res = -EINVAL;
break;
}
Expand All @@ -580,7 +585,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;

case AX25_T2:
if (opt < 1) {
if (opt < 1 || opt > ULONG_MAX / HZ) {
res = -EINVAL;
break;
}
Expand All @@ -596,15 +601,15 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;

case AX25_T3:
if (opt < 1) {
if (opt < 1 || opt > ULONG_MAX / HZ) {
res = -EINVAL;
break;
}
ax25->t3 = opt * HZ;
break;

case AX25_IDLE:
if (opt < 0) {
if (opt < 0 || opt > ULONG_MAX / (60 * HZ)) {
res = -EINVAL;
break;
}
Expand Down

0 comments on commit 99aa64c

Please sign in to comment.