All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Daniil Tatianin <d-tatianin@yandex-team.ru>
Cc: ani@anisinha.ca, qemu-devel@nongnu.org, yc-core@yandex-team.ru,
	mst@redhat.com
Subject: Re: [PATCH v1] hw/smbios: verify header type for file before using it
Date: Tue, 4 Jan 2022 10:34:15 +0100	[thread overview]
Message-ID: <20220104103415.49b14493@redhat.com> (raw)
In-Reply-To: <20211129135211.1114466-1-d-tatianin@yandex-team.ru>

On Mon, 29 Nov 2021 16:52:11 +0300
Daniil Tatianin <d-tatianin@yandex-team.ru> wrote:

here should be more verbose description of the issue
preferably with a way to reproduce it.
and what/why patch does what it does.

> Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
> ---
>  hw/smbios/smbios.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
> index 7397e56737..c55f77368a 100644
> --- a/hw/smbios/smbios.c
> +++ b/hw/smbios/smbios.c
> @@ -1163,6 +1163,12 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
>              return;
>          }
>  
> +        if (header->type > SMBIOS_MAX_TYPE) {
> +            error_setg(errp,
> +                       "invalid header type %d!", header->type);

3.0 spec says that types over 127 are valid and for use by OEM/etc,
but QEMU doesn't support anything over 127 due to limited size of
have_fields_bitmap.
So I'd rephrase it as "unsupported header type"

> +            return;
> +        }
> +
>          if (test_bit(header->type, have_fields_bitmap)) {
>              error_setg(errp,
>                         "can't load type %d struct, fields already specified!",



      reply	other threads:[~2022-01-04  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 13:52 [PATCH v1] hw/smbios: verify header type for file before using it Daniil Tatianin
2022-01-04  9:34 ` Igor Mammedov [this message]

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=20220104103415.49b14493@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=d-tatianin@yandex-team.ru \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yc-core@yandex-team.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.