From: Markus Armbruster <armbru@redhat.com>
To: Pat Campbell <plc@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Fix PVFB backend to validate frontend's frame buffer description
Date: Thu, 15 May 2008 09:40:57 +0200 [thread overview]
Message-ID: <87abisauba.fsf@pike.pond.sub.org> (raw)
In-Reply-To: <482B29C9.6010007@novell.com> (Pat Campbell's message of "Wed\, 14 May 2008 12\:04\:57 -0600")
Pat Campbell <plc@novell.com> writes:
> Markus Armbruster wrote:
>> A buggy or malicious frontend can describe its shared framebuffer to
>> the backend in a way that makes the backend map an arbitrary amount of
>>
>>
> snipped out, see inline question below.
>>
>> diff -r 0a8fc1a62796 tools/ioemu/hw/xenfb.c
>> --- a/tools/ioemu/hw/xenfb.c Mon May 12 11:19:09 2008 +0100
>> +++ b/tools/ioemu/hw/xenfb.c Tue May 13 14:53:58 2008 +0200
>> @@ -28,8 +28,6 @@
[....]
>> +static int xenfb_configure_fb(struct xenfb *xenfb, size_t fb_len_lim,
>> + int width, int height, int depth,
>> + size_t fb_len, int offset, int row_stride)
>> +{
>> + size_t mfn_sz = sizeof(*((struct xenfb_page *)0)->pd);
>> + size_t pd_len = sizeof(((struct xenfb_page *)0)->pd) / mfn_sz;
>> + size_t fb_pages = pd_len * XC_PAGE_SIZE / mfn_sz;
>> + size_t fb_len_max = fb_pages * XC_PAGE_SIZE;
>> + int max_width, max_height;
>> +
>> + if (fb_len_lim > fb_len_max) {
>> + fprintf(stderr,
>> + "FB: fb size limit %zu exceeds %zu, corrected\n",
>> + fb_len_lim, fb_len_max);
>> + fb_len_lim = fb_len_max;
>> + }
>> + if (fb_len > fb_len_lim) {
>> + fprintf(stderr,
>> + "FB: frontend fb size %zu limited to %zu\n",
>> + fb_len, fb_len_lim);
>>
> Do we need to set fb_len to fb_len_lim here?
> fb_len = fb_len_lim;
Yes, we do! Good catch, thank you. I have no idea how that got lost.
I'll post a patch.
[...]
next prev parent reply other threads:[~2008-05-15 7:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 14:00 Fix PVFB backend to validate frontend's frame buffer description Markus Armbruster
2008-05-14 18:04 ` Pat Campbell
2008-05-15 7:40 ` Markus Armbruster [this message]
2008-05-15 7:53 ` [PATCH] ioemu: Fix PVFB backend to limit frame buffer size Markus Armbruster
2008-05-19 13:06 ` [PATCH] ioemu: Fix interpretation of missing or zero vfb videoram Markus Armbruster
2008-05-19 12:02 ` Fix PVFB backend to validate frontend's frame buffer description Yosuke Iwamatsu
2008-05-19 12:45 ` Markus Armbruster
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=87abisauba.fsf@pike.pond.sub.org \
--to=armbru@redhat.com \
--cc=plc@novell.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.