From patchwork Mon Jun 15 13:55:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 187939 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp2768409ilo; Mon, 15 Jun 2020 06:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/xSjAZfuoTXPRETDFYVgF8rCseyOuau5ItcZ8Bgw8r3M1MmdHfAzvbVmkQ7Zg5IicQXIf X-Received: by 2002:a05:6402:7c3:: with SMTP id u3mr23916627edy.253.1592229395586; Mon, 15 Jun 2020 06:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592229395; cv=none; d=google.com; s=arc-20160816; b=JCVITtek/e0tFrBg689au/VFdv2WanafTm2sEnRFGwCAp0T4jz6hTXx/RTRIy/I41n wRkiCIcESxmrHA7bsjS7n9KKwMMVnu0YBTeUWc+EvR7i0SwqYK1y+OInI30sIeUBIBkH 2mLJr5gW8rRXDNpd4YkXgF/2JW89OVwqeCbyXsVBRfKJsRYjNJRLw5ezAmUNsF9hXZBS 1shhdBqoGsruR0nngA2FHRIL39maSpKBXtHo8tia+em4zzf3JPhYpuzNzoPyWRwv8PRc r3nPvRJWXGqZlTWa0/1vKHCzWjDcHUXGRyi9u4RHNtsOTMBp0/xHS7wYh7yCTND9RR6+ jueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=+BfvoZ+77dTAo4L/XNf+TiVonlXEEViAwZrs/5d7U9U=; b=QSQeil274RyIVor5VLkbnWECtoBaI62KZuEavRlb61vJZZBe6d9fzfRatSTXrLDRK0 2byvpoAH15N6QaNUjYUjYdDV/Cp8oIQab3emv+x7ZCcQluKTiUtDGLdw/Vm2kIzTZx6D wFekR20zqGs1xTixj4hS1uAcCi9CiRlEXJ5F1R3nTl9NECRSZxr094glRyxg+7A7T0u4 CgfSfevwWBO4ILz9BeXWTFlXN4bFavfTclVBRTCGMxFGJvk2yRMzFXZDJ9NzcVRwSljb jWcef6vCwMBkx2hyrZVY1ojZr+fvXKqhUS6QonBYKclIi7YSLxMuu9paD5/fc0AQuTJw lrhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vplh0Fj9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si9408601eju.21.2020.06.15.06.56.35; Mon, 15 Jun 2020 06:56:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vplh0Fj9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729977AbgFON4e (ORCPT + 1 other); Mon, 15 Jun 2020 09:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729973AbgFON4a (ORCPT ); Mon, 15 Jun 2020 09:56:30 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE994C061A0E for ; Mon, 15 Jun 2020 06:56:28 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id 35so1507750ple.0 for ; Mon, 15 Jun 2020 06:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+BfvoZ+77dTAo4L/XNf+TiVonlXEEViAwZrs/5d7U9U=; b=vplh0Fj9/eSjlcLM1uoaEHsnubxkfYZJQTNBNwkrq469Vg8oUjYF+ExpyWU8sd7dd2 tu0PGAqL6qcINmBHnDVyQ36ihZLF+SSVIKjMIBGkAuq4wqViV2XX5wTl0MR/pNqN8vG8 al5a1MDzOAECR74HCCZ1mGHac9BHtNf+VAaOCxp1il1dTV76bP3kxPZE3WayuJ3Kz0Qs 5QEhfbvSs+KzWvj11Rj8s1Y8Nx3394hru2UVIsGXLlcyPmVC8qzWkzlMImHRAw0Y7IpH Ca/eCkdU4xiK9lPNFvYWrBSR4DCk4CqoByR3ISrODiT9CdYos8pLKcblYqUMvWGxR04m H9JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+BfvoZ+77dTAo4L/XNf+TiVonlXEEViAwZrs/5d7U9U=; b=Y/Nx0oKSag9bPJ0IrjsWx4dOWTwqbegdOoIXtdNBsgaBljqFqg7V78ctvdFSisl1zx i7A+Aerko8o7Wt1e6Sw+6tKAQekLNBgErOBjG5s/Q8GOksWwvirvbHX7kqybj3xSX61/ knfEPFYNtDBruYgbDcQYIdBXlm3XFhOH+LAOqN/yuKlRY6tIxRsBq3GagsYO3OKJgHrQ Uz7zPF/nTYva+gpHjZsA987TACmD4u96hKKD/FMtX7wK4PsDp4YBrtRm1NUfbGpQlvJ4 hdEm6hdeGFWg5gTdLO+aK3mxua22ZQma737/l3VVIGeOh113NAoyneuqWDlUHBrTUIeQ Oe+w== X-Gm-Message-State: AOAM533oCf6j9nkUFRrRUjnVD7brdQm0ppKQVZOq/7n90KrmCkfcES0H YzmbMmzhgEB80uRKsjY9MJx2sQ== X-Received: by 2002:a17:902:8b88:: with SMTP id ay8mr22252506plb.235.1592229388518; Mon, 15 Jun 2020 06:56:28 -0700 (PDT) Received: from localhost.localdomain ([45.135.186.20]) by smtp.gmail.com with ESMTPSA id h20sm13751691pfo.105.2020.06.15.06.56.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2020 06:56:27 -0700 (PDT) From: Zhangfei Gao To: Greg Kroah-Hartman , Arnd Bergmann , Herbert Xu , jean-philippe , kenneth-lee-2012@foxmail.com, Wangzhou Cc: linux-accelerators@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, Zhangfei Gao Subject: [PATCH] uacce: remove uacce_vma_fault Date: Mon, 15 Jun 2020 21:55:57 +0800 Message-Id: <1592229357-1904-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix NULL pointer error if removing uacce's parent module during app's running. SIGBUS is already reported by do_page_fault, so uacce_vma_fault is not needed. If providing vma_fault, vmf->page has to be filled as well, required by __do_fault. Reported-by: Jean-Philippe Brucker Signed-off-by: Zhangfei Gao --- drivers/misc/uacce/uacce.c | 9 --------- 1 file changed, 9 deletions(-) -- 2.7.4 Reviewed-by: Jean-Philippe Brucker diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 107028e..aa91f69 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -179,14 +179,6 @@ static int uacce_fops_release(struct inode *inode, struct file *filep) return 0; } -static vm_fault_t uacce_vma_fault(struct vm_fault *vmf) -{ - if (vmf->flags & (FAULT_FLAG_MKWRITE | FAULT_FLAG_WRITE)) - return VM_FAULT_SIGBUS; - - return 0; -} - static void uacce_vma_close(struct vm_area_struct *vma) { struct uacce_queue *q = vma->vm_private_data; @@ -199,7 +191,6 @@ static void uacce_vma_close(struct vm_area_struct *vma) } static const struct vm_operations_struct uacce_vm_ops = { - .fault = uacce_vma_fault, .close = uacce_vma_close, };