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
..
2021-11-02 15:55:14 +00:00
2022-06-14 10:34:36 +02:00
2021-01-22 14:51:35 +01:00
2022-01-13 10:22:37 +01:00
2022-01-13 10:22:37 +01:00
2022-11-08 11:13:48 +01:00
2022-10-31 20:37:58 +00:00
2022-11-08 11:13:48 +01:00
2022-11-08 11:13:48 +01:00
2022-11-08 11:13:48 +01:00
2022-06-14 10:34:36 +02:00
2021-02-17 14:29:12 +01:00
2021-05-12 18:20:25 +02:00
2021-03-15 17:00:58 +01:00