In the Linux kernel, the following vulnerability has been resolved:
netfilter: conntrack: fix using _thiscpu_add in preemptible
Currently in nfconntrackhashcheckinsert(), when it fails in nfctextvalidpre/post(), NFCTSTAT_INC() will be called in the preemptible context, a call trace can be triggered:
BUG: using _thiscpuadd() in preemptible [00000000] code: conntrack/1636 caller is nfconntrackhashcheckinsert+0x45/0x430 [nfconntrack] Call Trace: <TASK> dumpstacklvl+0x33/0x46 checkpreemptiondisabled+0xc3/0xf0 nfconntrackhashcheckinsert+0x45/0x430 [nfconntrack] ctnetlinkcreateconntrack+0x3cd/0x4e0 [nfconntracknetlink] ctnetlinknewconntrack+0x1c0/0x450 [nfconntracknetlink] nfnetlinkrcvmsg+0x277/0x2f0 [nfnetlink] netlinkrcvskb+0x50/0x100 nfnetlinkrcv+0x65/0x144 [nfnetlink] netlinkunicast+0x1ae/0x290 netlinksendmsg+0x257/0x4f0 sock_sendmsg+0x5f/0x70
This patch is to fix it by changing to use NFCTSTATINCATOMIC() for nfctextvalidpre/post() check in nfconntrackhashcheckinsert(), as well as nfctextvalidpost() in _nfconntrack_confirm().
Note that nfctextvalidpre() check in _nfconntrackconfirm() is safe to use NFCTSTATINC(), as it's under localbhdisable().