In the Linux kernel, the following vulnerability has been resolved:
rcu/nocb: Fix WARNONONCE() in the rcunocbbypass_lock()
For the kernels built with CONFIGRCUNOCBCPUDEFAULTALL=y and CONFIGRCULAZY=y, the following scenarios will trigger WARNONONCE() in the rcunocbbypasslock() and rcunocbwait_contended() functions:
CPU2 CPU11
kthread rcunocbcbkthread ksyswrite rcudobatch vfswrite rcutorturetimercb procsyswrite _kmemcachefree procsyscallhandler kmemleakfree dropcachessysctlhandler deleteobjectfull dropslab _deleteobject shrinkslab putobject lazyrcushrinkscan callrcu rcunocbflushbypass _callrcucommn rcunocbbypasslock rawspintrylock(&rdp->nocbbypasslock) fail atomicinc(&rdp->nocblockcontended); rcunocbwaitcontended WARNONONCE(smpprocessorid() != rdp->cpu); WARNONONCE(atomicread(&rdp->nocblockcontended)) | | _ _ _ _ _ _ _ _ same rdp and rdp->cpu != 11 _ _ _ _ _ _ _ _ __|
Reproduce this bug with "echo 3 > /proc/sys/vm/drop_caches".
This commit therefore uses rcunocbtryflushbypass() instead of rcunocbflushbypass() in lazyrcushrinkscan(). If the nocbbypass queue is being flushed, then rcunocbtryflush_bypass will return directly.