Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp899677imu; Tue, 11 Dec 2018 09:15:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/XaHsXhlvP824dEFIdFA1bQ8Pf0jHp80Q2NTEBUyyr3Y2c/zUGmFC3xk9DEhfPX8vlVmHYX X-Received: by 2002:a63:df13:: with SMTP id u19mr15404229pgg.294.1544548544140; Tue, 11 Dec 2018 09:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548544; cv=none; d=google.com; s=arc-20160816; b=xPx0YNt31h5RvkET0Knw3kdp05gFloxK5NW7LUUfuirudEl4LkwbpWKZo+BumJic8c wM5K0DXbl0eONaESSoRf8TZZANtmS9XP4EaCASRNuXN7fj6H6YDEV3pL8eL9epGr9+Di yQoriSCYnOQrqQ13jFCTsQ3H0Lo0k8E3Am2Ve51d9Ad1t5o91OkF+qZnGmwpGbuhcvUK xAlk5st2FVk7aMrgh0xFyIuOA2/19t8AFy7pg0ZkiKZtoh0lEooJS3w/UenG48HmMzhI odwDicXPXUq1upmlDgOuwHDgv3dV2lhE5NpAfmFKdqBhry2NcZjjCcRS2TRbBJdi+xvp A5AQ== 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=AAzM00xr9Y4JB6IDwM/694a56EzG0eXCUFSm/V2nVlc=; b=NOIYdoBXzhAbgmBsGdxZEzkHba2QgZbNmKpigjSghj1Sq0b00UDAmZEJ2gdPf+75UH moOiCkXelNUI6rB0jhOuHcGQEGImxXtZSnZvzaiqi8QGZqE5gHilM+cTM1xig9vtJLkA twWFWRj+lGQWRk0ez78bmwdCjFLe1K7uI+dL0opGO6bSm94eYxJStTQGNAlxUk1ws/Q7 kWUB3ucdbotIyj5PHlhc+TZGKh3XKksCjjG8QccVsrEZqNrEZJSVgkMc2mrYuj6MPEm1 JnEuTt6VqI+y+LGDlzsnuz8VDjKmSLUU7FSHPpUx9Ir9YYbNkxj5T9ik3UVsrmBkeMQf wgQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="yutq/nN3"; 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 z123si11369644pfb.104.2018.12.11.09.15.29; Tue, 11 Dec 2018 09:15:44 -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="yutq/nN3"; 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 S1727327AbeLKPsa (ORCPT + 99 others); Tue, 11 Dec 2018 10:48:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:36824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbeLKPs0 (ORCPT ); Tue, 11 Dec 2018 10:48:26 -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 B4BE020989; Tue, 11 Dec 2018 15:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543306; bh=nib+OCMqLU9Y9ubf/P5H4YHB2/SUHWvOqNy4nEN5AbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yutq/nN3SX5awXkr2sK5mQVdAb8lT31Da03zJb1z9CN72Mu+fsFyPP5zMsviYd1U0 2MDxqjivXahLKfZC4Mzam/etvZhey0xn+/3uV9L2ZYPHONy8sZ+E68dgVZHuptMcwS eRTWYfQU//hpKLDdehmVqbagcXM28Jm1aoxwcDQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ashok Raj , Jacob Pan , Sohil Mehta , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 4.4 57/91] iommu/vt-d: Fix NULL pointer dereference in prq_event_thread() Date: Tue, 11 Dec 2018 16:41:16 +0100 Message-Id: <20181211151610.702484733@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 19ed3e2dd8549c1a34914e8dad01b64e7837645a ] When handling page request without pasid event, go to "no_pasid" branch instead of "bad_req". Otherwise, a NULL pointer deference will happen there. Cc: Ashok Raj Cc: Jacob Pan Cc: Sohil Mehta Signed-off-by: Lu Baolu Fixes: a222a7f0bb6c9 'iommu/vt-d: Implement page request handling' Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel-svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index 10068a481e22..cbde03e509c1 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -558,7 +558,7 @@ static irqreturn_t prq_event_thread(int irq, void *d) pr_err("%s: Page request without PASID: %08llx %08llx\n", iommu->name, ((unsigned long long *)req)[0], ((unsigned long long *)req)[1]); - goto bad_req; + goto no_pasid; } if (!svm || svm->pasid != req->pasid) { -- 2.19.1