]> git.baikalelectronics.ru Git - kernel.git/commit
percpu_ref: don't refer to ref->data if it isn't allocated
authorMing Lei <ming.lei@redhat.com>
Fri, 9 Oct 2020 04:03:56 +0000 (12:03 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 9 Oct 2020 18:32:06 +0000 (12:32 -0600)
commit821e88ecb6557bcaaaf9d15bc7bac34da1270e0f
tree709047965688b8a10260522de051e5fe23afbbb9
parentb591c2fc9ee0bdb19441bb5bf19346d742262d51
percpu_ref: don't refer to ref->data if it isn't allocated

We can't check ref->data->confirm_switch directly in __percpu_ref_exit(), since
ref->data may not be allocated in one not-initialized refcount.

Fixes: 130b6c001850 ("percpu_ref: reduce memory footprint of percpu_ref in fast path")
Reported-by: syzbot+fd15ff734dace9e16437@syzkaller.appspotmail.com
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/percpu-refcount.c