From: Thomas Zimmermann <tzimmermann@suse.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
linux-fbdev@vger.kernel.org, Li Yi <liyi@loongson.cn>,
Helge Deller <deller@gmx.de>,
linux-kernel@vger.kernel.org, Sui Jingfeng <15330273260@189.cn>,
loongson-kernel@lists.loongnix.cn,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5] drm/fbdev-generic: prohibit potential out-of-bounds access
Date: Thu, 20 Apr 2023 14:59:17 +0200 [thread overview]
Message-ID: <3d455074-bd51-51a0-7692-a0b4ca961355@suse.de> (raw)
In-Reply-To: <CAMuHMdVGtvgcQuTR9bfMh1cM86TYXSByxJzW5eJtF9A0ZLRF3w@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1361 bytes --]
Hi
Am 20.04.23 um 14:25 schrieb Geert Uytterhoeven:
> Hi Thomas,
>
> On Thu, Apr 20, 2023 at 1:10 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Am 20.04.23 um 12:04 schrieb Sui Jingfeng:
>>> What will happen if the 'screen_size' is not page_size aligned and mmap
>>> will mapping in the granularity of pages ?
>>
>> You need to map at page granularity. If screen_size is not page-size
>> aligned, there's this trailing buffer that is accessible, but cannot be
>> displayed. But userspace has no direct way of knowing that, so let's
>> ignore that problem for now.
>
> Userspace can know, if fb_fix_screeninfo.smem_{start,len} match
> the actual offset and size.
Can you elaborate? How can userspace detect/compute the actually usable
space?
From grep'ing fbdev drivers, smem_len appears to be a multiple of the
pagesize. (?) screen_size is not exported and line_length in the fixed
portion. Or can line_length change between modes? In that case it should
be (yres_virtual * line_length), right?
Best regards
Thomas
>
> Gr{oetje,eeting}s,
>
> Geert
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2023-04-20 12:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 3:05 Sui Jingfeng
2023-04-20 7:04 ` Thomas Zimmermann
2023-04-20 7:07 ` Thomas Zimmermann
2023-04-20 10:04 ` Sui Jingfeng
2023-04-20 11:10 ` Thomas Zimmermann
2023-04-20 12:25 ` Geert Uytterhoeven
2023-04-20 12:59 ` Thomas Zimmermann [this message]
2023-04-20 14:21 ` Geert Uytterhoeven
2023-04-20 10:26 ` Sui Jingfeng
2023-04-20 9:04 ` Geert Uytterhoeven
2023-04-20 9:31 ` Sui Jingfeng
2023-04-20 10:09 ` Sui Jingfeng
2023-04-21 8:09 ` Thomas Zimmermann
2023-04-21 8:24 ` Sui Jingfeng
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=3d455074-bd51-51a0-7692-a0b4ca961355@suse.de \
--to=tzimmermann@suse.de \
--cc=15330273260@189.cn \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liyi@loongson.cn \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=lucas.demarchi@intel.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 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®