From patchwork Wed Sep 8 13:48:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 64132 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47FF5B6EF7 for ; Wed, 8 Sep 2010 23:49:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754052Ab0IHNtO (ORCPT ); Wed, 8 Sep 2010 09:49:14 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:52357 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994Ab0IHNtM (ORCPT ); Wed, 8 Sep 2010 09:49:12 -0400 Received: by pxi10 with SMTP id 10so22438pxi.19 for ; Wed, 08 Sep 2010 06:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=0c6uxqTuObzcDSF50JuZBtajVfVs55hHD6Wbdbp/BDs=; b=SWRW4Hh/cns1owh4lLuWZTaSJRUmRef11eYT+CbesRBn6LJz7amk5c2WvASJSJZxXn RUtMVMTHqGY7PhgUxM4+mxrotxFm7gkK3OXi+hoWJSq9kJ0Wh61vXf84Xv/PFefeCrgU LoXvEuYiz9DrQMuTcmoMkL4YCRcigcfjtjifU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=QF0Hkp24aZFhM3it3GbnRjcaT0z2GecF+KGEWN6Hzbu5wsdCl5UShjgcEU1sV1UPW/ l7jJZY8lNOA9vFNiuQbJbAAtr67yHydsHHYBRn/7w8UJTAkKjF1mYUOhi9EwtF0y5cuJ C37fuEts2ptPYWMSrVxDE/cciuQUFUsnCjM8Q= Received: by 10.114.135.11 with SMTP id i11mr4043wad.2.1283953738923; Wed, 08 Sep 2010 06:48:58 -0700 (PDT) Received: from localhost.localdomain ([211.202.140.224]) by mx.google.com with ESMTPS id c24sm94018wam.7.2010.09.08.06.48.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Sep 2010 06:48:57 -0700 (PDT) From: Namhyung Kim To: "David S. Miller" , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] net/core: remove address space warnings on verify_iovec() Date: Wed, 8 Sep 2010 22:48:47 +0900 Message-Id: <1283953728-15302-1-git-send-email-namhyung@gmail.com> X-Mailer: git-send-email 1.7.2.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org move_addr_to_kernel() and copy_from_user() requires their argument as __user pointer but were missing proper markups. Add it. This removes following warnings from sparse. net/core/iovec.c:44:52: warning: incorrect type in argument 1 (different address spaces) net/core/iovec.c:44:52: expected void [noderef] *uaddr net/core/iovec.c:44:52: got void *msg_name net/core/iovec.c:55:34: warning: incorrect type in argument 2 (different address spaces) net/core/iovec.c:55:34: expected void const [noderef] *from net/core/iovec.c:55:34: got struct iovec *msg_iov Signed-off-by: Namhyung Kim --- net/core/iovec.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/core/iovec.c b/net/core/iovec.c index 1cd98df..f4657c2 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c @@ -41,7 +41,9 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, if (m->msg_namelen) { if (mode == VERIFY_READ) { - err = move_addr_to_kernel(m->msg_name, m->msg_namelen, + void __user *namep; + namep = (void __user __force *) m->msg_name; + err = move_addr_to_kernel(namep, m->msg_namelen, address); if (err < 0) return err; @@ -52,7 +54,7 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, } size = m->msg_iovlen * sizeof(struct iovec); - if (copy_from_user(iov, m->msg_iov, size)) + if (copy_from_user(iov, (void __user __force *) m->msg_iov, size)) return -EFAULT; m->msg_iov = iov;