From patchwork Tue Sep 30 22:01:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 5008481 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8FCF09F327 for ; Tue, 30 Sep 2014 22:01:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7E4120165 for ; Tue, 30 Sep 2014 22:01:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E242E201FA for ; Tue, 30 Sep 2014 22:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753040AbaI3WBl (ORCPT ); Tue, 30 Sep 2014 18:01:41 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:54728 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754856AbaI3WAt (ORCPT ); Tue, 30 Sep 2014 18:00:49 -0400 Received: by mail-pd0-f178.google.com with SMTP id y10so5383591pdj.9 for ; Tue, 30 Sep 2014 15:00:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=d4D9UJkflCs0VH5Ui05TzvW/uzEP97TXnsajFGDEs+A=; b=ExZ7a4DLJAF1WapZ/t+Jg1CxCpbHrpKUy0LhJlrRptSkrxd8EG31mGvDPKXL0fMd7a Acu2DSlTLMq39TyWvEB2xx1m8gtTR/y/egAg+TbXROBuu9pfzyrox3HYS6o8cRvxKwxY uhQxp8QkvDoGxzeSTRRecAaPZVQMRHLigGFA61ij9acxoxQ7fKlKpBcsgFIMsHBDmPLf WMr4bGkNeH6NWrA9HN9KrhF6XRBEg6seRx5wREIP1KO3/AG09jAd4bpm93XkjdWa0Tjq FGgBWyMip1dZiOKc17iW89DrP4pD89/oEVEc6mOfCppky7k/4HIwlYWb51JcwP4pVdTL tJeQ== X-Gm-Message-State: ALoCoQmaN2jwWLP2553Yn11by5mW9A8BmR3VbPHEng/kbgWzCcAiE7hrug0SnbFiGD/3Qp5Oj6A7 X-Received: by 10.68.194.194 with SMTP id hy2mr26852936pbc.149.1412114448673; Tue, 30 Sep 2014 15:00:48 -0700 (PDT) Received: from molino.home.network (c-24-19-133-29.hsd1.wa.comcast.net. [24.19.133.29]) by mx.google.com with ESMTPSA id nz4sm16076560pdb.51.2014.09.30.15.00.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Sep 2014 15:00:48 -0700 (PDT) From: Omar Sandoval To: Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: David Sterba , Zach Brown Subject: [PATCH v2 2/3] btrfs: fix sparse address space warnings Date: Tue, 30 Sep 2014 15:01:41 -0700 Message-Id: <49ca3ccf1c2fd2091c6fbec1d14e393b95b0fff8.1412114127.git.osandov@osandov.com> X-Mailer: git-send-email 2.1.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-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Several casts of ioctl fields from userspace are missing the __user annotation. Signed-off-by: Omar Sandoval Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8a8e298..0f9a5a1 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2176,7 +2176,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 && @@ -4247,7 +4247,7 @@ 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, + ret = copy_to_user((void __user *)(unsigned long)ipa->fspath, (void *)(unsigned long)ipath->fspath, size); if (ret) { ret = -EFAULT; @@ -4322,7 +4322,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root, if (ret < 0) goto out; - ret = copy_to_user((void *)(unsigned long)loi->inodes, + ret = copy_to_user((void __user *)(unsigned long)loi->inodes, (void *)(unsigned long)inodes, size); if (ret) ret = -EFAULT;