gdm greeter crashes because of incorrect XKB variant handling

Bug #567574 reported by Sergey V. Udaltsov
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdm (Ubuntu)
Triaged
Medium
Unassigned
Lucid
Won't Fix
Medium
Unassigned

Bug Description

There is a patch in ubuntu:
+From ca4d405b1087c30a1bd764937dbc0b66b0473032 Mon Sep 17 00:00:00 2001
+From: Martin Pitt <email address hidden>
+Date: Tue, 23 Mar 2010 12:47:59 +0100
+Subject: [PATCH 2/2] Keep multiple system keyboard layouts for session
This patch contains one serious bug:
++ config->layouts = g_new0 (char *, g_strv_length (initial_config->layouts) + 2);
++ config->variants = g_new0 (char *, g_strv_length (initial_config->variants) + 2);
In case you have 2 layouts and variants are not specified (I got that scenario), you will allocate 4 and 2 elements correspondingly. This is clearly wrong - because later you'll assign 3 variants. Then gdm-greeter crashes inside xklavier (memory corruption).

The correct code should have
 config->variants = g_new0 (char *, g_strv_length (initial_config->layouts) + 2);

This is gdm crasher, so please fix it ASAP.

affects: ubuntu → gdm (Ubuntu)
Changed in gdm (Ubuntu Lucid):
importance: Undecided → Medium
status: New → Triaged
Changed in gdm (Ubuntu Lucid):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

I was actually aware of this inconsistency back then, but I never managed to get a situation where the variants list had a different length than the layouts lists -- how can this be reproduced?

Revision history for this message
Sergey V. Udaltsov (sergey-udaltsov) wrote :

Martin, somehow I managed to trigger the issue by playing with /etc/default/console-setup. Perhaps something like
XKBLAYOUT="us,ru"
XKBVARIANT=""

Martin Pitt (pitti)
Changed in gdm (Ubuntu Lucid):
assignee: Martin Pitt (pitti) → nobody
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in gdm (Ubuntu Lucid):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.