From: Samuel Ortiz <samuel@sortiz.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Samuel Ortiz <samuel@sortiz.org>,
stable@kernel.org
Subject: [PATCH net-next 5/5] irda: Fix heap memory corruption in iriap.c
Date: Mon, 11 Oct 2010 02:25:02 +0200 [thread overview]
Message-ID: <37f9fc452d138dfc4da2ee1ce5ae85094efc3606.1286756123.git.sameo@linux.intel.com> (raw)
In-Reply-To: <cover.1286756123.git.sameo@linux.intel.com>
In-Reply-To: <cover.1286756123.git.sameo@linux.intel.com>
While parsing the GetValuebyClass command frame, we could potentially write
passed the skb->data pointer.
Cc: stable@kernel.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
---
net/irda/iriap.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index fce364c..5b743bd 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -502,7 +502,8 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
IRDA_DEBUG(4, "%s(), strlen=%d\n", __func__, value_len);
/* Make sure the string is null-terminated */
- fp[n+value_len] = 0x00;
+ if (n + value_len < skb->len)
+ fp[n + value_len] = 0x00;
IRDA_DEBUG(4, "Got string %s\n", fp+n);
/* Will truncate to IAS_MAX_STRING bytes */
--
1.7.1
next prev parent reply other threads:[~2010-10-11 0:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-11 0:24 [GIT PULL net-next-2.6] IrDA 2.6.37 updates Samuel Ortiz
2010-10-11 0:24 ` [PATCH net-next 1/5] irda: Remove BKL instances from af_irda.c Samuel Ortiz
2010-10-11 0:24 ` [PATCH net-next 2/5] irda: Remove BKL instances from irnet Samuel Ortiz
2010-10-11 0:25 ` [PATCH net-next 3/5] irda: Test index before read in stir421x_patch_device() Samuel Ortiz
2010-10-11 0:25 ` [PATCH net-next 4/5] irda: Fix parameter extraction stack overflow Samuel Ortiz
2010-10-11 0:25 ` Samuel Ortiz [this message]
2010-10-11 3:57 ` [GIT PULL net-next-2.6] IrDA 2.6.37 updates David 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=37f9fc452d138dfc4da2ee1ce5ae85094efc3606.1286756123.git.sameo@linux.intel.com \
--to=samuel@sortiz.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stable@kernel.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).