netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roland Dreier <roland@topspin.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org,
	openib-general@openib.org
Subject: Re: [PATCH][v5][0/24] Latest IB patch queue
Date: Tue, 28 Dec 2004 11:48:13 -0800	[thread overview]
Message-ID: <52pt0unr0i.fsf@topspin.com> (raw)
In-Reply-To: <20041227225417.3ac7a0a6.davem@davemloft.net> (David S. Miller's message of "Mon, 27 Dec 2004 22:54:17 -0800")

    David> W00t :-) All applied, thanks Roland.

    David> I'll run it through some build tests then toss it upstream.

Very cool, thanks a lot.  Let me know if you see any build failures --
I test on about 6 or 7 different archs/configs but the bug gods always
seem to hide problems from me.

Speaking of build failures, one of my test builds is cross-compiling
for sparc64 with gcc 3.4.2, which adds __attribute__((warn_unused_result))
to copy_to_user() et al.  The -Werror in the arch/sparc64 means the
build fails with

    linux-2.6.10/arch/sparc64/kernel/sys_sparc32.c:1686: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

Of course binfmt_elf.c and compat_ioctl.c still have issues but those
probably get more visibility...

Thanks,
  Roland


Check copy_to_user() return value in sys_sparc32.c and sys_sunos32.c.

Signed-off-by: Roland Dreier <roland@topspin.com>

Index: linux-2.6.10/arch/sparc64/kernel/sys_sparc32.c
===================================================================
--- linux-2.6.10.orig/arch/sparc64/kernel/sys_sparc32.c	2004-12-24 13:35:00.000000000 -0800
+++ linux-2.6.10/arch/sparc64/kernel/sys_sparc32.c	2004-12-28 11:46:00.190457463 -0800
@@ -1683,7 +1683,8 @@
 			    put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
 				error = -EFAULT;
 		}
-		copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
+		if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
+			error = -EFAULT;
 	}
 	return error;
 #endif
Index: linux-2.6.10/arch/sparc64/kernel/sys_sunos32.c
===================================================================
--- linux-2.6.10.orig/arch/sparc64/kernel/sys_sunos32.c	2004-12-24 13:35:00.000000000 -0800
+++ linux-2.6.10/arch/sparc64/kernel/sys_sunos32.c	2004-12-28 11:47:03.954923634 -0800
@@ -291,7 +291,8 @@
 	put_user(ino, &dirent->d_ino);
 	put_user(namlen, &dirent->d_namlen);
 	put_user(reclen, &dirent->d_reclen);
-	copy_to_user(dirent->d_name, name, namlen);
+	if (copy_to_user(dirent->d_name, name, namlen))
+		return -EFAULT;
 	put_user(0, dirent->d_name + namlen);
 	dirent = (void __user *) dirent + reclen;
 	buf->curr = dirent;
@@ -371,7 +372,8 @@
 	put_user(ino, &dirent->d_ino);
 	put_user(namlen, &dirent->d_namlen);
 	put_user(reclen, &dirent->d_reclen);
-	copy_to_user(dirent->d_name, name, namlen);
+	if (copy_to_user(dirent->d_name, name, namlen))
+		return -EFAULT;
 	put_user(0, dirent->d_name + namlen);
 	dirent = (void __user *) dirent + reclen;
 	buf->curr = dirent;

  reply	other threads:[~2004-12-28 19:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-28  5:50 [PATCH][v5][0/24] Latest IB patch queue Roland Dreier
2004-12-28  5:50 ` [PATCH][v5][1/24] Add core InfiniBand support (public headers) Roland Dreier
2004-12-28  5:50   ` [PATCH][v5][2/24] Add core InfiniBand support Roland Dreier
2004-12-28  5:50     ` [PATCH][v5][3/24] Hook up drivers/infiniband Roland Dreier
2004-12-28  5:50       ` [PATCH][v5][4/24] Add InfiniBand MAD (management datagram) support (public headers) Roland Dreier
2004-12-28  5:50         ` [PATCH][v5][5/24] Add InfiniBand MAD (management datagram) support Roland Dreier
2004-12-28  5:50           ` [PATCH][v5][6/24] Add InfiniBand MAD (management datagram) support (private headers) Roland Dreier
2004-12-28  5:51             ` [PATCH][v5][7/24] Add InfiniBand MAD SMI support Roland Dreier
2004-12-28  5:51               ` [PATCH][v5][8/24] Add InfiniBand SA (Subnet Administration) query support Roland Dreier
2004-12-28  5:51                 ` [PATCH][v5][9/24] Add Mellanox HCA low-level driver Roland Dreier
2004-12-28  5:51                   ` [PATCH][v5][10/24] Add Mellanox HCA low-level driver (midlayer interface) Roland Dreier
2004-12-28  5:51                     ` [PATCH][v5][11/24] Add Mellanox HCA low-level driver (FW commands) Roland Dreier
2004-12-28  5:51                       ` [PATCH][v5][12/24] Add Mellanox HCA low-level driver (EQ) Roland Dreier
2004-12-28  5:51                         ` [PATCH][v5][13/24] Add Mellanox HCA low-level driver (initialization) Roland Dreier
2004-12-28  5:51                           ` [PATCH][v5][14/24] Add Mellanox HCA low-level driver (QP/CQ) Roland Dreier
2004-12-28  5:51                             ` [PATCH][v5][15/24] Add Mellanox HCA low-level driver (last bits) Roland Dreier
2004-12-28  5:51                               ` [PATCH][v5][16/24] Add Mellanox HCA low-level driver (MAD) Roland Dreier
2004-12-28  5:51                                 ` [PATCH][v5][17/24] IPoIB IPv4 multicast Roland Dreier
2004-12-28  5:51                                   ` [PATCH][v5][18/24] IPoIB IPv6 support Roland Dreier
2004-12-28  5:51                                     ` [PATCH][v5][19/24] Add IPoIB (IP-over-InfiniBand) driver Roland Dreier
2004-12-28  5:51                                       ` [PATCH][v5][20/24] Add IPoIB multicast & partition code Roland Dreier
2004-12-28  5:51                                         ` [PATCH][v5][21/24] Add InfiniBand userspace MAD support Roland Dreier
2004-12-28  5:51                                           ` [PATCH][v5][22/24] Document InfiniBand ioctl use Roland Dreier
2004-12-28  5:51                                             ` [PATCH][v5][23/24] Add InfiniBand Documentation files Roland Dreier
2004-12-28  5:51                                               ` [PATCH][v5][24/24] InfiniBand MAINTAINERS entry Roland Dreier
2004-12-28  6:54 ` [PATCH][v5][0/24] Latest IB patch queue David S. Miller
2004-12-28 19:48   ` Roland Dreier [this message]
2004-12-28 22:17     ` David S. Miller
2004-12-28 23:24       ` Roland Dreier
2004-12-29  1:28         ` Karen Shaeffer
2004-12-29  1:36           ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52pt0unr0i.fsf@topspin.com \
    --to=roland@topspin.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=openib-general@openib.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).