diff options
author | David S. Miller | 2008-08-30 08:06:00 +0200 |
---|---|---|
committer | David S. Miller | 2008-08-30 08:06:00 +0200 |
commit | b171e19ed08c8ba832e5325fadf1be493f56665d (patch) | |
tree | 017208f9fcc4ef2cc3fe5cc3f262d2455eda9f61 /net/sctp/auth.c | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil... (diff) | |
parent | net: Unbreak userspace usage of linux/mroute.h (diff) | |
download | kernel-qcow2-linux-b171e19ed08c8ba832e5325fadf1be493f56665d.tar.gz kernel-qcow2-linux-b171e19ed08c8ba832e5325fadf1be493f56665d.tar.xz kernel-qcow2-linux-b171e19ed08c8ba832e5325fadf1be493f56665d.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/mac80211/mlme.c
Diffstat (limited to 'net/sctp/auth.c')
-rw-r--r-- | net/sctp/auth.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 675a5c3e68a6..52db5f60daa0 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c @@ -80,6 +80,10 @@ static struct sctp_auth_bytes *sctp_auth_create_key(__u32 key_len, gfp_t gfp) { 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)) + return NULL; + /* Allocate the shared key */ key = kmalloc(sizeof(struct sctp_auth_bytes) + key_len, gfp); if (!key) @@ -782,6 +786,9 @@ int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep, for (i = 0; i < hmacs->shmac_num_idents; i++) { id = hmacs->shmac_idents[i]; + if (id > SCTP_AUTH_HMAC_ID_MAX) + return -EOPNOTSUPP; + if (SCTP_AUTH_HMAC_ID_SHA1 == id) has_sha1 = 1; |