Closed SergeyLysanov closed 6 years ago
Actually, issue fixed in 2.5-stable by commit 9d741775c71d1ff52e7444f3f1d791301fa58b27:
export: avoid double free if init_export_root fail at add_export
put_gsh_export() frees the export if init_export_root() fail,
and then, a double free happens in the following config code.
Change-Id: Ia94be7915ed014de1055aa9cb6c4f8089108ff0c
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
(cherry picked from commit 484298556b2722ba59b28d41f00458a5f9749266)
The bug is easy to reproduce. Call dynamic export procedure to config with non existing path:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/root/ganesha.conf string:"export(export_id=77)"
Config sample:
Ganesha make double free of gsh_export struct. We call twice put_gsh_export(first in export_revert, second in out section in export_commit_common function) and free struct gsh_export. Then call export_init function from proc_bloc and free struct again: