[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 7/9] sm501: Do not allow guest to set invalid format
From: |
BALATON Zoltan |
Subject: |
[PATCH v3 7/9] sm501: Do not allow guest to set invalid format |
Date: |
Sat, 20 Jun 2020 22:56:28 +0200 |
Prevent guest setting invalid format value that might trip checks in
sm501_2d_operation().
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/display/sm501.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 6349f31e64..7e4c042d52 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1503,6 +1503,9 @@ static void sm501_2d_engine_write(void *opaque, hwaddr
addr,
s->twoD_background = value;
break;
case SM501_2D_STRETCH:
+ if (((value >> 20) & 3) == 3) {
+ value &= ~BIT(20);
+ }
s->twoD_stretch = value;
break;
case SM501_2D_COLOR_COMPARE:
--
2.21.3
- [PATCH v3 0/9] More sm501 fixes and optimisations, BALATON Zoltan, 2020/06/20
- [PATCH v3 5/9] sm501: Optimise 1 pixel 2d ops, BALATON Zoltan, 2020/06/20
- [PATCH v3 4/9] sm501: Introduce variable for commonly used value for better readability, BALATON Zoltan, 2020/06/20
- [PATCH v3 6/9] sm501: Use stn_he_p/ldn_he_p instead of switch/case, BALATON Zoltan, 2020/06/20
- [PATCH v3 1/9] sm501: Fix bounds checks, BALATON Zoltan, 2020/06/20
- [PATCH v3 7/9] sm501: Do not allow guest to set invalid format,
BALATON Zoltan <=
- [PATCH v3 3/9] sm501: Ignore no-op blits, BALATON Zoltan, 2020/06/20
- [PATCH v3 9/9] sm501: Fix and optimize overlap check, BALATON Zoltan, 2020/06/20
- [PATCH v3 2/9] sm501: Drop unneded variable, BALATON Zoltan, 2020/06/20
- [PATCH v3 8/9] sm501: Convert debug printfs to traces, BALATON Zoltan, 2020/06/20