From: Sasha Levin <levinsasha928@gmail.com>
To: davem@davemloft.net, ericvh@gmail.com,
aneesh.kumar@linux.vnet.ibm.com, jvrao@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH] 9p: BUG before corrupting memory
Date: Mon, 28 May 2012 18:00:45 +0200 [thread overview]
Message-ID: <1338220845-25082-1-git-send-email-levinsasha928@gmail.com> (raw)
The BUG_ON() in pack_sg_list() would get triggered only one time after we've
corrupted some memory by sg_set_buf() into an invalid sg buffer.
I'm still working on figuring out why I manage to trigger that bug...
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
net/9p/trans_virtio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 5af18d1..2fd7305 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -192,10 +192,10 @@ static int pack_sg_list(struct scatterlist *sg, int start,
s = rest_of_page(data);
if (s > count)
s = count;
+ BUG_ON(index >= limit);
sg_set_buf(&sg[index++], data, s);
count -= s;
data += s;
- BUG_ON(index > limit);
}
return index-start;
--
1.7.8.6
reply other threads:[~2012-05-28 15:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1338220845-25082-1-git-send-email-levinsasha928@gmail.com \
--to=levinsasha928@gmail.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=ericvh@gmail.com \
--cc=jvrao@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.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).