diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-04-25 10:19:52 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-24 11:05:58 +0000 |
commit | 72e9f4e18b2b6b84fcf46f9f6dde691d8e41a42f (patch) | |
tree | b0b28de6225d995e0d6d5ce30e6e5d8f068ca076 /include/linux | |
parent | ed926c212f23de387aa05060a39cb4152edb66f1 (diff) |
lockdep: Swap storage for pin_count and references
As a lockmap takes a reference for every ww_mutex used together, this
can be an arbitrarily large number and under control of userspace --
easily overflowing the arbitrary limit of 4096. However, the pin_count
(used for detecting unexpected lock dropping) is a full 32b despite
nesting being extremely rare (see lockdep_pin_lock).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190425092004.9995-33-chris@chris-wilson.co.uk
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/lockdep.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 664f52c6dd4c..2201cdad23e1 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -271,8 +271,8 @@ struct held_lock { unsigned int read:2; /* see lock_acquire() comment */ unsigned int check:1; /* see lock_acquire() comment */ unsigned int hardirqs_off:1; - unsigned int references:12; /* 32 bits */ - unsigned int pin_count; + unsigned int pin_count:12; /* 32 bits */ + unsigned int references; }; /* |