diff options
author | Xi Wang <xi.wang@gmail.com> | 2011-12-27 13:43:19 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-28 23:08:08 +0400 |
commit | ba1cffe0257bcd4d0070bc0e64f8ead97fefd148 (patch) | |
tree | 5584b7816f7eb46953611ec35628c6924ea5a2af /include | |
parent | fa84309533025eb3f03dc1d2d2be1c3ca206882a (diff) | |
download | linux-ba1cffe0257bcd4d0070bc0e64f8ead97fefd148.tar.xz |
ax25: avoid overflows in ax25_setsockopt()
Commit be639ac6 ("NET: AX.25: Check ioctl arguments to avoid overflows
further down the road") rejects very large arguments, but doesn't
completely fix overflows on 64-bit systems. Consider the AX25_T2 case.
int opt;
...
if (opt < 1 || opt > ULONG_MAX / HZ) {
res = -EINVAL;
break;
}
ax25->t2 = opt * HZ;
The 32-bit multiplication opt * HZ would overflow before being assigned
to 64-bit ax25->t2. This patch changes "opt" to unsigned long.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions