From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
virtualization <virtualization@lists.linux-foundation.org>
Subject: [PATCH 3/3] lguest: fix obscure but nasty cow bug
Date: Sat, 05 May 2007 01:00:31 +1000 [thread overview]
Message-ID: <1178290831.23670.120.camel@localhost.localdomain> (raw)
In-Reply-To: <1178290730.23670.117.camel@localhost.localdomain>
Nasty bug where the host is the first to write a MAP_PRIVATE page: the
guest still references the old one and won't see the write. This can
happen with just the wrong data layouts for the initial setup
hypercall (the other places in the code are always written
guest-first).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
drivers/lguest/hypercalls.c | 6 ++++++
1 file changed, 6 insertions(+)
===================================================================
--- a/drivers/lguest/hypercalls.c
+++ b/drivers/lguest/hypercalls.c
@@ -144,6 +144,12 @@ static void initialize(struct lguest *lg
/* We reserve the top pgd entry. */
put_user(4U*1024*1024, &lg->lguest_data->reserve_mem);
put_user(lg->guestid, &lg->lguest_data->guestid);
+
+ /* This is the one case where the above accesses might have
+ * been the first write to a Guest page. This may have caused
+ * a copy-on-write fault, but the Guest might be referring to
+ * the old (read-only) page. */
+ guest_pagetable_clear_all(lg);
}
/* Even if we go out to userspace and come back, we don't want to do
prev parent reply other threads:[~2007-05-04 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-04 14:57 [PATCH 1/3] Documentation and example updates Rusty Russell
2007-05-04 14:58 ` [PATCH 2/3] lguest: remove put_user etc warnings, add bloat Rusty Russell
2007-05-04 15:00 ` Rusty Russell [this message]
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=1178290831.23670.120.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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
all inboxes | Powered by JetHome®