From: Laura Abbott <labbott@fedoraproject.org>
To: Antti Palosaari <crope@iki.fi>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Laura Abbott <labbott@fedoraproject.org>,
Olli Salonen <olli.salonen@iki.fi>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Stuart Auchterlonie <sauchter@redhat.com>,
stable@kernel.org
Subject: [PATCH 1/2] si2168: Bounds check firmware
Date: Tue, 29 Sep 2015 17:10:09 -0700 [thread overview]
Message-ID: <1443571810-5627-1-git-send-email-labbott@fedoraproject.org> (raw)
When reading the firmware and sending commands, the length must
be bounds checked to avoid overrunning the size of the command
buffer and smashing the stack if the firmware is not in the expected
format:
si2168 11-0064: found a 'Silicon Labs Si2168-B40'
si2168 11-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
si2168 11-0064: firmware download failed -95
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ffffffffa085708f
Add the proper check.
Cc: stable@kernel.org
Reported-by: Stuart Auchterlonie <sauchter@redhat.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
---
drivers/media/dvb-frontends/si2168.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 81788c5..821a8f4 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -502,6 +502,10 @@ static int si2168_init(struct dvb_frontend *fe)
/* firmware is in the new format */
for (remaining = fw->size; remaining > 0; remaining -= 17) {
len = fw->data[fw->size - remaining];
+ if (len > SI2168_ARGLEN) {
+ ret = -EINVAL;
+ break;
+ }
memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
cmd.wlen = len;
cmd.rlen = 1;
--
2.4.3
next reply other threads:[~2015-09-30 0:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 0:10 Laura Abbott [this message]
2015-09-30 0:10 ` [PATCH 2/2] si2157: " Laura Abbott
2015-10-05 22:24 ` Olli Salonen
2015-10-05 22:28 ` Laura Abbott
2015-10-05 22:33 ` [PATCHv2] " Laura Abbott
2015-10-08 10:40 ` Olli Salonen
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=1443571810-5627-1-git-send-email-labbott@fedoraproject.org \
--to=labbott@fedoraproject.org \
--cc=crope@iki.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=olli.salonen@iki.fi \
--cc=sauchter@redhat.com \
--cc=stable@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
all inboxes | Powered by JetHome®