mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
xfrm: fix freed block size calculation in xfrm_policy_fini()
Missing multiplication of block size by sizeof(struct hlist_head)
can cause xfrm_hash_free() to be called with wrong second argument
so that kfree() is called on a block allocated with vzalloc() or
__get_free_pages() or free_pages() is called with wrong order when
a namespace with enough policies is removed.
Bug introduced by commit a35f6c5d
, i.e. versions >= 2.6.29 are
affected.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Change-Id: I3e431a20bebf2bb1beeb450b9e07f30bfd263f1f
This commit is contained in:
parent
0992b79577
commit
0bc9330949
1 changed files with 1 additions and 1 deletions
|
@ -2645,7 +2645,7 @@ static void xfrm_policy_fini(struct net *net)
|
|||
WARN_ON(!hlist_empty(&net->xfrm.policy_inexact[dir]));
|
||||
|
||||
htab = &net->xfrm.policy_bydst[dir];
|
||||
sz = (htab->hmask + 1);
|
||||
sz = (htab->hmask + 1) * sizeof(struct hlist_head);
|
||||
WARN_ON(!hlist_empty(htab->table));
|
||||
xfrm_hash_free(htab->table, sz);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue