]> git.baikalelectronics.ru Git - kernel.git/commit
block: partition: initialize percpuref before sending out KOBJ_ADD
authorMing Lei <ming.lei@canonical.com>
Wed, 30 Mar 2016 00:46:31 +0000 (08:46 +0800)
committerJens Axboe <axboe@fb.com>
Wed, 30 Mar 2016 01:18:14 +0000 (19:18 -0600)
commit683cf84ac7ef6e4edf39db7fdfa1d8e65929e21d
tree07da263067ec36686177990a48000beb0ceb2eae
parent9bdda6c3a367c59f0b04f63eb399ab57ed1b5412
block: partition: initialize percpuref before sending out KOBJ_ADD

The initialization of partition's percpu_ref should have been done before
sending out KOBJ_ADD uevent, which may cause userspace to read partition
table. So the uninitialized percpu_ref may be accessed in data path.

This patch fixes this issue reported by Naveen.

Reported-by: Naveen Kaje <nkaje@codeaurora.org>
Tested-by: Naveen Kaje <nkaje@codeaurora.org>
Fixes: fcff2d6cede1e(block: partition: convert percpu ref)
Cc: <stable@vger.kernel.org> # v4.3+
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/partition-generic.c