After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711065 - xrandr: Prevent guint32 overflow
xrandr: Prevent guint32 overflow
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: xrandr
3.8.x
Other All
: Normal normal
: ---
Assigned To: Debarshi Ray
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-29 11:23 UTC by Bastien Nocera
Modified: 2013-10-30 10:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xrandr: Prevent guint32 overflow (3.12 KB, patch)
2013-10-29 11:23 UTC, Bastien Nocera
reviewed Details | Review

Description Bastien Nocera 2013-10-29 11:23:30 UTC
.
Comment 1 Bastien Nocera 2013-10-29 11:23:38 UTC
Created attachment 258430 [details] [review]
xrandr: Prevent guint32 overflow

Passing "9223372036854775807" (G_MAXINT64) as the timestamp will
overflow as the timestamp is cast to a guint32 internally. Clamp
that value instead to avoid g-s-d crashing.

See https://bugzilla.redhat.com/show_bug.cgi?id=1022562
Comment 2 Rui Matos 2013-10-29 17:24:34 UTC
Review of attachment 258430 [details] [review]:

Looking at the code paths I don't see how this can crash the process. The timestamp always ends up in a call to XRRSetCrtcConfig in gnome_rr_crtc_set_config_with_time().

Indeed I couldn't make F19's g-s-d crash either with G_MAXINT64 or G_MININT64 for all the four DBus methods on this interface.

BTW, this RH bug isn't public.

In any case, the patch isn't wrong.

::: plugins/xrandr/gsd-xrandr-manager.c
@@ +2203,3 @@
                 g_variant_get (parameters, "(xx)", &parent_window_id, &timestamp);
                 if (gsd_xrandr_manager_2_apply_configuration (manager, parent_window_id,
+                                                              clamp_timestamp(timestamp), &error) == FALSE) {

in all 4 lines: space between method name and '('
Comment 3 Bastien Nocera 2013-10-30 10:59:21 UTC
I've pushed this.