OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cadf01c
)
[XFRM]: Fix possible overflow of sock->sk_policy
author
Herbert Xu
<herbert@gondor.apana.org.au>
Tue, 26 Jul 2005 22:43:17 +0000
(15:43 -0700)
committer
David S. Miller
<davem@davemloft.net>
Tue, 26 Jul 2005 22:43:17 +0000
(15:43 -0700)
Spotted by, and original patch by, Balazs Scheidler.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_user.c
patch
|
blob
|
history
diff --git
a/net/xfrm/xfrm_user.c
b/net/xfrm/xfrm_user.c
index
ecade48
..
8da3e25
100644
(file)
--- a/
net/xfrm/xfrm_user.c
+++ b/
net/xfrm/xfrm_user.c
@@
-1350,6
+1350,9
@@
static struct xfrm_policy *xfrm_compile_policy(u16 family, int opt,
if (nr > XFRM_MAX_DEPTH)
return NULL;
+ if (p->dir > XFRM_POLICY_OUT)
+ return NULL;
+
xp = xfrm_policy_alloc(GFP_KERNEL);
if (xp == NULL) {
*dir = -ENOBUFS;