Revert "xfrm: fix a data-race in xfrm_gen_index()"
This reverts commit bcacdf4deb
which is
commit 3e4bc23926b83c3c67e5f61ae8571602754131a6 upstream.
It breaks the android ABI and if this is needed in the future, can be
brought back in an abi-safe way.
Bug: 161946584
Change-Id: I6af8ce540570c756ea9f16526c36f8815971e216
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
0ca22be029
commit
231c81bbc8
@ -49,7 +49,6 @@ struct netns_xfrm {
|
|||||||
struct list_head policy_all;
|
struct list_head policy_all;
|
||||||
struct hlist_head *policy_byidx;
|
struct hlist_head *policy_byidx;
|
||||||
unsigned int policy_idx_hmask;
|
unsigned int policy_idx_hmask;
|
||||||
unsigned int idx_generator;
|
|
||||||
struct hlist_head policy_inexact[XFRM_POLICY_MAX];
|
struct hlist_head policy_inexact[XFRM_POLICY_MAX];
|
||||||
struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX];
|
struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX];
|
||||||
unsigned int policy_count[XFRM_POLICY_MAX * 2];
|
unsigned int policy_count[XFRM_POLICY_MAX * 2];
|
||||||
|
@ -1373,6 +1373,8 @@ EXPORT_SYMBOL(xfrm_policy_hash_rebuild);
|
|||||||
* of an absolute inpredictability of ordering of rules. This will not pass. */
|
* of an absolute inpredictability of ordering of rules. This will not pass. */
|
||||||
static u32 xfrm_gen_index(struct net *net, int dir, u32 index)
|
static u32 xfrm_gen_index(struct net *net, int dir, u32 index)
|
||||||
{
|
{
|
||||||
|
static u32 idx_generator;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
struct hlist_head *list;
|
struct hlist_head *list;
|
||||||
struct xfrm_policy *p;
|
struct xfrm_policy *p;
|
||||||
@ -1380,8 +1382,8 @@ static u32 xfrm_gen_index(struct net *net, int dir, u32 index)
|
|||||||
int found;
|
int found;
|
||||||
|
|
||||||
if (!index) {
|
if (!index) {
|
||||||
idx = (net->xfrm.idx_generator | dir);
|
idx = (idx_generator | dir);
|
||||||
net->xfrm.idx_generator += 8;
|
idx_generator += 8;
|
||||||
} else {
|
} else {
|
||||||
idx = index;
|
idx = index;
|
||||||
index = 0;
|
index = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user