um: vector: Avoid NULL ptr deference if transport is unset
PATCH 1/1 um: vector: Avoid NULL ptr deference if transport is unset
When the transport option of a vec isn't set strncmp ends up being called on a NULL pointer. Better not do that.
Signed-off-by Sjoerd Simons <[email protected]>
---
arch/um/drivers/vector_kern.c | 3 +++ 1 file changed, 3 insertions(+)
arch/um/drivers/vector_kern.c +3 -0
@@ -198,6 +198,9 @@ static int get_transport_options(struct arglist *def)long parsed;int result =0 ; +if (transport ==NULL ) +return -EINVAL ; +if (vector !=NULL ) {if (kstrtoul (vector,10 , &parsed) ==0 ) {if (parsed ==0 ) {
Signature · 7 lines
2.25.0 _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Quoted 16 lines · Sjoerd Simons
When the transport option of a vec isn't set strncmp ends up being called on a NULL pointer. Better not do that.
Signed-off-by Sjoerd Simons <[email protected]>---
arch/um/drivers/vector_kern.c | 3 +++ 1 file changed, 3 insertions(+)arch/um/drivers/vector_kern.c +0
-0
arch/um/drivers/vector_kern.c static int get_transport_options(struct arglist *def) · line 206
Quoted 9 lines
arch/um/drivers/vector_kern.c +3
-0@@ -198,6 +198,9 @@ static int get_transport_options(struct arglist *def)long parsed;int result =0 ; +if (transport ==NULL ) +return -EINVAL ; +if (vector !=NULL ) {if (kstrtoul (vector,10 , &parsed) ==0 ) {if (parsed ==0 ) {
Acked-by Anton Ivanov <[email protected]>
Signature · 3 lines
Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/
Richard Weinberger
AppliedQuoted 20 lines · Anton Ivanov
Quoted 18 lines · Sjoerd Simons
When the transport option of a vec isn't set strncmp ends up being called on a NULL pointer. Better not do that.
Signed-off-by Sjoerd Simons <[email protected]>---
arch/um/drivers/vector_kern.c | 3 +++ 1 file changed, 3 insertions(+)arch/um/drivers/vector_kern.c +0
-0@@ -198,6 +198,9 @@ static int get_transport_options(struct arglist *def)long parsed;int result =0 ;
Quoted 8 lines
arch/um/drivers/vector_kern.c static int get_transport_options(struct arglist *def) · line 206
Quoted 7 lines
arch/um/drivers/vector_kern.c +3
-0+if (transport ==NULL ) +return -EINVAL ; +if (vector !=NULL ) {if (kstrtoul (vector,10 , &parsed) ==0 ) {if (parsed ==0 ) {Acked-by Anton Ivanov <[email protected]>
Applied, thanks!
Signature · 7 lines
Thanks, //richard _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um