]> www.infradead.org Git - users/jedix/linux-maple.git/commit
percpu: fix synchronization between chunk->map_extend_work and chunk destruction
authorTejun Heo <tj@kernel.org>
Wed, 25 May 2016 15:48:25 +0000 (11:48 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 9 Nov 2016 22:09:58 +0000 (14:09 -0800)
commit4654f6b78cf0a51799177db439b3c8e1679d9b88
tree969750194a62d3ef87a8c7180792026a9e83a69d
parent6b3e3ad04bd9f15c484ba0fc24bfea30be5a6e95
percpu: fix synchronization between chunk->map_extend_work and chunk destruction

Atomic allocations can trigger async map extensions which is serviced
by chunk->map_extend_work.  pcpu_balance_work which is responsible for
destroying idle chunks wasn't synchronizing properly against
chunk->map_extend_work and may end up freeing the chunk while the work
item is still in flight.

This patch fixes the bug by rolling async map extension operations
into pcpu_balance_work.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # v3.18+
Fixes: 9c824b6a172c ("percpu: make sure chunk->map array has available space")
Orabug: 25060076
CVE: CVE-2016-4794
Mainline v4.7 commit 4f996e234dad488e5d9ba0858bc1bae12eff82c3
Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
mm/percpu.c