Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp92508ybm; Thu, 28 May 2020 17:00:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJympDUN2kwkopTJqA5tANNDK3qpN9bYfzuip6vIgK2MVl40ZYeeJe6LfIsl3LwItxban7Qp X-Received: by 2002:a05:6402:a49:: with SMTP id bt9mr5003275edb.300.1590710445706; Thu, 28 May 2020 17:00:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590710445; cv=none; d=google.com; s=arc-20160816; b=XXNYO6p4+RhXxtXj9ROHarN7SrH7G5bZWV1UO8u5R2NtFM8Nz4le2qVywykVHLt2EL QlCj3yqhVoqeIEPAFq24Q+tXv5gomE9hVx5JrkxoLFCUSr8lw3YxtHJFuApAKYtYRbVe j9nIB6/aLaW3kTbQyIzIjwcb9RLTlbG8fBkrfMsQomn+0FFPMSCQ9oxF5KbdfNBpkTot pX9SWXM7d0wS6zpAgbSw+cu9I3xuyBZnEvCgiN+G1UehAZQHGlYeqF3tW7RDL3Oc22/s 0SxXsoQIX3PpLnXIeSNJuHle8bpMjQK7Efbzhu8i5PzBYni5nkeFJenu8w0BqfitckGK ul7g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=QJPd0+sPuJ8GwP8DXy4HsSQbMbtloZFg708PJ2facJI=; b=04NuruzL/JxAdHsGV7WiGJPIMTblZix+++Aq96H5D61LHVBsJNUKoM4eFuiX9Ezgz7 fP1RK84XvwwURLwLkq8ecYrxb6MhtZp7o+LvTBFE5A2HcvTS97kopHfXN9JFbtRoA3Ay bX0wZPhBa4gZX0r0Z2ma8q2gwOL24Mu3p5Z+meCDm1QELvCwRyIatxj14tXi4Sv2yNBK mYUDRqHW9Z6kkUsovdP2NC9mY6+pWsT3WqzRctK2R68wLhhGmsw/1qn2QsbrSr66mjiF e91NxAR8OU2umxPjTZefjd8GXzu4GvOZXIuFgILGVH2f5BXrfscmRFmkwhJ5OixMb7sD 4KvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si4876176ejv.83.2020.05.28.17.00.22; Thu, 28 May 2020 17:00:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437958AbgE1X6f (ORCPT + 99 others); Thu, 28 May 2020 19:58:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437807AbgE1X63 (ORCPT ); Thu, 28 May 2020 19:58:29 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1068CC08C5C6; Thu, 28 May 2020 16:58:29 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jeSPr-00HE7f-GV; Thu, 28 May 2020 23:58:27 +0000 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] firewire: switch ioctl_queue_iso to use of copy_from_user() Date: Fri, 29 May 2020 00:58:26 +0100 Message-Id: <20200528235827.4105826-1-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200528235752.GU23230@ZenIV.linux.org.uk> References: <20200528235752.GU23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro no point trying to do access_ok() for all those __copy_from_user() at once. Signed-off-by: Al Viro --- drivers/firewire/core-cdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 6e291d8f3a27..c7ea4f2d5ca6 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -1081,8 +1081,6 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg) return -EINVAL; p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(a->packets); - if (!access_ok(p, a->size)) - return -EFAULT; end = (void __user *)p + a->size; count = 0; @@ -1120,7 +1118,7 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg) &p->header[transmit_header_bytes / 4]; if (next > end) return -EINVAL; - if (__copy_from_user + if (copy_from_user (u.packet.header, p->header, transmit_header_bytes)) return -EFAULT; if (u.packet.skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT && -- 2.11.0