From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 93DA91381F3 for ; Tue, 13 Nov 2012 15:57:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1C6F321C059; Tue, 13 Nov 2012 15:57:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7162A21C057 for ; Tue, 13 Nov 2012 15:57:07 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 932F233D9F7 for ; Tue, 13 Nov 2012 15:57:06 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2265) id 5E58920C9F; Tue, 13 Nov 2012 15:57:05 +0000 (UTC) From: "Chi-Thanh Christopher Nguyen (chithanh)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, chithanh@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/xf86-input-synaptics/files: xf86-input-synaptics-1.6.2-reset-num_active_touches.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: xf86-input-synaptics-1.6.2-reset-num_active_touches.patch X-VCS-Directories: x11-drivers/xf86-input-synaptics/files X-VCS-Committer: chithanh X-VCS-Committer-Name: Chi-Thanh Christopher Nguyen Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20121113155705.5E58920C9F@flycatcher.gentoo.org> Date: Tue, 13 Nov 2012 15:57:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: db3e79e1-160f-465d-b492-a1b7dfbf7bc8 X-Archives-Hash: a22873bbe867d8b7cfba1cffd2bd9f0c chithanh 12/11/13 15:57:05 Added: xf86-input-synaptics-1.6.2-reset-num_active_touches.patch Log: Add patch to fix crash on xorg-server-1.12, bug #428084. (Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit) Revision Changes Path 1.1 x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.6.2-reset-num_active_touches.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.6.2-reset-num_active_touches.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.6.2-reset-num_active_touches.patch?rev=1.1&content-type=text/plain Index: xf86-input-synaptics-1.6.2-reset-num_active_touches.patch =================================================================== >From eae444eb1a85d2401501d29f9a6c654c046f806b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 30 Aug 2012 06:38:38 +0000 Subject: Reset num_active_touches on DeviceOff (#52496) When disabling the device, reset num_active_touches to zero. Otherwise, num_active_touches stays at the value it was on DeviceOff(). Future touches add to that value until the index may go past priv->open_slots[]. That causes spurious memory corruption on touch ends. And as of 55fc42e7c9b4948cadd4f98ef7b6a3b12e268e3e we ignore pre-existing touches anyway. Test-case: - place num_touches fingers on the touchpad - xinput disable - lift fingers - xinput enable - place finger on device, num_active_touches is now (num_touches + 1) X.Org Bug 52496 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas (cherry picked from commit a245d42f53096b1ae81e6702729f97ca508e5b5b) Conflicts: src/synaptics.c --- diff --git a/src/synaptics.c b/src/synaptics.c index cd9f936..a28e984 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1154,6 +1154,7 @@ SynapticsReset(SynapticsPrivate * priv) priv->prev_z = 0; priv->prevFingers = 0; #ifdef HAVE_MULTITOUCH + priv->num_active_touches = 0; memset(priv->open_slots, 0, priv->num_slots * sizeof(int)); #endif } @@ -3118,6 +3119,7 @@ UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw) if (hw->slot_state[i] == SLOTSTATE_OPEN) { priv->open_slots[priv->num_active_touches] = i; priv->num_active_touches++; + BUG_WARN(priv->num_active_touches > priv->num_slots); } else if (hw->slot_state[i] == SLOTSTATE_CLOSE) { Bool found = FALSE; -- cgit v0.9.0.2-2-gbebe