9p: null terminate fs driver options list
PATCH 1/1 9p: null terminate fs driver options list
From: Prasad J Pandit <[email protected]>
NULL terminate fs driver options' list, validate_opt() looks for a null entry to terminate the loop.
Signed-off-by Prasad J Pandit <[email protected]>
--- fsdev/qemu-fsdev.c | 3 +++ 1 file changed, 3 insertions(+)
fsdev/qemu-fsdev.c +3 -0
@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {"throttling.iops-read-max-length" ,"throttling.iops-write-max-length" ,"throttling.iops-size" , +NULL }, }, {
@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = { .ops = &synth_ops, .opts = (const char * []) { COMMON_FS_DRIVER_OPTIONS, + NULL }, }, {
@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = { "socket", "sock_fd", "writeout", +NULL }, }, };
Signature · 1 line
2.26.2
Quoted 7 lines · P J P <[email protected]> 于2020年7月10日周五 上午2:01写道:
From: Prasad J Pandit <[email protected]>
NULL terminate fs driver options' list,
validate_opt()looks for a null entry to terminate the loop.Signed-off-by Prasad J Pandit <[email protected]>
Reviewed-by Li Qiang <[email protected]>
Quoted 36 lines
--- fsdev/qemu-fsdev.c | 3 +++ 1 file changed, 3 insertions(+)fsdev/qemu-fsdev.c +3
-1@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {"throttling.iops-read-max-length" ,"throttling.iops-write-max-length" ,"throttling.iops-size" , +NULL }, }, {@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = { .ops = &synth_ops, .opts = (const char * []) { COMMON_FS_DRIVER_OPTIONS, + NULL }, }, {@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = { "socket", "sock_fd", "writeout", +NULL }, }, }; --2.26.2
Quoted 5 lines · On Thu, 9 Jul 2020 23:28:48 +0530 P J P <[email protected]> wrote:
From: Prasad J Pandit <[email protected]>
NULL terminate fs driver options' list,
validate_opt()looks for a null entry to terminate the loop.
Good catch ! And this never bit us before because opt ends up pointing to some valid memory containing zeroes... by luck :)
I've added a Fixes tag and applied this to the 9p-fix branch.
https://github.com/gkurz/qemu/commits/9p-fix
Cheers,
--
Greg
Quoted 33 lines
Signed-off-by Prasad J Pandit <[email protected]>--- fsdev/qemu-fsdev.c | 3 +++ 1 file changed, 3 insertions(+)fsdev/qemu-fsdev.c +3
-0@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {"throttling.iops-read-max-length" ,"throttling.iops-write-max-length" ,"throttling.iops-size" , +NULL }, }, {@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = { .ops = &synth_ops, .opts = (const char * []) { COMMON_FS_DRIVER_OPTIONS, + NULL }, }, {@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = { "socket", "sock_fd", "writeout", +NULL }, }, };