[S] Change in ...nfs-ganesha[next]: grpc_server: fix NULL deref, mutex leak, and export removal in Remove...
Jim Chen has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1257728?usp=email ) Change subject: grpc_server: fix NULL deref, mutex leak, and export removal in RemoveExport ...................................................................... grpc_server: fix NULL deref, mutex leak, and export removal in RemoveExport In ExportService::RemoveExport(): 1. If EXPORT_ADMIN_TRYLOCK() fails, put_gsh_export(export_obj) was called while export_obj was still NULL, causing a NULL pointer dereference. 2. On lookup_export() failure or pseudo-root / ID 0 rejection, the function returned without calling EXPORT_ADMIN_UNLOCK(), leaving export_admin_mutex permanently locked. 3. Checking export_obj->pseudopath without a NULL check could crash if pseudopath is NULL. 4. Setting config_gen = 0 and calling synchronize_exports(generation) failed to remove an export whose config_gen was already 0 and could prune unrelated exports. Remove the NULL put_gsh_export() call, unlock EXPORT_ADMIN_UNLOCK() on all error paths, check pseudopath != NULL, and call release_export(export_obj, false) directly. Change-Id: I4b677a6b4ea7085d28321a338bb58185518cccbb Signed-off-by: Jim Chen <czcbangkai@google.com> --- M src/grpc_server/nfsServiceServer.cc 1 file changed, 9 insertions(+), 15 deletions(-) git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/28/1257728/1 -- To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1257728?usp=email To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: ffilz/nfs-ganesha Gerrit-Branch: next Gerrit-Change-Id: I4b677a6b4ea7085d28321a338bb58185518cccbb Gerrit-Change-Number: 1257728 Gerrit-PatchSet: 1 Gerrit-Owner: Jim Chen <czcbangkai@google.com>
participants (1)
-
Jim Chen (GerritHub)