Guenter Roeck 3202b2628b hw/usb/imx: Fix out of bounds access in imx_usbphy_read()
The i.MX USB Phy driver does not check register ranges, resulting in out of
bounds accesses if an attempt is made to access non-existing PHY registers.
Add range check and conditionally report bad accesses to fix the problem.

While at it, also conditionally log attempted writes to non-existing or
read-only registers.

Reported-by: Qiang Liu <cyruscyliu@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Qiang Liu <cyruscyliu@gmail.com>
Message-id: 20230316234926.208874-1-linux@roeck-us.net
Link: https://gitlab.com/qemu-project/qemu/-/issues/1408
Fixes: 0701a5efa015 ("hw/usb: Add basic i.MX USB Phy support")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-03-21 13:19:07 +00:00
..
2023-03-09 10:23:05 +00:00
2023-03-20 12:43:50 +01:00
2023-03-13 22:57:39 +04:00
2023-03-20 12:43:50 +01:00
2023-03-20 12:43:50 +01:00
2023-03-10 14:31:37 +00:00
2023-03-20 12:43:50 +01:00
2023-03-10 14:31:37 +00:00
2023-03-09 10:22:50 +00:00
2023-03-10 15:35:38 +08:00
2023-03-11 17:17:18 +00:00
2023-03-09 16:54:51 +00:00
2023-03-20 12:43:50 +01:00
2023-03-20 12:43:50 +01:00
2023-03-20 12:43:50 +01:00
2023-03-20 12:43:50 +01:00