linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Cc: Pavel Machek <pavel@denx.de>,
	stable@vger.kernel.org,
	kernel list <linux-kernel@vger.kernel.org>,
	daniel@iogearbox.net, john.fastabend@gmail.com, ast@kernel.org
Subject: Re: CVE-2021-3600 aka bpf: Fix 32 bit src register truncation on div/mod
Date: Tue, 31 Aug 2021 15:30:53 +0200	[thread overview]
Message-ID: <20210831133053.GA32426@duo.ucw.cz> (raw)
In-Reply-To: <YS0lqmZg5Lq0scVv@mussarela>

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

Hi!

> > So this explains "mov32 w0, w0" is problematic, and fixes the bug by
> > replacing it with jmp32. Unfortunately, I can't do that in 4.19; plus
> > I don't really see how the bug is solved -- we avoided adding mov32
> > sequence that triggers the problem, but the problematic sequence could
> > still be produced by the userspace, no?
> > 
> > Does adjust_scalar_min_max_vals still need fixing?
> > 
> > Do you have any hints how to solve this in 4.19?

> I have just sent the fixes for 4.14. I sent fixes for 4.19 last Friday.
> 
> The problem here is that the verifier assumes the source register has a given
> value, but the fixups change that value to something else when it is truncated.
> 
> The fixups run after the verifier, so a similar sequence produced by userspace
> will be correctly verified, so no fixes are necessary on adjust_scalar_min_max
> for this specific issue. The fixed-up code is not verified again.

Thanks, understood.

> The challenge in providing those fixes to 4.14 and 4.19 is the absence of JMP32
> in those kernels. So, AX was taken as a temporary, so it would still work on
> JITs.

Yes, I got that far. I have seen the patches for 4.19 and 4.14, and
they should fix my problems. Thanks a lot for them.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

      reply	other threads:[~2021-08-31 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 10:23 CVE-2021-3600 aka bpf: Fix 32 bit src register truncation on div/mod Pavel Machek
2021-08-26 11:06 ` Thadeu Lima de Souza Cascardo
2021-08-30 18:38 ` Thadeu Lima de Souza Cascardo
2021-08-31 13:30   ` Pavel Machek [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=20210831133053.GA32426@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=ast@kernel.org \
    --cc=cascardo@canonical.com \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).