From patchwork Tue Oct 15 18:00:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Roskin X-Patchwork-Id: 3050731 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8E110BF924 for ; Wed, 16 Oct 2013 07:06:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C65020250 for ; Wed, 16 Oct 2013 07:06:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5B1FF200DC for ; Wed, 16 Oct 2013 07:06:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43373E789C for ; Wed, 16 Oct 2013 00:06:10 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from c60.cesmail.net (c60.cesmail.net [216.154.195.49]) by gabe.freedesktop.org (Postfix) with ESMTP id A71FEE6266 for ; Tue, 15 Oct 2013 11:00:55 -0700 (PDT) Received: from unknown (HELO smtprelay1.cesmail.net) ([192.168.1.111]) by c60.cesmail.net with ESMTP; 15 Oct 2013 14:00:55 -0400 Received: from IRBT4585 (206.83.81.178.ptr.us.xo.net [206.83.81.178]) by smtprelay1.cesmail.net (Postfix) with ESMTPSA id 410A834C5D; Tue, 15 Oct 2013 14:02:03 -0400 (EDT) Date: Tue, 15 Oct 2013 14:00:50 -0400 From: Pavel Roskin To: Chris Wilson Subject: Re: i915 driver fails on i686 userspace + x86_64 kernel Message-ID: <20131015140050.0496aedd@IRBT4585> In-Reply-To: <20131015152350.GH29463@nuc-i3427.alporthouse.com> References: <20131011223725.azyntmy4mc4wsgsg-cebfxv@webmail.spamcop.net> <20131012204437.GK8349@nuc-i3427.alporthouse.com> <20131013004010.53zcuugudc4g4s4o-cebfxv@webmail.spamcop.net> <20131013140004.GB6816@nuc-i3427.alporthouse.com> <20131015111224.3bc5eae7@IRBT4585> <20131015152350.GH29463@nuc-i3427.alporthouse.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 X-Mailman-Approved-At: Tue, 15 Oct 2013 18:50:40 -0700 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Chris, It's almost certainly stack corruption. This "patch" fixes X for me. The first DRM_IOCTL_MODE_GETCONNECTOR in sna_output_init() must be overwriting the implied memory bounds. diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 28151ab..dac834f 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2588,6 +2588,7 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) struct sna *sna = to_sna(scrn); xf86OutputPtr output; struct drm_mode_get_connector conn; + int enc_protect[16]; struct drm_mode_get_encoder enc; struct drm_mode_modeinfo dummy; struct sna_output *sna_output; @@ -2600,6 +2601,7 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) VG_CLEAR(conn); VG_CLEAR(enc); + &enc_protect; conn.connector_id = mode->kmode->connectors[num]; conn.count_props = 0;