mirror of
https://github.com/lkl/linux.git
synced 2025-12-20 00:23:14 +09:00
padata: Convert from atomic_t to refcount_t on parallel_data->refcnt
refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Acked-by: Daniel Jordan <daniel.m.jordan@oracle.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#ifndef PADATA_H
|
||||
#define PADATA_H
|
||||
|
||||
#include <linux/refcount.h>
|
||||
#include <linux/compiler_types.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/spinlock.h>
|
||||
@@ -96,7 +97,7 @@ struct parallel_data {
|
||||
struct padata_shell *ps;
|
||||
struct padata_list __percpu *reorder_list;
|
||||
struct padata_serial_queue __percpu *squeue;
|
||||
atomic_t refcnt;
|
||||
refcount_t refcnt;
|
||||
unsigned int seq_nr;
|
||||
unsigned int processed;
|
||||
int cpu;
|
||||
|
||||
Reference in New Issue
Block a user