git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Taylor Blau <me@ttaylorr.com>
Date
Jan 6, 2022, 22:50 UTC
Message-ID
<YddySiBCOOYYKDmC@nand.local>
In-Reply-To
<20220105132310.6600-1-jrtc27@jrtc27.com>
On Wed, Jan 05, 2022 at 01:23:10PM +0000, Jessica Clarke wrote:
Show 6 quoted lines
> [...] 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

Previous: Jessica ClarkeNext: Jessica Clarke
Message 4 of 14 in “apply: Avoid ambiguous pointer provenance for CHERI/Arm's Morello”
  1. apply: Avoid ambiguous pointer provenance for CHERI/Arm's MorelloJessica Clarke, Jan 5, 2022
  2. Konstantin KhomoutovJan 5, 2022
  3. Jessica ClarkeJan 5, 2022
  4. Taylor BlauJan 6, 2022
  5. Jessica ClarkeJan 6, 2022
  6. Junio C HamanoJan 6, 2022
  7. Jessica ClarkeJan 6, 2022
  8. Junio C HamanoJan 6, 2022
  9. René ScharfeJan 7, 2022
  10. Jessica ClarkeJan 7, 2022
  11. Junio C HamanoJan 7, 2022
  12. René ScharfeJan 8, 2022
  13. Junio C HamanoJan 8, 2022
  14. Junio C HamanoJan 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.