the cleanup __attribute__ doesn't get run when a thread is cancelled, so
it is only safe in cases where there aren't pthreads or no cancellation
points happen in the code block after the variable needs cleaning up.
Signed-off-by: Benjamin Marzinski
---
libmultipath/configure.c |
We know the size of these arrays, so we can just allocate them on the
stack. Also, show_path() doesn't use the width, so don't initialize it
in the first place.
Signed-off-by: Benjamin Marzinski
---
libmultipath/foreign.c| 5 ++--
libmultipath/libmultipath.version | 4 +--
If snprint_keyword() failed to correctly set up sbuf, don't print it.
Instead, return an error.
Signed-off-by: Benjamin Marzinski
---
libmpathutil/parser.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libmpathutil/parser.c b/libmpathutil/parser.c
index
STRBUF_ON_STACK() uses the cleanup __attribute__, which doesn't get run
if a thread is cancelled. condlog() will call fprintf() when run under
systemd, which is a cancellation point. The snprint function for the
generic mutipath and generic path operations both call cancellation
points. Also, the
the cleanup __attribute__ is only run when a variable goes out of scope
normally. It is not run on pthread cancellation. This means that
multipathd could leak whatever resources were supposed to be cleaned up
if the thread was cancelled in a function using variables with the
cleanup __attribute__.
Hi
Here I'm sending updated patch 4 that fixes hang on discard. We must not
do the optimization in dm_btree_lookup_next.
Mikulas
From: Mikulas Patocka
This patch reduces lock contention in btree walks. We modify the
functions init_ro_wpin, exit_ro_spine and ro_step so that they use
From: Luo Meng
When dm_resume() and dm_destroy() are concurrent, it will
lead to UAF.
One of the concurrency UAF can be shown as below:
use free
do_resume |
__find_device_hash_cell |
dm_get
From: Luo Meng
If dm_get_device() create dd in multipath_message(),
and then call table_deps() after dm_put_table_device(),
it will lead to concurrency UAF bugs.
One of the concurrency UAF can be shown as below:
(USE)|(FREE)