netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: davem@redhat.com
Cc: netdev@oss.sgi.com, shemminger@osdl.org
Subject: [PATCH 1/4] ax25 check error on memcpy_fromiovec (resend)
Date: Fri, 16 Jan 2004 14:25:02 -0800	[thread overview]
Message-ID: <20040116142502.B19034@osdlab.pdx.osdl.net> (raw)

Check the return value on memcpy_fromiovec().

 net/ax25/af_ax25.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

===== net/ax25/af_ax25.c 1.36 vs edited =====
--- 1.36/net/ax25/af_ax25.c	Fri Jan  9 01:53:04 2004
+++ edited/net/ax25/af_ax25.c	Fri Jan 16 14:13:54 2004
@@ -1526,7 +1526,12 @@
 	SOCK_DEBUG(sk, "AX.25: Appending user data\n");
 
 	/* User data follows immediately after the AX.25 data */
-	memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
+	if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
+		err = -EFAULT;
+		kfree_skb(skb);
+		goto out;
+	}
+
 	skb->nh.raw = skb->data;
 
 	/* Add the PID if one is not supplied by the user in the skb */

             reply	other threads:[~2004-01-16 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-16 22:25 Chris Wright [this message]
2004-01-16 22:26 ` [PATCH 2/4] irda check error on memcpy_fromiovec (resend) Chris Wright
2004-01-16 22:27   ` [PATCH 3/4] netrom " Chris Wright
2004-01-16 22:28     ` [PATCH 4/4] rose " Chris Wright
2004-01-20  5:15       ` David S. Miller

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=20040116142502.B19034@osdlab.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.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).