From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
To: Paolo Bonzini <pbonzini@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Qiang Ning <ningqiang1@huawei.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/net/can: sja1000 fix buff2frame_bas for dlc out of std CAN 8 bytes
Date: Thu, 29 Jul 2021 11:19:22 +0200 [thread overview]
Message-ID: <202107291119.33951.pisa@cmp.felk.cvut.cz> (raw)
In-Reply-To: <20210726162458.26197-1-pisa@cmp.felk.cvut.cz>
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
Hello everybody,
please, can somebody accept the fix for master?
It should be ideally applied even to stable
branches.
Or should I send request through some other form
then on the list?
Thanks,
Pavel
On Monday 26 of July 2021 18:24:58 Pavel Pisa wrote:
> Problem reported by openEuler fuzz-sig group.
>
> The buff2frame_bas function (hw\net\can\can_sja1000.c)
> infoleak(qemu5.x~qemu6.x) or stack-overflow(qemu 4.x).
>
> Reported-by: Qiang Ning <ningqiang1@huawei.com>
> Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
> ---
> hw/net/can/can_sja1000.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c
> index 42d2f99dfb..64e81bff58 100644
> --- a/hw/net/can/can_sja1000.c
> +++ b/hw/net/can/can_sja1000.c
> @@ -311,6 +311,10 @@ static void buff2frame_bas(const uint8_t *buff,
> qemu_can_frame *frame) }
> frame->can_dlc = buff[1] & 0x0f;
>
> + if (frame->can_dlc > 8) {
> + frame->can_dlc = 8;
> + }
> +
> for (i = 0; i < frame->can_dlc; i++) {
> frame->data[i] = buff[2 + i];
> }
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-07-29 9:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 16:24 [PATCH] hw/net/can: sja1000 fix buff2frame_bas for dlc out of std CAN 8 bytes Pavel Pisa
2021-07-29 9:19 ` Pavel Pisa [this message]
2021-07-29 10:03 ` [PATCH-for-6.1] " Philippe Mathieu-Daudé
2021-07-29 11:52 ` Pavel Pisa
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=202107291119.33951.pisa@cmp.felk.cvut.cz \
--to=pisa@cmp.felk.cvut.cz \
--cc=jasowang@redhat.com \
--cc=ningqiang1@huawei.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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).