Re: [GIT PULL] arm64 fixes for -rc5

From: Linus Torvalds
Date: Fri Aug 06 2021 - 14:40:56 EST


On Fri, Aug 6, 2021 at 6:53 AM Will Deacon <will@xxxxxxxxxx> wrote:
>
> Please pull these arm64 fixes for -rc5. It's all pretty minor but the
> main fix is sorting out how we deal with return values from 32-bit system
> calls as audit expects error codes to be sign-extended to 64 bits

I've pulled this, but that change looks _really_ odd.

First you seem to intentionally *zero-extend* the error value when you
actually set it in pt_regs, and then you sign-extend them when reading
them.

So the rules seem entirely arbitrary: oen place says "upper 32 bits
need to be clear" and another place says "upper 32 bits need to be
sign-extended".

Why this insanity? Why not make the rule be that the upper 32 bits are
always just sign-extended?

Linus