Fix segfault on access to mpp->hwe
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | master - libmultipath: fix use after free when iscsi logs inlibmultipath/ | +2 | 0 replies | |
| 2/4 | libmultipath: warn if freeing path that holds mpp->hwelibmultipath/ | +4 | 0 replies | |
| 3/4 | libmultipath: warn about NULL value of mpp->hwelibmultipath/ | +3 | 0 replies | |
| 4/4 | libmultipath: fix mpp->hwe handling in sync_paths()libmultipath/ | +4 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Benjamin Marzinski |
|---|---|
| Series | R-b |
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] Fix segfault on access to mpp->hwe
From: Martin Wilck <[email protected]>
This is in response to Lixiaokeng's post
"master - libmultipath: fix use after free when iscsi logs in".
On top of Lixiaokeng's patch, I've added some log messages and a fix for mpp->hwe handling in sync_paths().
The question remains how we handle maps without paths. I believe we're good here, please review my assessment.
mpp->hwe is only accessed in propsel.c, via the mp_set_hwe() macro. Patch 3 of my series adds an error message if this happens while mpp->hwe is NULL. IMO it shouldn't happen because we don't check map properties for empty maps. Normally this is done when a map is created, and we don't create maps without paths.
The case where a map looses all paths during its normal lifetime and can't be removed (e.g. because it's busy) is already covered by the current code AFAICT. When a new path is re-added, we'll call adopt_paths and verify_paths(), which will make sure that mpp->hwe is set again to the pp->hwe member of the newly added path.
Reviews and comments welcome.
Regards
Martin
Martin Wilck (3):
libmultipath: warn if freeing path that holds mpp->hwe
libmultipath: warn about NULL value of mpp->hwe
libmultipath: fix mpp->hwe handling in sync_paths()
lixiaokeng (1):
master - libmultipath: fix use after free when iscsi logs in
libmultipath/propsel.c | 4 +++- libmultipath/structs_vec.c | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
Signature · 1 line
2.26.2