android_kernel_motorola_sm6375/Documentation/accounting
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Suren Baghdasaryan 2fd752ed77 psi: Fix uaf issue when psi trigger is destroyed while being polled
commit a06247c6804f1a7c86a2e5398a4c1f1db1471848 upstream.

With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which was destroyed.
Fix this by disallowing to redefine an existing psi trigger. If a write
operation is used on a file descriptor with an already existing psi
trigger, the operation will fail with EBUSY error.
Also bypass a check for psi_disabled in the psi_trigger_destroy as the
flag can be flipped after the trigger is created, leading to a memory
leak.

Fixes: 0e94682b73 ("psi: introduce psi monitor")
Reported-by: [email protected]
Suggested-by: Linus Torvalds <[email protected]>
Analyzed-by: Eric Biggers <[email protected]>
Signed-off-by: Suren Baghdasaryan <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Eric Biggers <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
[surenb: backported to 5.4 kernel]
CC: [email protected] # 5.4
Signed-off-by: Suren Baghdasaryan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-02-05 12:35:36 +01:00
..
cgroupstats.rst docs: accounting: convert to ReST 2019-07-15 09:20:25 -03:00
delay-accounting.rst docs: accounting: convert to ReST 2019-07-15 09:20:25 -03:00
index.rst docs: add some documentation dirs to the driver-api book 2019-07-15 11:03:02 -03:00
psi.rst psi: Fix uaf issue when psi trigger is destroyed while being polled 2022-02-05 12:35:36 +01:00
taskstats-struct.rst docs: accounting: convert to ReST 2019-07-15 09:20:25 -03:00
taskstats.rst docs: accounting: convert to ReST 2019-07-15 09:20:25 -03:00