From patchwork Wed Aug 23 06:46:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9916703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A5DA5603FF for ; Wed, 23 Aug 2017 06:46:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97D132858A for ; Wed, 23 Aug 2017 06:46:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CA0C2896B; Wed, 23 Aug 2017 06:46:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 304B92896C for ; Wed, 23 Aug 2017 06:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753411AbdHWGq3 (ORCPT ); Wed, 23 Aug 2017 02:46:29 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:32954 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753389AbdHWGqT (ORCPT ); Wed, 23 Aug 2017 02:46:19 -0400 Received: by mail-pg0-f48.google.com with SMTP id t3so4072703pgt.0 for ; Tue, 22 Aug 2017 23:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=qGbho3m5GnoE8bwcpYjBryhGo2QYnnVy/CM5udp1nK4=; b=1KdL//2MLFqvpg2Vxpjoxcx+UfZDQXonMh+IR1hrUuevon5o75TFrDDGOKqxaEN4z5 N8gDqw/tPBlB52IUeiYWg+feAjND8iLzfqoA1ONVyqwqaGsHAm1Iv2j5/c9N5W/RvmcH nOoVS0UF3d+vuy3pAM299+8H4zU+KVmgBjR+LOAV79r3/IH11N51+q0HON7KXj8r25RX mjkj67TEZoW5XyMq6e7NF6r25NtBsxw0NlGKAqQdmUJtEsz91394G8wgBwYmbV7NZKrE cSa0Tx/dhZj8m1SA0tOVujdH8IjekXEYvNFz4BBNeipy4TJUXhkgluOV8LLnJztq2sdw joVA== 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:in-reply-to :references:in-reply-to:references; bh=qGbho3m5GnoE8bwcpYjBryhGo2QYnnVy/CM5udp1nK4=; b=pKiG72hCbRN+zs83Ozh1Jq9p9ienJEB2zDoPYdOfX6BJQ7QrBPamL/xlvcahzxIvmy kcky5WfWKgemfuaA9iXaUAUBDvCqQ85t0/U0SknIVU5SPXavBB0t3cTl21EcUXmRnUOQ yc0rRPg9+RFDfZ0J9feFZsXbLp5+fRLIMrwcUrNkZDy6lVloxR24GcdLbdc6ZtZAM3SN ORWZZyPmufCWC3L6S6TmeNwu2cClhG7ymKH1Bv/OwbRMR2vw+2QlkuBUoS6fwlKRzKl8 qNvJgPZWxDtAKnDrtLvGj5tA4LZgDdaMqjs7607GWxYdCD46PeF+B1NY7g/gfMAHMVlV VSzw== X-Gm-Message-State: AHYfb5h1oJpD7APReBbV4gHo+utMqttM6eYBWT2Nsuo/DzQmcKKRYOUL hnIeSGx8GByDR62nqAL20Q== X-Received: by 10.99.120.203 with SMTP id t194mr1676060pgc.352.1503470778619; Tue, 22 Aug 2017 23:46:18 -0700 (PDT) Received: from localhost.localdomain ([2601:602:8801:8110:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id n184sm1194749pga.89.2017.08.22.23.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Aug 2017 23:46:18 -0700 (PDT) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 7/7] Btrfs: fix __user casting in ioctl.c Date: Tue, 22 Aug 2017 23:46:05 -0700 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval Signed-off-by: Omar Sandoval Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index cf71d0304671..7a7a82e0963c 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2210,7 +2210,7 @@ static noinline int btrfs_ioctl_tree_search_v2(struct file *file, inode = file_inode(file); ret = search_ioctl(inode, &args.key, &buf_size, - (char *)(&uarg->buf[0])); + (char __user *)(&uarg->buf[0])); if (ret == 0 && copy_to_user(&uarg->key, &args.key, sizeof(args.key))) ret = -EFAULT; else if (ret == -EOVERFLOW && @@ -4512,8 +4512,8 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg) ipath->fspath->val[i] = rel_ptr; } - ret = copy_to_user((void *)(unsigned long)ipa->fspath, - (void *)(unsigned long)ipath->fspath, size); + ret = copy_to_user((void __user *)(unsigned long)ipa->fspath, + ipath->fspath, size); if (ret) { ret = -EFAULT; goto out; @@ -4584,8 +4584,8 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info, if (ret < 0) goto out; - ret = copy_to_user((void *)(unsigned long)loi->inodes, - (void *)(unsigned long)inodes, size); + ret = copy_to_user((void __user *)(unsigned long)loi->inodes, inodes, + size); if (ret) ret = -EFAULT;