From: Xi Wang <xi.wang@gmail.com> Date: 2011-11-23 01:55:36
The previous commit 30c2235c is incomplete and cannot prevent integer
overflows. For example, when key_len is 0x80000000 (INT_MAX + 1), the
left-hand side of the check, (INT_MAX - key_len), which is unsigned,
becomes 0xffffffff (UINT_MAX) and bypasses the check.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
net/sctp/auth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
struct sctp_auth_bytes *key;
/* Verify that we are not going to overflow INT_MAX */
- if ((INT_MAX - key_len) < sizeof(struct sctp_auth_bytes))
+ if (key_len > INT_MAX - sizeof(struct sctp_auth_bytes))
return NULL;
/* Allocate the shared key */
--
1.7.5.4
From: David Miller <davem@davemloft.net> Date: 2011-11-29 06:19:57
From: Xi Wang <xi.wang@gmail.com>
Date: Tue, 22 Nov 2011 20:55:30 -0500
The previous commit 30c2235c is incomplete and cannot prevent integer
overflows. For example, when key_len is 0x80000000 (INT_MAX + 1), the
left-hand side of the check, (INT_MAX - key_len), which is unsigned,
becomes 0xffffffff (UINT_MAX) and bypasses the check.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Applied, but I had to apply your patch by hand because it was
corrupted by your email client.
Please fix this problem because I am not applying any other patch
you've submitted which has this issue.
From: Xi Wang <xi.wang@gmail.com> Date: 2011-11-29 19:31:36
Sorry my bad.
BTW it seems that the patch was not applied correctly either in
the commit a5e5c374 --- it says "No differences found".
Can you please apply the new patch v2? Thanks.
- xi
On Nov 29, 2011, at 1:19 AM, David Miller wrote:
Applied, but I had to apply your patch by hand because it was
corrupted by your email client.
Please fix this problem because I am not applying any other patch
you've submitted which has this issue.