Hide Forgot
PATCH: http://patches.gluster.com/patch/3339 in master (cluster/stripe: added STACK_UNWIND_STRICT macro)
PATCH: http://patches.gluster.com/patch/3340 in master (cluster/stripe: NULL pointer dereference checks added)
This has to happen throughout the code base to avoid crashing of the product in any circumstances.
PATCH: http://patches.gluster.com/patch/3518 in master (NULL dereference fixes in code base after running with 'clang')
I ran clang by setting 'GF_CALLOC', GF_MALLOC and GF_REALLOC to be set as NULL.. out put says, on these lines, we may face NULL dereference errors.. glusterfsd /src /glusterfsd.c 340 libglusterfs /src /common-utils.c 96 libglusterfs /src /event.c 202 libglusterfs /src /event.c 409 libglusterfs /src /logging.c 333 libglusterfs /src /logging.c 319 libglusterfs /src /xlator.c 752 rpc /rpc-lib /src /rpcsvc.c 2008 rpc /rpc-transport /socket /src /socket.c 1509 xlators /cluster /afr /src /afr-dir-read.c 392 xlators /cluster /afr /src /afr-self-heal-algorithm.c 1041 xlators /cluster /afr /src /afr-self-heal-common.c 156 xlators /cluster /afr /src /afr-self-heal-common.c 1597 xlators /cluster /afr /src /afr-self-heal-common.c 173 xlators /cluster /afr /src /afr-self-heal-common.c 494 xlators /cluster /afr /src /afr-self-heal-common.c 497 xlators /cluster /afr /src /afr-self-heal-common.c 500 xlators /cluster /afr /src /afr-self-heal-common.c 623 xlators /cluster /afr /src /afr-self-heal-common.c 944 xlators /cluster /afr /src /afr-self-heal-common.c 1465 xlators /cluster /afr /src /afr-self-heal-data.c 397 xlators /cluster /afr /src /afr-self-heal-data.c 407 xlators /cluster /afr /src /afr-self-heal-data.c 774 xlators /cluster /afr /src /afr-self-heal-entry.c 259 xlators /cluster /afr /src /afr-self-heal-entry.c 246 xlators /cluster /afr /src /afr-self-heal-metadata.c 235 xlators /cluster /afr /src /afr-self-heal-metadata.c 254 xlators /features /quota /src /quota.c 782 xlators /features /quota /src /quota.c 1070 xlators /features /quota /src /quota.c 288 xlators /features /quota /src /quota.c 213 xlators /mgmt /glusterd /src /glusterd-sm.c 554 xlators /nfs /server /src /mount3.c 246 xlators /performance /write-behind /src /write-behind.c 583 xlators /protocol /legacy /server /src /server-helpers.c 579 xlators /protocol /legacy /server /src /server-protocol.c 4918 xlators /protocol /legacy /server /src /server-resolve.c 85 xlators /protocol /legacy /transport /ib-verbs /src /ib-verbs.c 1835 xlators /protocol /legacy /transport /ib-verbs /src /ib-verbs.c 2515 xlators /protocol /legacy /transport /ib-verbs /src /ib-verbs.c 508 xlators /protocol /legacy /transport /socket /src /socket.c 947 xlators /protocol /server /src /server-handshake.c 95 xlators /protocol /server /src /server-helpers.c 688 xlators /protocol /server /src /server-resolve.c 80 xlators /storage /posix /src /posix.c 186
with patch http://patches.gluster.com/patch/3879/ we will be left with only below null derefs: > xlators /cluster /afr /src /afr-dir-read.c 392 > xlators /cluster /afr /src /afr-self-heal-algorithm.c 1041 > xlators /cluster /afr /src /afr-self-heal-common.c 156 > xlators /cluster /afr /src /afr-self-heal-common.c 1597 > xlators /cluster /afr /src /afr-self-heal-common.c 173 > xlators /cluster /afr /src /afr-self-heal-common.c 494 > xlators /cluster /afr /src /afr-self-heal-common.c 497 > xlators /cluster /afr /src /afr-self-heal-common.c 500 > xlators /cluster /afr /src /afr-self-heal-common.c 623 > xlators /cluster /afr /src /afr-self-heal-common.c 944 > xlators /cluster /afr /src /afr-self-heal-common.c 1465 > xlators /cluster /afr /src /afr-self-heal-data.c 397 > xlators /cluster /afr /src /afr-self-heal-data.c 407 > xlators /cluster /afr /src /afr-self-heal-data.c 774 > xlators /cluster /afr /src /afr-self-heal-entry.c 259 > xlators /cluster /afr /src /afr-self-heal-entry.c 246 > xlators /cluster /afr /src /afr-self-heal-metadata.c 235 > xlators /cluster /afr /src /afr-self-heal-metadata.c 254 > xlators /features /quota /src /quota.c 782 > xlators /features /quota /src /quota.c 1070 > xlators /features /quota /src /quota.c 288 > xlators /features /quota /src /quota.c 213 > xlators /nfs /server /src /mount3.c 246 We may skip these for now, as these are moved to legacy, and we may take it out of build from 3.1.1+ versions.. > xlators /protocol /legacy /server /src /server-helpers.c 579 > xlators /protocol /legacy /server /src /server-resolve.c 85 > xlators /protocol /legacy /transport /ib-verbs /src /ib-verbs.c 1835 > xlators /protocol /legacy /transport /ib-verbs /src /ib-verbs.c 2515 > xlators /protocol /legacy /transport /ib-verbs /src /ib-verbs.c 508 > xlators /protocol /legacy /transport /socket /src /socket.c 947
NULL dereferences are surely blocker for release
Amar, RaghuB - are these covered under the clang checks ? If they are all included, we can close this defect as its all being tracked in other defects.
Nope, these are not covered under 'clang' bugs which Raghu filed. I got these list by setting '#define GF_CALLOC NULL' in code and running the clang. It did report new null pointer dereference. I have posted the files and line number where the bugs are above. -Amar
PATCH: http://patches.gluster.com/patch/3931 in master (some check added to the variables after GF_CALLOC)
PATCH: http://patches.gluster.com/patch/3940 in master (removed last few remaining 'ERR_ABORT's from codebase)
*** Bug 802 has been marked as a duplicate of this bug. ***
Pranith, As you are handling afr bugs, the listed lines have NULL dereferences, please fix them.
*** This bug has been marked as a duplicate of bug 837 ***