From: Al Viro <viro@ftp.linux.org.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH] more get_property() fallout
Date: Sat, 23 Sep 2006 20:57:10 +0100 [thread overview]
Message-ID: <20060923195710.GM29920@ftp.linux.org.uk> (raw)
In-Reply-To: <20060923172135.GL29920@ftp.linux.org.uk>
On Sat, Sep 23, 2006 at 06:21:35PM +0100, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> drivers/video/riva/fbdev.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
> index 61a4665..4acde4f 100644
> --- a/drivers/video/riva/fbdev.c
> +++ b/drivers/video/riva/fbdev.c
> @@ -1826,7 +1826,7 @@ static int __devinit riva_get_EDID_OF(st
> {
> struct riva_par *par = info->par;
> struct device_node *dp;
> - unsigned char *pedid = NULL;
> + const unsigned char *pedid = NULL;
Ho-hum... Actually, that looks like a genuine bug. Look:
rivafb_probe():
riva_get_EDID(info, pd);
riva_get_edidinfo(info);
riva_get_EDID() -> riva_get_EDID_OF() ->
pedid = get_property(dp, propnames[i], NULL);
if (pedid != NULL) {
par->EDID = pedid;
NVTRACE("LCD found.\n");
return 1;
}
then in
riva_get_edidinfo():
struct riva_par *par = info->par;
fb_edid_to_monspecs(par->EDID, &info->monspecs);
fb_edid_to_monspecs() -> edid_checksum() -> fix_edid() -> modifies the string.
What's worse, fb_edid_to_monspecs() appears to assume that the string it
got is long enough. So... what the hell is going on there? I'd probably
did kmalloc() and copy that sucker there, making sure that it _is_ long
enough for fbmon.c while we are at it. Other suggestions?
parent reply other threads:[~2006-09-23 19:57 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20060923172135.GL29920@ftp.linux.org.uk>]
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=20060923195710.GM29920@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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).