Skip to content
Commit 943211c8 authored by Siddh Raman Pant's avatar Siddh Raman Pant Committed by Christian Brauner
Browse files

watch_queue: prevent dangling pipe pointer



NULL the dangling pipe reference while clearing watch_queue.

If not done, a reference to a freed pipe remains in the watch_queue,
as this function is called before freeing a pipe in free_pipe_info()
(see line 834 of fs/pipe.c).

The sole use of wqueue->defunct is for checking if the watch queue has
been cleared, but wqueue->pipe is also NULLed while clearing.

Thus, wqueue->defunct is superfluous, as wqueue->pipe can be checked
for NULL. Hence, the former can be removed.

Tested with keyutils testsuite.

Cc: stable@vger.kernel.org # 6.1
Signed-off-by: default avatarSiddh Raman Pant <code@siddh.me>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Message-Id: <20230605143616.640517-1-code@siddh.me>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent a7bc2e8d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment