Skip to content

Commit

Permalink
daemon: Fix DrMemory "UNINITIALIZED READ" hits in |attr_cache_update()|
Browse files Browse the repository at this point in the history
Fix DrMemory hits in |attr_cache_update()|, which were triggered by
using the request |bitmap4| instead of the response |bitmap4|

DrMemory hits look like this:
---- snip ----
Error #1: UNINITIALIZED READ: reading 8 byte(s)
attr_cache_update                     [ms-nfs41-client\daemon\name_cache.c:323]
nfs41_attr_cache_update               [ms-nfs41-client\daemon\name_cache.c:957]
nfs41_setattr                         [ms-nfs41-client\daemon\nfs41_ops.c:1495]
handle_setexattr                      [ms-nfs41-client\daemon\ea.c:186]
upcall_handle                         [ms-nfs41-client\daemon\upcall.c:220]
nfsd_worker_thread_main               [ms-nfs41-client\daemon\nfs41_daemon.c:188]
nfsd_thread_main                      [ms-nfs41-client\daemon\nfs41_daemon.c:226]
KERNEL32.dll!BaseThreadInitThunk     +0x13     (0x00007ffe78f47374 <KERNEL32.dll+0x17374>)

Error #2: UNINITIALIZED READ: reading 4 byte(s)
attr_cache_update                     [ms-nfs41-client\daemon\name_cache.c:324]
nfs41_attr_cache_update               [ms-nfs41-client\daemon\name_cache.c:957]
nfs41_setattr                         [ms-nfs41-client\daemon\nfs41_ops.c:1495]
handle_setexattr                      [ms-nfs41-client\daemon\ea.c:186]
upcall_handle                         [ms-nfs41-client\daemon\upcall.c:220]
nfsd_worker_thread_main               [ms-nfs41-client\daemon\nfs41_daemon.c:188]
nfsd_thread_main                      [ms-nfs41-client\daemon\nfs41_daemon.c:226]
KERNEL32.dll!BaseThreadInitThunk     +0x13     (0x00007ffe78f47374 <KERNEL32.dll+0x17374>)
---- snip ----

Signed-off-by: Cedric Blancher <[email protected]>
Signed-off-by: Tigran Mkrtchyan <[email protected]>
  • Loading branch information
gisburn authored and kofemann committed Jul 29, 2024
1 parent 0bf1908 commit 569d8f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/nfs41_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ int nfs41_setattr(
if (compound_error(status = compound.res.status))
goto out;

bitmap4_cpy(&info->attrmask, &attr_request);
bitmap4_cpy(&info->attrmask, &getattr_res.obj_attributes.attrmask);
nfs41_attr_cache_update(session_name_cache(session),
file->fh.fileid, info);

Expand Down

0 comments on commit 569d8f5

Please sign in to comment.