Re: [PATCH -next] ax25: avoid overflows in ax25_setsockopt()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Xi Wang <xi.wang@xxxxxxxxx>
Date: Tue, 27 Dec 2011 14:43:19 -0500

> 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@xxxxxxxxx>
> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Newbie]     [Kernel Newbies]     [Memory]     [Git]     [Security]     [Netfilter]     [Linux Admin]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [ARM Linux Kernel]     [Linux Networking]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linux Resources]

Add to Google Powered by Linux