tools: two minor fixes for libxenhypfs
cover tools: two minor fixes for libxenhypfs
Two fixes for libxenhypfs:
- xenhypfs terminating with segfault when hypervisor doesn't have hypfs support
- wrong error reporting in case for access errors with xenhypfs
Juergen Gross (2):
tools: fix error path of xenhypfs_open()
tools: fix setting of errno in xenhypfs_read_raw()
tools/libs/hypfs/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/2 tools: fix error path of xenhypfs_open()
In case of an error in xenhypfs_open() the error path will cause a segmentation fault due to a wrong sequence of closing calls.
--- tools/libs/hypfs/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libs/hypfs/core.c +1 -1
@@ -74,8 +74,8 @@ xenhypfs_handle *xenhypfs_open(xentoollog_logger *logger,return fshdl; err: -xtl_logger_destroy (fshdl->logger_tofree);xencall_close (fshdl->xcall); +xtl_logger_destroy (fshdl->logger_tofree);free (fshdl);return NULL ; }
Signature · 1 line
2.26.2
RE: [PATCH for-4.14 1/2] tools: fix error path of xenhypfs_open()
Quoted 8 lines
-----Original Message-----
From: Juergen Gross <[email protected]>
Sent: 09 June 2020 15:49
To: [email protected]
Cc: [email protected]; Juergen Gross <[email protected]>; Ian Jackson <[email protected]>; Wei Liu <[email protected]>; Andrew Cooper <[email protected]>
Subject: [PATCH for-4.14 1/2] tools: fix error path ofxenhypfs_open()
Quoted 5 lines
In case of an error in
xenhypfs_open()the error path will cause a segmentation fault due to a wrong sequence of closing calls.Reported-by Andrew Cooper <[email protected]>Signed-off-by Juergen Gross <[email protected]>
Quoted 20 lines
--- tools/libs/hypfs/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/libs/hypfs/core.c +1
-2@@ -74,8 +74,8 @@ xenhypfs_handle *xenhypfs_open(xentoollog_logger *logger,return fshdl; err: -xtl_logger_destroy (fshdl->logger_tofree);xencall_close (fshdl->xcall); +xtl_logger_destroy (fshdl->logger_tofree);free (fshdl);return NULL ; } --2.26.2
PATCH 2/2 tools: fix setting of errno in xenhypfs_read_raw()
In reply to Juergen GrossSetting of errno is wrong in xenhypfs_read_raw(), fix it.
--- tools/libs/hypfs/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
tools/libs/hypfs/core.c +1 -3
@@ -241,10 +241,8 @@ void *xenhypfs_read_raw(xenhypfs_handle *fshdl, const char *path,if (!ret)break ; -if (ret !=ENOBUFS ) { - errno = -ret; +if (errno !=ENOBUFS ) goto out; - } } content =malloc (entry->content_len);
Signature · 1 line
2.26.2
RE: [PATCH for-4.14 2/2] tools: fix setting of errno in xenhypfs_read_raw()
Quoted 8 lines
-----Original Message-----
From: Juergen Gross <[email protected]>
Sent: 09 June 2020 15:49
To: [email protected]
Cc: [email protected]; Juergen Gross <[email protected]>; Ian Jackson <[email protected]>; Wei Liu <[email protected]>; George Dunlap <[email protected]>
Subject: [PATCH for-4.14 2/2] tools: fix setting of errno inxenhypfs_read_raw()
Quoted 4 lines
Setting of errno is wrong in
xenhypfs_read_raw(), fix it.Reported-by George Dunlap <[email protected]>Signed-off-by Juergen Gross <[email protected]>
Quoted 22 lines
--- tools/libs/hypfs/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)tools/libs/hypfs/core.c +1
-4@@ -241,10 +241,8 @@ void *xenhypfs_read_raw(xenhypfs_handle *fshdl, const char *path,if (!ret)break ; -if (ret !=ENOBUFS ) { - errno = -ret; +if (errno !=ENOBUFS ) goto out; - } } content =malloc (entry->content_len); --2.26.2
Wei Liu
AppliedQuoted 9 lines · Juergen Gross
Two fixes for libxenhypfs:
- xenhypfs terminating with segfault when hypervisor doesn't have hypfs support
- wrong error reporting in case for access errors with xenhypfsJuergen Gross (2):
tools: fix error path ofxenhypfs_open()
tools: fix setting of errno inxenhypfs_read_raw()
Applied. I also added Fixes tags to them.
Wei.
Quoted 7 lines
tools/libs/hypfs/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)Signature · 1 line
2.26.2