diff options
| author | Eric Biggers <[email protected]> | 2018-12-28 00:34:43 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2018-12-28 12:11:47 -0800 |
| commit | ca880420665dbc8beec3693bee9f5eccb89de4a6 (patch) | |
| tree | 7255c489175110780706a7eaf04fe8f0f34611b5 /tools/perf/scripts/python | |
| parent | 66f71da9dd38af17dc17209cdde7987d4679a699 (diff) | |
userfaultfd: convert userfaultfd_ctx::refcount to refcount_t
Reference counters should use refcount_t rather than atomic_t, since the
refcount_t implementation can prevent overflows, reducing the
exploitability of reference leak bugs. userfaultfd_ctx::refcount is a
reference counter with the usual semantics, so convert it to refcount_t.
Note: I replaced the BUG() on incrementing a 0 refcount with just
refcount_inc(), since part of the semantics of refcount_t is that that
incrementing a 0 refcount is not allowed; with CONFIG_REFCOUNT_FULL,
refcount_inc() already checks for it and warns.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Reviewed-by: Mike Rapoport <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions