Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5588319imm; Tue, 12 Jun 2018 10:02:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJu1P56cqsqjaBktPbSdarfiWI9yHm8LGJdHunm2Cet4oJ9oBr6S6H+gep8abeQBPZZkO03 X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr1287948pld.29.1528822968388; Tue, 12 Jun 2018 10:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528822968; cv=none; d=google.com; s=arc-20160816; b=AtkK822ITyjW96OUBP/h+rAWt0UHJvy1StHfMnL/Rgi/a+MVZMJAqTxpgB44K8tXCn idCaHUYX8dgb+OlTN9BGnexCGDhUOhLOFdKlrG8CzRstfywx75UiZyTlHrNiRfApYRJh K9iIg3h4VWbCK4JEmn6xRh/Dnylz4TbREV9kWDYZ9pMZN/53msZICeH3viKiUUuUx76t YkCMScc0knIWiyI64nmh1d5VAOQ/XIG3daeGrRrBahCN3EuSZrKUbfiCsiLBWx38ijpr 0jvRnbsP3LPvLClJtut1VEsffIfrlp2FU+dqzYQKybuqfzAsKNBRSah5hozjPQndyF5F HrlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=RyU84ZFZrHrYeiDDnGyIWgiRQIYxk0mh/9QUSr7xJfA=; b=wYyR3woH9Wi1OcmbJWaAiJmgp0JrOYZiqWaBTVUyYx1JCdCkaUZlSxpnxQHRTbhuZy la1J1tiEt/I9l7Jj31Dxa5/0ZeJbLW/VrwAK5vB6DSkYtxN1EyQx4BoqoVt8LyNSyCyK LuFWew1zH54kQAfeTCf6hwbDUXtQLPaSi8L8HlXsZrOG5VmPZ3TD851eXFLE9zFsaMhp KpIplvUOzNHcvLufQeJVjZuQeHkCdJtCPGPHrmB+3pfk2rlalyL4U7UJ79j0uXqofvqy SbTu9ls1kTQr+LwHnIWej4oql9ahaOmJROy2euxv4+PgzLfdMYHY5406RWvzEs1WgFtt 1pww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wBW7cjBm; 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 a21-v6si499653pls.237.2018.06.12.10.02.33; Tue, 12 Jun 2018 10:02:48 -0700 (PDT) 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=wBW7cjBm; 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 S934650AbeFLRAF (ORCPT + 99 others); Tue, 12 Jun 2018 13:00:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:52862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935142AbeFLQxc (ORCPT ); Tue, 12 Jun 2018 12:53:32 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 4F021208B9; Tue, 12 Jun 2018 16:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528822411; bh=hGAXu7Ax8YZFOxKss6hLyBlYNn6p8xmt1Ac4qIJIIiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wBW7cjBml0BHguiDxPl4+ypa645n8Iqxzg6MS7QOeItgXc/ZCkieGb33WPnTFav3f idNXcCAYdqIuM1C0nZtm2u98A4S7J1/mRmP3W/5aGWKC7J6hLRHeq5uSnKkoQmYz5U 8mkAnFeH6zPrOX38IVi47zUwNiKM1u5nqFeylWTo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Airlie Subject: [PATCH 4.4 07/24] drm: set FMODE_UNSIGNED_OFFSET for drm files Date: Tue, 12 Jun 2018 18:51:51 +0200 Message-Id: <20180612164816.903425656@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612164816.587001852@linuxfoundation.org> References: <20180612164816.587001852@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Airlie commit 76ef6b28ea4f81c3d511866a9b31392caa833126 upstream. Since we have the ttm and gem vma managers using a subset of the file address space for objects, and these start at 0x100000000 they will overflow the new mmap checks. I've checked all the mmap routines I could see for any bad behaviour but overall most people use GEM/TTM VMA managers even the legacy drivers have a hashtable. Reported-and-Tested-by: Arthur Marsh (amarsh04 on #radeon) Fixes: be83bbf8068 (mmap: introduce sane default mmap limits) Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_fops.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -209,6 +209,7 @@ static int drm_open_helper(struct file * return -ENOMEM; filp->private_data = priv; + filp->f_mode |= FMODE_UNSIGNED_OFFSET; priv->filp = filp; priv->uid = current_euid(); priv->pid = get_pid(task_pid(current));