Skip to content

Commit 2f09a4d

Browse files
herbertxdavem330
authored andcommitted
xfrm: Use GFP_ATOMIC in xfrm_compile_policy
As xfrm_compile_policy runs within a read_lock, we cannot use GFP_KERNEL for memory allocations. Reported-by: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3c09e26 commit 2f09a4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xfrm/xfrm_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2504,7 +2504,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt,
25042504
if (p->dir > XFRM_POLICY_OUT)
25052505
return NULL;
25062506

2507-
xp = xfrm_policy_alloc(net, GFP_KERNEL);
2507+
xp = xfrm_policy_alloc(net, GFP_ATOMIC);
25082508
if (xp == NULL) {
25092509
*dir = -ENOBUFS;
25102510
return NULL;

0 commit comments

Comments
 (0)