From: Antti Palosaari <crope@iki.fi>
To: Jan Nikitenko <jan.nikitenko@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] zl10353 and qt1010: fix stack corruption bug
Date: Mon, 15 Jun 2009 22:01:03 +0300 [thread overview]
Message-ID: <4A369A6F.9010705@iki.fi> (raw)
In-Reply-To: <4A2F50E0.8030404@gmail.com>
Hei Jan,
On 06/10/2009 09:21 AM, Jan Nikitenko wrote:
> This patch fixes stack corruption bug present in dump_regs function of
> zl10353 and qt1010 drivers:
> the buffer buf is one byte smaller than required - there is 4 chars
> for address prefix, 16*3 chars for dump of 16 eeprom bytes per line
> and 1 byte for zero ending the string required, i.e. 53 bytes, but
> only 52 were provided.
> The one byte missing in stack based buffer buf can cause stack
> corruption possibly leading to kernel oops, as discovered originally
> with af9015 driver.
>
> Signed-off-by: Jan Nikitenko <jan.nikitenko@gmail.com>
>
> ---
>
> Antti Palosaari wrote:
> > On 06/10/2009 01:39 AM, Jan Nikitenko wrote:
> >> Solved with "[PATCH] af9015: fix stack corruption bug".
> >
> > This error leads to the zl10353.c and there it was copied to qt1010.c
> > and af9015.c.
> >
> Antti, thanks for pointing out that the same problem was also in
> zl10353.c and qt1010.c. Include your Sign-off-by, please.
I tried to test that patch (from patchwork) to ensure it is OK before
ack, but I found it does not apply for reason or other. It looks correct
for my eyes. Please check what's wrong and apply new patch.
[crope@localhost v4l-dvb]$ patch -p1 <
af9015-fix-stack-corruption-bug.patch
patching file linux/drivers/media/dvb/dvb-usb/af9015.c
[crope@localhost v4l-dvb]$ patch -p1 <
zl10353-and-qt1010-fix-stack-corruption-bug.patch
patching file linux/drivers/media/common/tuners/qt1010.c
Hunk #1 FAILED at 65.
1 out of 1 hunk FAILED -- saving rejects to file
linux/drivers/media/common/tuners/qt1010.c.rej
patching file linux/drivers/media/dvb/frontends/zl10353.c
Hunk #1 FAILED at 102.
1 out of 1 hunk FAILED -- saving rejects to file
linux/drivers/media/dvb/frontends/zl10353.c.rej
[crope@localhost v4l-dvb]$ hg diff
diff -r 148b4c93a728 linux/drivers/media/dvb/dvb-usb/af9015.c
--- a/linux/drivers/media/dvb/dvb-usb/af9015.c Mon Jun 15 14:15:33 2009
-0300
+++ b/linux/drivers/media/dvb/dvb-usb/af9015.c Mon Jun 15 21:55:55 2009
+0300
@@ -541,7 +541,7 @@
/* dump eeprom */
static int af9015_eeprom_dump(struct dvb_usb_device *d)
{
- char buf[52], buf2[4];
+ char buf[4+3*16+1], buf2[4];
u8 reg, val;
for (reg = 0; ; reg++) {
[crope@localhost v4l-dvb]$ hg head
changeset: 11978:148b4c93a728
tag: tip
parent: 11975:144d8d0cebc5
parent: 11977:8b416ba3ac89
user: Mauro Carvalho Chehab <mchehab@redhat.com>
date: Mon Jun 15 14:15:33 2009 -0300
summary: merge: http://www.linuxtv.org/hg/~dougsland/em28xx
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2009-06-15 19:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 7:52 AVerTV Volar Black HD: i2c oops in warm state on mips Jan Nikitenko
2009-06-05 8:55 ` Patrick Boettcher
2009-06-05 15:36 ` Antti Palosaari
2009-06-09 22:39 ` Jan Nikitenko
2009-06-10 0:11 ` Antti Palosaari
2009-06-10 6:21 ` [PATCH] zl10353 and qt1010: fix stack corruption bug Jan Nikitenko
2009-06-15 19:01 ` Antti Palosaari [this message]
2009-06-16 18:59 ` Mauro Carvalho Chehab
2009-06-17 11:58 ` Jan Nikitenko
2009-06-17 12:26 ` Matthias Schwarzott
2009-06-17 13:18 ` Mauro Carvalho Chehab
2009-06-18 11:11 ` [PATCH v2] " Jan Nikitenko
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=4A369A6F.9010705@iki.fi \
--to=crope@iki.fi \
--cc=jan.nikitenko@gmail.com \
--cc=linux-media@vger.kernel.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