Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3500530imu; Mon, 7 Jan 2019 04:38:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN4xiooakj+dAOb7q2hEF/qrPV4tUvRLy5Tx+PydwfGdmM0hsjfkc/l4K29QGvslbjeJruGq X-Received: by 2002:a62:c185:: with SMTP id i127mr50745992pfg.43.1546864732366; Mon, 07 Jan 2019 04:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546864732; cv=none; d=google.com; s=arc-20160816; b=SCk71VjHj8pdkl4OMclzunG/CZEBH06mjJ5oirmca6xQObUa6qT/bs1G0Ba4AY6NTI zQMAn7yf/A4LFGk7DVmCWHYUO7xirKh5TCnJyhSq0j1jPGZ6D1hl/Xvp/AAHa3OXFlb2 y2Ut7V3sZU8ZxJoF7bkW31uMj0thaNMmznAZ06SzPYtj9QUv+oSAPnhHfP/uQEDV8iEM 6TlvmfRl6+q+bWkGVTTYvOLiGELzoylDsFXk634KuTdr9D8x7ICbGWotCZqwGlHuJ8cm xdlBEBqfq37nn8pgHRAa6lUWJ2aFS29Cz8mnBiqgtOk1Y1juVVNN11C4NNPe51kTpL9p uDGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dtd/M+4tVpG8Bk1sXZ8cniIGrwQ9TtzgiT5TT/pkOOc=; b=dOFOLRE9QvMi8wcbXTPSyhD2/R512ehxp0XNuU3ZYveCgl+YQEillCrt7Ud8FB7jLd MiZaW4IgOiMciLYPn6I6UXXew8DobN1A4TKQe+6I7zixgHAQe08gFeerH3a80Nn8dybl Eswp0yMAduqjBYISFnlHO7IRPrW3t4YgLQLFYeFSIR+TBoEyehAQpdxEZJkU+W3OU6f2 srBsWpwXJqWHRveSo8hgRZnNvD8XZfBCKBe9YYkLPgvog+D1U2az3m91vpnnQLfJVmd4 Y1jrNSUoj0UNPF3n8jURFYPop8OPVm6GxlJnt10IxJngdG6lhObJQxO8fyxnX8ZcoVVM 8lSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kSxpYG9l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si61732401pgh.18.2019.01.07.04.38.37; Mon, 07 Jan 2019 04:38:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kSxpYG9l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727641AbfAGMfw (ORCPT + 99 others); Mon, 7 Jan 2019 07:35:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:50056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbfAGMfs (ORCPT ); Mon, 7 Jan 2019 07:35:48 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A7F920859; Mon, 7 Jan 2019 12:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546864547; bh=RS8tg+uAKCeeByEsxj7tfJ6uRATizb0Pp4yl8uDWtOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kSxpYG9lkEdJ6yGWwlyPJJHk1UzIiZfMKwymsPiG9i1DTI8+meUEBGyogpZe39Mtk rNDvk6cpvQV0eAsEsQIcb0m6KFVSzJr+GbI+Q5P8iuWpBlJI3YxsoKONa3ey3/dMzH vwa/BVkuK+Oo93lf+aGvB5U99IeNVh2wxRVVJUBQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Wilson , Joonas Lahtinen , Linus Torvalds , stable@kernel.org Subject: [PATCH 4.20 046/145] i915: fix missing user_access_end() in page fault exception case Date: Mon, 7 Jan 2019 13:31:23 +0100 Message-Id: <20190107104443.433267336@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104437.308206189@linuxfoundation.org> References: <20190107104437.308206189@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Torvalds commit 0b2c8f8b6b0c7530e2866c95862546d0da2057b0 upstream. When commit fddcd00a49e9 ("drm/i915: Force the slow path after a user-write error") unified the error handling for various user access problems, it didn't do the user_access_end() that is needed for the unsafe_put_user() case. It's not a huge deal: a missed user_access_end() will only mean that SMAP protection isn't active afterwards, and for the error case we'll be returning to user mode soon enough anyway. But it's wrong, and adding the proper user_access_end() is trivial enough (and doing it for the other error cases where it isn't needed doesn't hurt). I noticed it while doing the same prep-work for changing user_access_begin() that precipitated the access_ok() changes in commit 96d4f267e40f ("Remove 'type' argument from access_ok() function"). Fixes: fddcd00a49e9 ("drm/i915: Force the slow path after a user-write error") Cc: Chris Wilson Cc: Joonas Lahtinen Cc: stable@kernel.org # v4.20 Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1605,6 +1605,7 @@ static int eb_copy_relocations(const str (char __user *)urelocs + copied, len)) { end_user: + user_access_end(); kvfree(relocs); err = -EFAULT; goto err;