From nobody Tue Feb 13 17:52:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TZ86h4Vzhz59NFb; Tue, 13 Feb 2024 17:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TZ86h46SDz42Gp; Tue, 13 Feb 2024 17:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707846748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Y7tPVPwcrH3kDd3/TAnQw5QjI1g5t/n0fuuj3hLPaA=; b=Y1Hnz2UyNoNj8G0x3lgKa0kmmxlaZ3H6Hleei/JSTgryfWaYwMnWD2hI3Jxp2EDLksxq6j DSdayQeXlhZsP9Jyobnsbfr5xbHbjepNAQK1rIT97S+u8egF26Xk6y5b4XYh4z78Uj/Rkw nBfl1aa1ehSMRf8KB6v2ssetGbEjOYThGKbs9jKsmbR5Rsf/heIVY5Zzz/M2/IqkM80gwn UDUlRuK955DBYv75s/Z/+vOzzL1nHKBIhsytg2jO1iOvwlpZe4AapVQS/ziBTCQueAD4B9 OHPC7tDbYgnvLa4uY10XnHJ4Tr1EjDKB+kyqi/ooGGKt/YYD0gwgv2LRkVLCAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707846748; a=rsa-sha256; cv=none; b=Mfr68CuKOh0PsYX8pXAGY6fWCMdyBXG4CXia57MCS2Ee+5A7neTGM8odjCfhO3WhYQDo2O mRweKK9ZBbQi81NTLasgxqXRrr6rLSx3nPQFXc/q5Wqo1JeNLgF9Zq8M970D3HDYjekaL7 QvMtSRgJKFJ9f3e4Ryg+G1nsN6zXWe/eowAY9M0e88kxsEgIoMNlRMHCabIrUTsw5fRwWf QQJn1F+K3SEjwg4vyVEWpCs5V14m0FoHL9BBlH+mwzX0Fq+8jUytonvTlNK5WQnfJwa/Qg 9FCUxyHmACfElA0sAHOWZWvwNq97T1T+yQC7AXLyGhG4LQDMN+QIBiZXcrdJNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707846748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Y7tPVPwcrH3kDd3/TAnQw5QjI1g5t/n0fuuj3hLPaA=; b=yB62xzVLiL6yzpkhCrsJ2hvjgj/VPnwnL7zIiE1KssGaE5TUgZVip40B1G84BQyZ4W2sc9 1Z/Zy1CZrtqdwSfDtdGUEr607080zRTZi26w5c0x0KlZulaI79w9W5qSSo0Yk/TdqbUfPl +CjHR9uxajyyGGo5c5d11iv+9pk6fGIncGK3vN4r+WiNJesGe+12JaqfHPvXUhwreBxo+a jawueQAe5hCeWQ1cc4AFBNvVX60ml8Zyospxeph2FBJgUYn+m5iyFoSbHCCplcaDyc3xnJ 6RU+HY30XBVozMmp8VFE21kpBSzIP4eMYwmqvT6AGiRGaUVwiT2fF/Ewt5urNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TZ86h38tczPqr; Tue, 13 Feb 2024 17:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41DHqSGK052852; Tue, 13 Feb 2024 17:52:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41DHqSZi052849; Tue, 13 Feb 2024 17:52:28 GMT (envelope-from git) Date: Tue, 13 Feb 2024 17:52:28 GMT Message-Id: <202402131752.41DHqSZi052849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 24b0131793cc - stable/14 - Merge commit f577bfb99528 from llvm-project (by Alexander Potapenko): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 24b0131793ccf493d6beb4c43b23076a6bcddac5 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=24b0131793ccf493d6beb4c43b23076a6bcddac5 commit 24b0131793ccf493d6beb4c43b23076a6bcddac5 Author: Dimitry Andric AuthorDate: 2024-02-08 19:19:27 +0000 Commit: Dimitry Andric CommitDate: 2024-02-13 17:51:25 +0000 Merge commit f577bfb99528 from llvm-project (by Alexander Potapenko): [sanitizer][msan] fix AArch64 vararg support for KMSAN (#70660) Cast StackSaveAreaPtr, GrRegSaveAreaPtr, VrRegSaveAreaPtr to pointers to fix assertions in getShadowOriginPtrKernel(). Fixes: https://github.com/llvm/llvm-project/issues/69738 Patch by Mark Johnston. Requested by: markj MFC after: 3 days (cherry picked from commit cf675768528f22b4a9d8c70897b9ebf51da8061e) --- .../lib/Transforms/Instrumentation/MemorySanitizer.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 83d90049abc3..de266590ad92 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1718,6 +1718,12 @@ struct MemorySanitizerVisitor : public InstVisitor { std::pair getShadowOriginPtrUserspace(Value *Addr, IRBuilder<> &IRB, Type *ShadowTy, MaybeAlign Alignment) { + VectorType *VectTy = dyn_cast(Addr->getType()); + if (!VectTy) { + assert(Addr->getType()->isPointerTy()); + } else { + assert(VectTy->getElementType()->isPointerTy()); + } Type *IntptrTy = ptrToIntPtrType(Addr->getType()); Value *ShadowOffset = getShadowPtrOffset(Addr, IRB); Value *ShadowLong = ShadowOffset; @@ -5262,21 +5268,25 @@ struct VarArgAArch64Helper : public VarArgHelper { // we need to adjust the offset for both GR and VR fields based on // the __{gr,vr}_offs value (since they are stores based on incoming // named arguments). + Type *RegSaveAreaPtrTy = IRB.getInt8PtrTy(); // Read the stack pointer from the va_list. - Value *StackSaveAreaPtr = getVAField64(IRB, VAListTag, 0); + Value *StackSaveAreaPtr = + IRB.CreateIntToPtr(getVAField64(IRB, VAListTag, 0), RegSaveAreaPtrTy); // Read both the __gr_top and __gr_off and add them up. Value *GrTopSaveAreaPtr = getVAField64(IRB, VAListTag, 8); Value *GrOffSaveArea = getVAField32(IRB, VAListTag, 24); - Value *GrRegSaveAreaPtr = IRB.CreateAdd(GrTopSaveAreaPtr, GrOffSaveArea); + Value *GrRegSaveAreaPtr = IRB.CreateIntToPtr( + IRB.CreateAdd(GrTopSaveAreaPtr, GrOffSaveArea), RegSaveAreaPtrTy); // Read both the __vr_top and __vr_off and add them up. Value *VrTopSaveAreaPtr = getVAField64(IRB, VAListTag, 16); Value *VrOffSaveArea = getVAField32(IRB, VAListTag, 28); - Value *VrRegSaveAreaPtr = IRB.CreateAdd(VrTopSaveAreaPtr, VrOffSaveArea); + Value *VrRegSaveAreaPtr = IRB.CreateIntToPtr( + IRB.CreateAdd(VrTopSaveAreaPtr, VrOffSaveArea), RegSaveAreaPtrTy); // It does not know how many named arguments is being used and, on the // callsite all the arguments were saved. Since __gr_off is defined as