Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758155Ab1FJV7W (ORCPT ); Fri, 10 Jun 2011 17:59:22 -0400 Received: from mail209.messagelabs.com ([216.82.255.3]:3077 "EHLO mail209.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754736Ab1FJV7U (ORCPT ); Fri, 10 Jun 2011 17:59:20 -0400 X-VirusChecked: Checked X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-15.tower-209.messagelabs.com!1307743158!7566437!2 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [216.166.12.99] From: H Hartley Sweeten To: Linux Kernel Subject: [PATCH] ext3/ioctl.c: quite sparse warnings about different address spaces Date: Fri, 10 Jun 2011 14:59:05 -0700 User-Agent: KMail/1.9.9 CC: , , , MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201106101459.06129.hartleys@visionengravers.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 37 The 'from' argument for copy_from_user and the 'to' argument for copy_to_user should both be tagged as __user address space. Signed-off-by: H Hartley Sweeten Cc: Jan Kara Cc: Andrew Morton Cc: Andreas Dilger --- diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c index f4090bd..c7f4394 100644 --- a/fs/ext3/ioctl.c +++ b/fs/ext3/ioctl.c @@ -285,7 +285,7 @@ group_add_out: if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (copy_from_user(&range, (struct fstrim_range *)arg, + if (copy_from_user(&range, (struct fstrim_range __user *)arg, sizeof(range))) return -EFAULT; @@ -293,7 +293,7 @@ group_add_out: if (ret < 0) return ret; - if (copy_to_user((struct fstrim_range *)arg, &range, + if (copy_to_user((struct fstrim_range __user *)arg, &range, sizeof(range))) return -EFAULT; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/