clean: remove buildinfo/changes
[pve-qemu-kvm.git] / debian / patches / extra / 0001-display-cirrus-ignore-source-pitch-value-as-needed-i.patch
blob2b24cddeaa40d33da0811534f15bacd84a918873
1 From f5dc8e6b503fda1ed87c0f4f53c6d2c76a584872 Mon Sep 17 00:00:00 2001
2 From: Bruce Rogers <brogers@suse.com>
3 Date: Mon, 9 Jan 2017 13:35:20 -0700
4 Subject: [PATCH 1/5] display: cirrus: ignore source pitch value as needed in
5 blit_is_unsafe
7 Commit 4299b90 added a check which is too broad, given that the source
8 pitch value is not required to be initialized for solid fill operations.
9 This patch refines the blit_is_unsafe() check to ignore source pitch in
10 that case. After applying the above commit as a security patch, we
11 noticed the SLES 11 SP4 guest gui failed to initialize properly.
13 Signed-off-by: Bruce Rogers <brogers@suse.com>
14 Message-id: 20170109203520.5619-1-brogers@suse.com
15 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
16 ---
17 hw/display/cirrus_vga.c | 11 +++++++----
18 1 file changed, 7 insertions(+), 4 deletions(-)
20 diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
21 index bdb092e..379910d 100644
22 --- a/hw/display/cirrus_vga.c
23 +++ b/hw/display/cirrus_vga.c
24 @@ -294,7 +294,7 @@ static bool blit_region_is_unsafe(struct CirrusVGAState *s,
25 return false;
28 -static bool blit_is_unsafe(struct CirrusVGAState *s)
29 +static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only)
31 /* should be the case, see cirrus_bitblt_start */
32 assert(s->cirrus_blt_width > 0);
33 @@ -308,6 +308,9 @@ static bool blit_is_unsafe(struct CirrusVGAState *s)
34 s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
35 return true;
37 + if (dst_only) {
38 + return false;
39 + }
40 if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
41 s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
42 return true;
43 @@ -673,7 +676,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
45 dst = s->vga.vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
47 - if (blit_is_unsafe(s))
48 + if (blit_is_unsafe(s, false))
49 return 0;
51 (*s->cirrus_rop) (s, dst, src,
52 @@ -691,7 +694,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
54 cirrus_fill_t rop_func;
56 - if (blit_is_unsafe(s)) {
57 + if (blit_is_unsafe(s, true)) {
58 return 0;
60 rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
61 @@ -795,7 +798,7 @@ static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
63 static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
65 - if (blit_is_unsafe(s))
66 + if (blit_is_unsafe(s, false))
67 return 0;
69 return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.start_addr,
70 --
71 2.1.4