qemu-patch-raspberry4/ui
Stefan Weil 23bfe28fff vnc: Fix stack corruption and other bitmap related bugs
Commit bc2429b917 introduced
a severe bug (stack corruption).

bitmap_clear was called with a wrong argument
which caused out-of-bound writes to the local variable width_mask.

This bug was detected with QEMU running on windows.
It also occurs with wine:

*** stack smashing detected ***:  terminated
wine: Unhandled illegal instruction at address 0x6115c7 (thread 0009), starting debugger...

The bug is not windows specific!

Instead of fixing the wrong parameter value, bitmap_clear(), bitmap_set
and width_mask were removed, and bitmap_intersect() was replaced by
!bitmap_empty(). The new operation is much shorter and equivalent to
the old operations.

The declarations of the dirty bitmaps in vnc.h were also wrong for 64 bit
hosts because of a rounding effect: for these hosts, VNC_MAX_WIDTH is no
longer a multiple of (16 * BITS_PER_LONG), so the rounded value of
VNC_DIRTY_WORDS was too small.

Fix both declarations by using the macro which is designed for this
purpose.

Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Gerhard Wiesinger <lists@wiesinger.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-10 16:12:25 -06:00
..
cocoa.m
curses.c
curses_keys.h
d3des.c
d3des.h
keymaps.c
keymaps.h
qemu-spice.h
sdl.c
sdl_keysym.h
sdl_zoom.c
sdl_zoom.h
sdl_zoom_template.h
spice-core.c
spice-display.c
spice-display.h
spice-input.c
vnc-auth-sasl.c
vnc-auth-sasl.h
vnc-auth-vencrypt.c
vnc-auth-vencrypt.h
vnc-enc-hextile-template.h
vnc-enc-hextile.c
vnc-enc-tight.c ui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not defined 2011-02-24 11:25:38 -06:00
vnc-enc-tight.h
vnc-enc-zlib.c
vnc-enc-zrle-template.c vnc: Add ZRLE and ZYWRLE encodings. 2011-02-23 16:28:28 -06:00
vnc-enc-zrle.c vnc: fix uint8_t comparisons with negative values 2011-02-23 16:28:28 -06:00
vnc-enc-zrle.h vnc: Add ZRLE and ZYWRLE encodings. 2011-02-23 16:28:28 -06:00
vnc-enc-zywrle-template.c vnc: Add ZRLE and ZYWRLE encodings. 2011-02-23 16:28:28 -06:00
vnc-enc-zywrle.h vnc: Add ZRLE and ZYWRLE encodings. 2011-02-23 16:28:28 -06:00
vnc-jobs-async.c vnc: fix a memory leak in threaded vnc server 2011-02-25 16:04:43 -06:00
vnc-jobs-sync.c
vnc-jobs.h
vnc-palette.c vnc: palette: and fill and color calls. 2011-02-23 16:28:28 -06:00
vnc-palette.h vnc: palette: and fill and color calls. 2011-02-23 16:28:28 -06:00
vnc-tls.c
vnc-tls.h
vnc.c vnc: Fix stack corruption and other bitmap related bugs 2011-03-10 16:12:25 -06:00
vnc.h vnc: Fix stack corruption and other bitmap related bugs 2011-03-10 16:12:25 -06:00
vnc_keysym.h
x_keymap.c
x_keymap.h