virtfs-proxy-helper: small fixes
cover virtfs-proxy-helper: small fixes
These fixes are not critical but it wouldn't hurt to get them into QEMU 2.3.
See patches for descriptions.
Stefan Hajnoczi (2):
virtfs-proxy-helper: add missing long option terminator
virtfs-proxy-helper: fail gracefully if socket path is too long
fsdev/virtfs-proxy-helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.1.0
PATCH 1/2 virtfs-proxy-helper: add missing long option terminator
The getopt_long(3) long options array must have a zeroed terminator.
This patch solves a segmentation fault when an unknown command-line option is encountered:
$ fsdev/virtfs-proxy-helper --help Segmentation fault (core dumped)
--- fsdev/virtfs-proxy-helper.c | 1 + 1 file changed, 1 insertion(+)
fsdev/virtfs-proxy-helper.c +1 -0
@@ -49,6 +49,7 @@ static struct option helper_opts[] = { {"socket", required_argument, NULL, 's'}, {"uid", required_argument, NULL, 'u'}, {"gid", required_argument, NULL, 'g'}, + {}, };static bool is_daemon;
Signature · 1 line
2.1.0
PATCH 2/2 virtfs-proxy-helper: fail gracefully if socket path is too long
In reply to Stefan HajnocziReplace the assertion check with graceful failure when the socket path is too long. Programs should not crash on invalid input. Print an error message and exit properly.
--- fsdev/virtfs-proxy-helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fsdev/virtfs-proxy-helper.c +6 -1
@@ -739,7 +739,12 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)return -1 ; } -g_assert (strlen (path) <sizeof (proxy.sun_path)); +if (strlen (path) >=sizeof (proxy.sun_path)) { +do_log (LOG_CRIT ,"UNIX domain socket path exceeds %zu characters\n" , +sizeof (proxy.sun_path)); +return -1 ; + } + sock =socket (AF_UNIX ,SOCK_STREAM ,0 );if (sock <0 ) {do_perror ("socket" );
Signature · 1 line
2.1.0
Quoted 10 lines · Stefan Hajnoczi
These fixes are not critical but it wouldn't hurt to get them into QEMU 2.3.
See patches for descriptions.
Stefan Hajnoczi (2):
virtfs-proxy-helper: add missing long option terminator
virtfs-proxy-helper: fail gracefully if socket path is too longfsdev/virtfs-proxy-helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Ping?
Aneesh Kumar K.V
AppliedQuoted 5 lines · Stefan Hajnoczi
Quoted 4 lines · Stefan Hajnoczi
These fixes are not critical but it wouldn't hurt to get them into QEMU 2.3.
See patches for descriptions.
Quoted 8 lines
Quoted 6 lines
Stefan Hajnoczi (2):
virtfs-proxy-helper: add missing long option terminator
virtfs-proxy-helper: fail gracefully if socket path is too longfsdev/virtfs-proxy-helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)Ping?
Applied.
-aneesh
Quoted 5 lines · Aneesh Kumar K.V
Quoted 3 lines · Stefan Hajnoczi
Quoted 2 lines · Stefan Hajnoczi
These fixes are not critical but it wouldn't hurt to get them into QEMU 2.3.
I am not sure whether this is critical enough to go to Qemu 2.3 ? If so I can send a pull request. I have already pushed the changes after testing to
https://github.com/kvaneesh/qemu.git tags/for-upstream-signed
-aneesh
Quoted 8 lines · Aneesh Kumar K.V
Quoted 5 lines · Aneesh Kumar K.V
Quoted 3 lines · Stefan Hajnoczi
Quoted 2 lines · Stefan Hajnoczi
These fixes are not critical but it wouldn't hurt to get them into QEMU 2.3.
Quoted 6 lines
I am not sure whether this is critical enough to go to Qemu 2.3 ? If so I can send a pull request. I have already pushed the changes after testing to
https://github.com/kvaneesh/qemu.git tags/for-upstream-signed
It's too late for QEMU 2.3 (release is planned for today) and they are not critical.
Feel free to send a pull request at your convenience and they'll go into QEMU 2.4.
Stefan