Re: [PATCH] apply: Avoid ambiguous pointer provenance for CHERI/Arm's Morello

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 05, 2022 at 01:23:10PM +0000, Jessica Clarke wrote:
> [...] In most cases this is clear, as normally at least one operand is
> provably a plain integer, but if both operands are uintptr_t and have
> no indication they're just plain integers then it is ambiguous, and
> the current implementation will arbitrarily, but deterministically,
> pick the left-hand side, due to empirical evidence that it is more
> likely to be correct.

Wouldn't a simpler, less invasive fix be to instead write the expression
so that the left-hand operand is a pointer? IOW, shouldn't the following
work (with no other changes):

    ent->util = (void *)((uintptr_t)what | ent->util);

?

(I dropped the explicit cast on the right-hand side, since ent->util is
already a uintptr_t, and the left-hand side has an explicit cast, so
there isn't any type promotion going on here).

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux