qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [RFC PATCH] qemu-keymap: properly check return from xkb_keymap_mod_get_index
Date: Tue, 20 Jun 2023 16:37:28 +0100	[thread overview]
Message-ID: <87bkhai1p4.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA9jWuxVVb-+rbv4dEF+0_P1+5z7Z6HQajGv5Jg3yje11g@mail.gmail.com>


Peter Maydell <peter.maydell@linaro.org> writes:

> On Tue, 20 Jun 2023 at 16:04, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> We can return XKB_MOD_INVALID which rightly gets flagged by sanitisers
>> as an overly wide shift attempt.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  qemu-keymap.c | 24 ++++++++++++++++--------
>>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> Looking at the code that works with the mask values
> we are getting here, I think this ought to work
> (if there's no AltGr modifier then the 0 mask means
> the key state will be the same in normal and with the
> altgr mask supplied, which we already check for).
> Did you eyeball the output, though?
>
> Also, which keymap runs into this? Is it every keymap
> for some new version of the xkb data (which would imply
> that the problem is that the AltGr modifier has changed
> name), or is it only one specific keymap that happens
> to have no AltGr key?

ar maybe? it only got flagged in clang-system once fedora was updated (I
assume with better sanitizers):

  [2773/3696] Generating pc-bios/keymaps/ar with a custom command
  FAILED: pc-bios/keymaps/ar 
  /builds/stsquad/qemu/build/qemu-keymap -f pc-bios/keymaps/ar -l ar
  ../qemu-keymap.c:223:16: runtime error: shift exponent 4294967295 is too large for 32-bit type 'int'
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../qemu-keymap.c:223:16 in 
  [2774/3696] Generating pc-bios/edk2-x86_64-code.fd with a custom command (wrapped by meson to capture output)
  [2775/3696] Generating pc-bios/edk2-x86_64-secure-code.fd with a custom command (wrapped by meson to capture output)
  ninja: build stopped: subcommand failed.
  make: *** [Makefile:153: run-ninja] Error 1

https://gitlab.com/stsquad/qemu/-/jobs/4500683186#L3957

>
> thanks
> -- PMM


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2023-06-20 15:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 15:03 [RFC PATCH] qemu-keymap: properly check return from xkb_keymap_mod_get_index Alex Bennée
2023-06-20 15:16 ` Peter Maydell
2023-06-20 15:37   ` Alex Bennée [this message]
2023-06-20 15:42     ` Peter Maydell
2023-06-20 15:55     ` Richard Henderson
2023-06-20 16:10       ` Peter Maydell

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=87bkhai1p4.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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).