From ea59824b01e50c5ffb5defa0388621d17eb9dec3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 3 Mar 2021 19:19:23 +0100 Subject: [PATCH 1/2] locking: Fix an uninitialized variable read Bug: https://bugzilla.samba.org/show_bug.cgi?id=14636 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher (cherry picked from commit 84b634c613352fc1da8e1525d72597c526d534d2) --- source3/locking/share_mode_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index a736bc24469..a0de9f5b070 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -1923,7 +1923,7 @@ static void share_mode_entry_do_fn( struct share_mode_entry_do_state *state = private_data; size_t idx; bool found = false; - bool modified; + bool modified = false; struct share_mode_entry e; struct share_mode_entry_buf buf; TDB_DATA dbufs[3]; -- 2.25.1 From 99713e1d78a471dca801a9e1ac9ad33cd3d50387 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 3 Mar 2021 19:15:31 +0100 Subject: [PATCH 2/2] g_lock: Fix uninitalized variable reads If dbwrap_watched_watch_recv() returns IO_TIMEOUT, "blockerdead" might be an uninitialized non-false, and further down we'll remove the wrong exclusive locker. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14636 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Mar 5 11:22:07 UTC 2021 on sn-devel-184 (cherry picked from commit 654c18a244f060d81280493a324b98602a69dbbf) --- source3/lib/g_lock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index 4bf30188a43..c3b4b644537 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -600,8 +600,8 @@ static void g_lock_lock_retry(struct tevent_req *subreq) struct g_lock_lock_state *state = tevent_req_data( req, struct g_lock_lock_state); struct g_lock_lock_fn_state fn_state; - struct server_id blocker; - bool blockerdead; + struct server_id blocker = { .pid = 0 }; + bool blockerdead = false; NTSTATUS status; status = dbwrap_watched_watch_recv(subreq, &blockerdead, &blocker); -- 2.25.1