From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com
Subject: [Qemu-devel] [PATCH 0/7] Fix tests for start+len address valid for guest
Date: Mon, 5 Apr 2010 10:30:12 -0700 [thread overview]
Message-ID: <cover.1270488612.git.rth@twiddle.net> (raw)
The first patch in the series fixes a major think-o in the sparc port.
The 64 and 32-bit constants were reversed. Fixing these are required
to avoid a build error in later patches.
For the actual problem, introduce a guest_start_len_valid macro similar
to the existing h2g_valid macro, where we compare the address range
against TARGET_VIRT_ADDR_SPACE_BITS (or ULONG_MAX, depending on the host).
Use this in 3 places in the linux-user memory handling functions, and
also in the generic page_check_range. In the later case, also remove
a mis-conception that I had that page_check_range was already bounds
checked -- these values come directly from a guest syscall and so can
contain any random errant values.
r~
Richard Henderson (7):
target-sparc: Fix TARGET_{PHYS,VIRT}_ADDR_SPACE_BITS.
Add guest_start_len_valid function.
linux-user: Use guest_start_len_valid in msync.
linux-user: Use guest_start_len_valid in mremap.
linux-user: Use guest_start_len_valid in mmap.
Fix zero-length write(2).
Use guest_start_len_valid in page_check_range.
cpu-all.h | 10 ++++++++
exec.c | 12 +++------
linux-user/mmap.c | 65 +++++++++++++++++++++++++++------------------------
target-sparc/cpu.h | 12 ++++----
4 files changed, 54 insertions(+), 45 deletions(-)
next reply other threads:[~2010-04-05 17:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 17:30 Richard Henderson [this message]
2010-03-29 17:54 ` [Qemu-devel] [PATCH 6/7] Fix zero-length write(2) Richard Henderson
2010-05-06 4:45 ` Aurelien Jarno
2010-03-30 18:11 ` [Qemu-devel] [PATCH 1/7] target-sparc: Fix TARGET_{PHYS, VIRT}_ADDR_SPACE_BITS Richard Henderson
2010-03-30 18:49 ` [Qemu-devel] [PATCH 3/7] linux-user: Use guest_start_len_valid in msync Richard Henderson
2010-03-30 18:52 ` [Qemu-devel] [PATCH 4/7] linux-user: Use guest_start_len_valid in mremap Richard Henderson
2010-03-30 18:53 ` [Qemu-devel] [PATCH 5/7] linux-user: Use guest_start_len_valid in mmap Richard Henderson
2010-03-30 19:32 ` [Qemu-devel] [PATCH 7/7] Use guest_start_len_valid in page_check_range Richard Henderson
2010-04-05 17:24 ` [Qemu-devel] [PATCH 2/7] Add guest_start_len_valid function Richard Henderson
2010-04-05 18:15 ` malc
2010-04-05 18:31 ` Richard Henderson
2010-04-05 18:41 ` malc
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=cover.1270488612.git.rth@twiddle.net \
--to=rth@twiddle.net \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.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).