[clang] [PAC][clang] Add new features to pauthtest ABI (PR #113150)

2025-09-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. I believe these are fine. The options are already here, this does not add new ones, it just forwards the existing ones to the pauth on ELF logic (the other existing uses were in Darwin part of the driver) https://github.com/llvm/llvm-project/p

[clang] [clang][PAC] Enable the PAC dynamic_cast to final class optimization (PR #152601)

2025-08-25 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Needs rebase just in case https://github.com/llvm/llvm-project/pull/152601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl commented: Looks great to me! Couple of minor things. Tagging @atrosinenko @kbeyls @smithp35 for visibility https://github.com/llvm/llvm-project/pull/152596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-07 Thread Anton Korobeynikov via cfe-commits
@@ -500,7 +708,884 @@ type. Implementations are not required to make all bits of the result equally significant; in particular, some implementations are known to not leave meaningful data in the low bits. +Standard ``__ptrauth`` qualifiers +^

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-07 Thread Anton Korobeynikov via cfe-commits
@@ -163,14 +163,20 @@ a cryptographic signature, other implementations may be possible. See data is simply a pepper added to the hash, not an encryption key, and so can be initialized using random data. + *** FIXME *** fpac? asl wrote: Looks like it

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/152596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][FMV] Enable PAuth and BTI hardening of resolver functions (PR #141573)

2025-07-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl demilestoned https://github.com/llvm/llvm-project/pull/141573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-07-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl demilestoned https://github.com/llvm/llvm-project/pull/140276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-07-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl demilestoned https://github.com/llvm/llvm-project/pull/136828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-07-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl demilestoned https://github.com/llvm/llvm-project/pull/138482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][FMV] Enable PAuth and BTI hardening of resolver functions (PR #141573)

2025-07-14 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/141573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-27 Thread Anton Korobeynikov via cfe-commits
@@ -681,7 +681,18 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto) // context struct, because it is allocated on the stack, and an exception // could clobber the de-allocated portion of the stack after sp has been // restored. - ldrx16, [x0, #0x0

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-27 Thread Anton Korobeynikov via cfe-commits
asl wrote: > The fact I'm worried about is whether implicit signing and authentication on > accesses to `__ptrauth`-qualified fields may introduce signing or > authentication oracles usable by an attacker, since many values stored to > these fields are initially non-signed. This is possibly mi

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-06 Thread Anton Korobeynikov via cfe-commits
asl wrote: @kovdan01 @atrosinenko Please take a look https://github.com/llvm/llvm-project/pull/143230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2025-06-06 Thread Anton Korobeynikov via cfe-commits
@@ -1845,8 +1986,14 @@ class _LIBUNWIND_HIDDEN Registers_arm64 { uint64_t getSP() const { return _registers.__sp; } void setSP(uint64_t value) { _registers.__sp = value; } - uint64_t getIP() const { return _registers.__pc; } - void setIP(uint6

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2025-06-04 Thread Anton Korobeynikov via cfe-commits
@@ -1823,9 +1826,127 @@ extern "C" void *__libunwind_shstk_get_jump_target() { #endif class _LIBUNWIND_HIDDEN Registers_arm64 { + struct GPRs; + +private: + /// The program counter is used effectively as a return address + /// when the context is restored therefore protect

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-06-02 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/136828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-02 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/138482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-02 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/139790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-02 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/140276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-02 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl updated https://github.com/llvm/llvm-project/pull/140276 >From 21d2b2da72d9e8f3994cb913a86c093212bb8711 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Fri, 16 May 2025 19:25:57 +0300 Subject: [PATCH 1/2] [PAuth] Use different discriminators for __int128_t / __uin

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-01 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl updated https://github.com/llvm/llvm-project/pull/140276 >From 21d2b2da72d9e8f3994cb913a86c093212bb8711 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Fri, 16 May 2025 19:25:57 +0300 Subject: [PATCH 1/2] [PAuth] Use different discriminators for __int128_t / __uin

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-05-16 Thread Anton Korobeynikov via cfe-commits
@@ -3383,21 +3383,27 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext &Ctx, // Don't bother discriminating based on these types. case Type::Pipe: - case Type::BitInt: case Type::ConstantMatrix: OS << "?"; return; + case Type::BitInt: { +

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-05-16 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl created https://github.com/llvm/llvm-project/pull/140276 compared to other integer types when computing function pointer type discriminator. These parameter types have different parameter passing ABI as compared to ordinary integer types (e.g. require 2 registers instead

[clang] [clang] Add builtin_get_vtable_pointer and virtual_member_address (PR #135469)

2025-04-11 Thread Anton Korobeynikov via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s --check-prefixes CHECK,CHECK-AUTH +// RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2025-02-20 Thread Anton Korobeynikov via cfe-commits
@@ -803,17 +809,18 @@ class Qualifiers { static_assert(sizeof(PointerAuthQualifier) == sizeof(uint32_t), "PointerAuthQualifier must be 32 bits"); + static constexpr uint64_t PtrAuthShift = 32; + static constexpr uint64_t PtrAuthMask = uint64_t(0x) <

[clang] [PAC] Do not support some values of branch-protection with ptrauth-returns (PR #125280)

2025-02-10 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/84b0c128a751acfbf5b439edc724ba27d1da653e https://github.com/llvm/llvm-project/pull/125280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [PAC] Do not support some values of branch-protection with ptrauth-returns (PR #125280)

2025-02-10 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/125280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [libcxx] [lldb] [llvm] [doc] Add Discord invite link alongside channel links (PR #126352)

2025-02-09 Thread Anton Korobeynikov via cfe-commits
@@ -12,7 +12,8 @@ The LLVM C Library LLVM-libc is not fully complete right now. Some programs may fail to build due to missing functions. If you would like to help us finish LLVM-libc, check out "`Contributing to the libc project `__" in the sidebar - or ask on `discord

[clang] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-16 Thread Anton Korobeynikov via cfe-commits
asl wrote: Looks like ignoring `noexcept` made the everything even more cleaner :) https://github.com/llvm/llvm-project/pull/109056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-14 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/115964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-14 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/115964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2024-11-06 Thread Anton Korobeynikov via cfe-commits
@@ -1845,8 +1884,14 @@ class _LIBUNWIND_HIDDEN Registers_arm64 { uint64_t getSP() const { return _registers.__sp; } void setSP(uint64_t value) { _registers.__sp = value; } - uint64_t getIP() const { return _registers.__pc; } - void setIP(uint6

[clang] [PAC][Driver] Add `-faarch64-jump-table-hardening` flag (PR #113149)

2024-10-21 Thread Anton Korobeynikov via cfe-commits
asl wrote: This looks reasonable to me. @ahmedbougacha @ahatanak any objections? https://github.com/llvm/llvm-project/pull/113149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Revert "[libc++][modules] Rewrite the modulemap to have fewer top-level modules (#107638)" (PR #110384)

2024-09-28 Thread Anton Korobeynikov via cfe-commits
asl wrote: @llvm-beanz The changes to clang/include/clang/AST/Expr.h seems to be unrelated, no? https://github.com/llvm/llvm-project/pull/110384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [PAC] Re-sign a pointer to a noexcept member function when it is converted to a pointer to a member function without noexcept (PR #109056)

2024-09-17 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. This looks good to me, thanks! https://github.com/llvm/llvm-project/pull/109056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG2486 (`noexcept` and function pointer conversion) (PR #107131)

2024-09-03 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/107131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-12 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-12 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/d179acd0484bac30c5ebbbed4d29a4734d92ac93 https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-12 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl demilestoned https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-09 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Failed to cherry-pick: > [d179acd](https://github.com/llvm/llvm-project/commit/d179acd0484bac30c5ebbbed4d29a4734d92ac93) > > https://github.com/llvm/llvm-project/actions/runs/10324823761 > > Please manually backport the fix and push it to your github fork. Once this > is done, pl

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-09 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-09 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick d179acd0484bac30c5ebbbed4d29a4734d92ac93 https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Wire -fptrauth-returns to "ptrauth-returns" fn attribute. (PR #102416)

2024-08-09 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/102416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Wire -fptrauth-returns to "ptrauth-returns" fn attribute. (PR #102416)

2024-08-09 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick 2eb6e30fe83ccce3cf01e596e73fa6385facd44b https://github.com/llvm/llvm-project/pull/102416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-09 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Was there an RFC for this? I ask because it's introducing another qualifier > and that has broad impacts on things beyond Clang like libc++, etc so we > really need buy-in from a wider range of the community than will likely see > this PR. Just my 2 cents from downstream experien

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-08 Thread Anton Korobeynikov via cfe-commits
@@ -956,6 +956,25 @@ def err_ptrauth_indirect_goto_addrlabel_arithmetic : Error< "%select{subtraction|addition}0 of address-of-label expressions is not " "supported with ptrauth indirect gotos">; +// __ptrauth qualifier +def err_ptrauth_qualifier_invalid : Error< + "%sele

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-08 Thread Anton Korobeynikov via cfe-commits
@@ -1758,6 +1758,34 @@ Also see the documentation for `@available }]; } +def PtrAuthDocs : Documentation { + let Category = DocCatVariable; + let Heading = "__ptrauth, __ptrauth_restricted_intptr"; asl wrote: `__ptrauth_restricted_intptr` is not here yet.

[clang] [llvm] [PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (PR #102508)

2024-08-08 Thread Anton Korobeynikov via cfe-commits
asl wrote: But please wait for @MaskRay or other reviwers https://github.com/llvm/llvm-project/pull/102508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (PR #102508)

2024-08-08 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/102508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Wire -fptrauth-returns to "ptrauth-returns" fn attribute. (PR #102416)

2024-08-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/102416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

2024-08-07 Thread Anton Korobeynikov via cfe-commits
asl wrote: @tru @nikic @MaskRay should this be backported to 19 release branch? https://github.com/llvm/llvm-project/pull/102274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Enable `-fptrauth-indirect-gotos` as part of pauthtest ABI (PR #100480)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/100480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Enable `-fptrauth-indirect-gotos` as part of pauthtest ABI (PR #100480)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick 3f6eb13abf643afec17a73448ede380606531226 https://github.com/llvm/llvm-project/pull/100480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Enable `-fptrauth-indirect-gotos` as part of pauthtest ABI (PR #100480)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/100480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang][test] Implement missing tests for some PAuth features (PR #100206)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/100206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/100204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl demilestoned https://github.com/llvm/llvm-project/pull/100204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick 666e3326fedfb6a033494c36c36aa95c4124d642 https://github.com/llvm/llvm-project/pull/100204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/100204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-23 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/99604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-23 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/99604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang][test] Implement missing tests for some PAuth features (PR #100206)

2024-07-23 Thread Anton Korobeynikov via cfe-commits
asl wrote: Tagging @ojhunt https://github.com/llvm/llvm-project/pull/100206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/100204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/100204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/97647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
@@ -10685,6 +10689,26 @@ SDValue AArch64TargetLowering::LowerBR_JT(SDValue Op, return DAG.getNode(ISD::BRIND, DL, MVT::Other, JTInfo, SDValue(Dest, 0)); } +SDValue AArch64TargetLowering::LowerBRIND(SDValue Op, SelectionDAG &DAG) const { + MachineFunction &MF = DAG.getMachi

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/99576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][Driver] Support `pauthtest` ABI for AArch64 Linux triples (PR #97237)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
asl wrote: Thanks @smithp35 I opened https://github.com/llvm/llvm-project/issues/99950 to track this https://github.com/llvm/llvm-project/pull/97237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
@@ -10685,6 +10689,26 @@ SDValue AArch64TargetLowering::LowerBR_JT(SDValue Op, return DAG.getNode(ISD::BRIND, DL, MVT::Other, JTInfo, SDValue(Dest, 0)); } +SDValue AArch64TargetLowering::LowerBRIND(SDValue Op, SelectionDAG &DAG) const { + MachineFunction &MF = DAG.getMachi

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl requested changes to this pull request. https://github.com/llvm/llvm-project/pull/97647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
asl wrote: FWIW, we are seeing authentication fails when running musl with pauth enabled and this PR. Working on reproducer. https://github.com/llvm/llvm-project/pull/97647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
asl wrote: @ojhunt Close or rebase? https://github.com/llvm/llvm-project/pull/99604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-07-21 Thread Anton Korobeynikov via cfe-commits
asl wrote: @ahatanak Will you please take a look into all these issues? https://github.com/llvm/llvm-project/pull/93906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-21 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/99741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-19 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Neat! https://github.com/llvm/llvm-project/pull/99741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Authenticate function pointers in UBSan type checks (PR #99590)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
@@ -13,6 +15,8 @@ void fun() {} // ARM: ptrtoint ptr {{.*}} to i32, !nosanitize !5 // ARM: and i32 {{.*}}, -2, !nosanitize !5 // ARM: inttoptr i32 {{.*}} to ptr, !nosanitize !5 +// 64e: %[[STRIPPED:.*]] = ptrtoint ptr {{.*}} to i64, !nosanitize +// 64e: call i64 @llvm

[clang] [PAC] Authenticate function pointers in UBSan type checks (PR #99590)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/99590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Fix a crash when signing a pointer to a function with an incomplete enum parameter (PR #99595)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/99595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [test][PAC][clang] Add missing tests against linux triples (PR #99482)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/99482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
@@ -14,10 +14,144 @@ #ifndef LLVM_CLANG_BASIC_POINTERAUTHOPTIONS_H #define LLVM_CLANG_BASIC_POINTERAUTHOPTIONS_H +#include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" +#include "llvm/ADT/STLForwardCompat.h" +#include "llvm/Support/ErrorHandling.h" +#include "llv

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
asl wrote: > I notice the r+, but I haven't fully addressed this feedback - are you > suggesting corrections in a follow up patch, or just conceptually approving > with this PR? :D I think this patch is fine to go as-is. We can re-consider that `MaybeSigned` abstraction further on if it could

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/98276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
@@ -333,7 +338,8 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the d

[clang] [llvm] [PAC][Driver] Support `pauthtest` ABI for AArch64 Linux triples (PR #97237)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
@@ -324,6 +324,9 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple, case llvm::Triple::GNU: setABI("apcs-gnu"); break; +case llvm::Triple::PAuthTest: asl wrote: Do we really need to touch 32-bit ARM? https://github.com/llvm/llvm-p

[clang] [PAC][clang] Enhance preprocessor ptrauth tests (PR #98862)

2024-07-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/98862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-10 Thread Anton Korobeynikov via cfe-commits
@@ -333,7 +338,8 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the d

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-08 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Under the proposed ABI, `&&A-&&B` is actually "sign(A)-sign(B)". Which is a > constant, but not one which can be represented as a relocation (as far as I > know). Right. The difference should be not be signed IMO as stated above. https://github.com/llvm/llvm-project/pull/97647 __

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-08 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Please make sure you have a testcase for computing the difference between two > blockaddresses (`void g(int*); int f() { static int x = &&A-&&B; > A:g(&x);B:return x; }`). Not sure how you should handle that case. Will you please clarify what is the problem here? `&&A-&&B` will be

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-02 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Is there any thought on how we want to manage signing schemas going forward? > For example I can imagine looking an environment from the triple to select a > signing schema for a particular platform. I could also see a potential for a > separate command line option to choose from

[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-24 Thread Anton Korobeynikov via cfe-commits
asl wrote: Can we have LLVM IR test as well? https://github.com/llvm/llvm-project/pull/96478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang][Driver] Add signed GOT flag (PR #96160)

2024-06-21 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Do we want a lot of `-fptrauth-xxx` instead of > `-fptrauth-something=xxx,yyy,zzz`? I would lean towards a single flag. However, I do not know how this would affect Apple downstream and what are preferences there. Tagging @ahmedbougacha @ahatanak @ojhunt https://github.com/llv

[clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-19 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/93903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Use specialized decl hash function for GlobalDeclID (PR #95730)

2024-06-16 Thread Anton Korobeynikov via cfe-commits
@@ -230,7 +230,11 @@ template <> struct DenseMapInfo { } static unsigned getHashValue(const GlobalDeclID &Key) { -return DenseMapInfo::getHashValue(Key.get()); +// Our default hash algorithm for 64 bits integer may not be very good. +// In GlobalDeclID's case,

[clang] [llvm] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-14 Thread Anton Korobeynikov via cfe-commits
asl wrote: @ahmedbougacha Will you please rebase https://github.com/llvm/llvm-project/pull/93903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Enable LLDB tests in pre-merge CI (PR #94208)

2024-06-03 Thread Anton Korobeynikov via cfe-commits
asl wrote: Tagging @slydiman @vvereschaka https://github.com/llvm/llvm-project/pull/94208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-03 Thread Anton Korobeynikov via cfe-commits
asl wrote: @kbeyls Will you please summarize briefly what we discussed on the sync call from the license standpoint? https://github.com/llvm/llvm-project/pull/93902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [clang] Add arm64e ABI-defined key assignments to ptrauth.h. (PR #93901)

2024-05-30 Thread Anton Korobeynikov via cfe-commits
@@ -15,6 +15,29 @@ typedef enum { ptrauth_key_asib = 1, ptrauth_key_asda = 2, ptrauth_key_asdb = 3, + +#ifdef __APPLE__ asl wrote: I believe these are defaults for ELF as well. So, I'd remove ifdef and decide on necessary gating when there will be a pre

[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-21 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Ok from the generic point of view. I cannot judge if wasm-related part is ok though :) https://github.com/llvm/llvm-project/pull/92192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

  1   2   >