summaryrefslogtreecommitdiffstats
path: root/net/sctp/auth.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2016-10-11 10:56:45 -0700
committerDavid S. Miller <davem@davemloft.net>2016-10-13 10:26:43 -0400
commitab102b80cef28c20b3ef7794806c3a982c6444fc (patch)
treef1f4ef200fb7180cccc07d88978c1d4ff42aae92 /net/sctp/auth.c
parentd1ef006dc116bf6487426b0b50c1bf2bf51e6423 (diff)
downloadlinux-ab102b80cef28c20b3ef7794806c3a982c6444fc.tar.gz
linux-ab102b80cef28c20b3ef7794806c3a982c6444fc.tar.bz2
linux-ab102b80cef28c20b3ef7794806c3a982c6444fc.zip
net_sched: reorder pernet ops and act ops registrations
Krister reported a kernel NULL pointer dereference after tcf_action_init_1() invokes a_o->init(), it is a race condition where one thread calling tcf_register_action() to initialize the netns data after putting act ops in the global list and the other thread searching the list and then calling a_o->init(net, ...). Fix this by moving the pernet ops registration before making the action ops visible. This is fine because: a) we don't rely on act_base in pernet ops->init(), b) in the worst case we have a fully initialized netns but ops is still not ready so new actions still can't be created. Reported-by: Krister Johansen <kjlx@templeofstupid.com> Tested-by: Krister Johansen <kjlx@templeofstupid.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/auth.c')
0 files changed, 0 insertions, 0 deletions