Out off array access in usb-net
PATCH 1/1 Out off array access in usb-net
Properly check array bounds before accessing array element.
hw/usb-net.c +1 -1
@@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,break ;default : -if (usb_net_stringtable[value &0xff ]) { +if (ARRAY_SIZE (usb_net_stringtable) > (value &0xff )) { ret =set_usb_string (data, usb_net_stringtable[value &0xff ]);break ;
--
Gleb.
Quoted 17 lines · Gleb Natapov
Properly check array bounds before accessing array element.
Signed-off-by Gleb Natapov<[email protected]>hw/usb-net.c +1
-2@@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,break ;default : -if (usb_net_stringtable[value&0xff ]) { +if (ARRAY_SIZE (usb_net_stringtable)> (value&0xff )) { ret =set_usb_string (data, usb_net_stringtable[value&0xff ]);break ; --
Quoted 2 lines
Gleb.
Paolo
Quoted 1 line · Gleb Natapov
Properly check array bounds before accessing array element.
Impact?
Apply to stable as well?
Quoted 6 lines
Signed-off-by Gleb Natapov <[email protected]>hw/usb-net.c +0
-0
hw/usb-net.c static int usb_net_handle_control(USBDevice *dev, int request, int value, · line 1148
Quoted 8 lines
hw/usb-net.c +1
-1@@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,break ;default : -if (usb_net_stringtable[value &0xff ]) { +if (ARRAY_SIZE (usb_net_stringtable) > (value &0xff )) { ret =set_usb_string (data, usb_net_stringtable[value &0xff ]);break ;
Makes sense.
Nitpick: LIMIT > INDEX looks unusual to me; INDEX < LIMIT is more common.
Quoted 6 lines · Markus Armbruster
Quoted 1 line · Gleb Natapov
Properly check array bounds before accessing array element.
Impact?
Gapping security hole for those unfortunate enough to use usb-net?
Quoted 2 lines
Apply to stable as well?
Definitely. Actually for me Windows7 crashed when usb-net is present.
Quoted 17 lines
Quoted 6 lines
Signed-off-by Gleb Natapov <[email protected]>hw/usb-net.c +0
-0hw/usb-net.c static int usb_net_handle_control(USBDevice *dev, int request, int value, · line 1148
Quoted 8 lines
hw/usb-net.c +1
-1@@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,break ;default : -if (usb_net_stringtable[value &0xff ]) { +if (ARRAY_SIZE (usb_net_stringtable) > (value &0xff )) { ret =set_usb_string (data, usb_net_stringtable[value &0xff ]);break ;Makes sense.
Quoted 2 lines
Nitpick: LIMIT > INDEX looks unusual to me; INDEX < LIMIT is more common.
--
Gleb.
Quoted 8 lines · Gleb Natapov
Quoted 6 lines · Markus Armbruster
Quoted 1 line · Gleb Natapov
Properly check array bounds before accessing array element.
Impact?
Gapping security hole for those unfortunate enough to use usb-net?
Doesn't that bit of information belong in the commit message.
Quoted 3 lines
Quoted 2 lines
Apply to stable as well?
Definitely. Actually for me Windows7 crashed when usb-net is present.
And that as well.
Good catch!
Quoted 5 lines · Markus Armbruster
Quoted 3 lines · Gleb Natapov
Quoted 2 lines · Markus Armbruster
Gleb Natapov <[email protected]> writes:
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Properly check array bounds before accessing array element.
Impact?
Gapping security hole for those unfortunate enough to use usb-net?
Doesn't that bit of information belong in the commit message.
Some people prefer not to put such information into commit message.
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Apply to stable as well?
Definitely. Actually for me Windows7 crashed when usb-net is present.
And that as well.
Good catch!
--
Gleb.
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Gleb Natapov
Quoted 4 lines · Markus Armbruster
Quoted 1 line · Gleb Natapov
Properly check array bounds before accessing array element.
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Impact?
Gapping security hole for those unfortunate enough to use usb-net?
Doesn't that bit of information belong in the commit message.
Some people prefer not to put such information into commit message.
Correct, but does "some people" include the QEMU maintainers? Anthony?
[...]
Quoted 18 lines · Markus Armbruster
Quoted 15 lines · Gleb Natapov
Quoted 13 lines · Markus Armbruster
Quoted 10 lines · Gleb Natapov
Quoted 8 lines · Markus Armbruster
Quoted 2 lines · Gleb Natapov
Properly check array bounds before accessing array element.
Impact?
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Gapping security hole for those unfortunate enough to use usb-net?
Doesn't that bit of information belong in the commit message.
Some people prefer not to put such information into commit message.
Correct, but does "some people" include the QEMU maintainers? Anthony?
I don't have a strong opinion either way. If there's a CVE, I'd prefer the CVE number was prominent in the commit log but other than that, I'd leave it to the author's discretion.
Regards,
Anthony Liguori
Quoted 4 lines
[...]
Quoted 13 lines · Anthony Liguori
Quoted 12 lines · Markus Armbruster
Quoted 10 lines · Gleb Natapov
Quoted 9 lines · Markus Armbruster
Quoted 7 lines · Gleb Natapov
Quoted 5 lines · Markus Armbruster
Quoted 1 line · Gleb Natapov
Properly check array bounds before accessing array element.
Impact?
Gapping security hole for those unfortunate enough to use usb-net?
Quoted 9 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
Doesn't that bit of information belong in the commit message.
Some people prefer not to put such information into commit message.
Correct, but does "some people" include the QEMU maintainers? Anthony?
I don't have a strong opinion either way. If there's a CVE, I'd prefer the CVE number was prominent in the commit log but other than that, I'd leave it to the author's discretion.
No CVE. Please apply as is.
--
Gleb.
Anthony Liguori
AppliedQuoted 4 lines · Gleb Natapov
Properly check array bounds before accessing array element.
Signed-off-by Gleb Natapov<[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 18 lines
hw/usb-net.c +1
-2@@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,break ;default : -if (usb_net_stringtable[value&0xff ]) { +if (ARRAY_SIZE (usb_net_stringtable)> (value&0xff )) { ret =set_usb_string (data, usb_net_stringtable[value&0xff ]);break ; --Gleb.