Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754498Ab3CKUxA (ORCPT ); Mon, 11 Mar 2013 16:53:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:58258 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754043Ab3CKUw7 (ORCPT ); Mon, 11 Mar 2013 16:52:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,825,1355126400"; d="scan'208";a="300274032" Date: Mon, 11 Mar 2013 20:52:51 +0000 From: Chris Wilson To: Kees Cook Cc: linux-kernel@vger.kernel.org, Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/i915: bounds check execbuffer relocations Message-ID: <20130311205251.GB31324@cantiga.alporthouse.com> Mail-Followup-To: Chris Wilson , Kees Cook , linux-kernel@vger.kernel.org, Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org References: <20130311192716.GA18244@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130311192716.GA18244@www.outflux.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 719 Lines: 17 On Mon, Mar 11, 2013 at 12:27:16PM -0700, Kees Cook wrote: > It is possible to wrap the counter used to allocate the buffer for > relocation copies. This could lead to heap writing overflows. Seems a sensible check, just in the wrong location. You need to do the checking upfront in validate_exec_list() so that the error condition is always hit and that the limits are applied consistently to all execbuffers. -Chris -- Chris Wilson, Intel Open Source Technology Centre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/