From nobody Tue Feb 13 17:52:44 2024 X-Original-To: dev-commits-src-branches@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 4TZ87044qVz59NCb; Tue, 13 Feb 2024 17:52:44 +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 4TZ8702F3gz4365; Tue, 13 Feb 2024 17:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707846764; 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=EyDoax6b0GjrD7hausg4bv3VOAkEJB9pmkeRAW0+LCU=; b=bdxn0vHS5fPPVDMfV4cVJbtSzcfrYEALQEFnyuU638JlylpXIKPMig/M9FtPRx8W5YQRQE khx8awoc2ZJMUHR51CNYbIhHkjCaqUevI3tyxvK95QEK6fUDOtiW+ZY/S6pCNgrkb2xgmj 0/KBgD6AJWQJyIYxq3xP6hvvbl388pSn1DgZBpr/is0xADOaORBlwQoMaYzI7pr2M5Ri12 8QH3+d0ZSIzS8BAjxkU8nARW9UcS1b7eZ/iWrS2ILBqdVoXIUA7d3Pbbc+tR/a4GT6d+uI fcz8z3My3VjD0AVwXNX2glN7bTD9wXgiXKG1emWN2KwSKLsJz//NydIq9Asptg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707846764; a=rsa-sha256; cv=none; b=bB0ek1gI+pMklXwaGAVJGV1VLcO/tzCNHhPNkprvJjcCz7Ol9nANYMInY7q7ftJm1qvNGs X4XlDxloZ2QtDyTYdHi8rBck53VTrjalR1DCYDkgfH93ytTAzGeWVK8nGbnRtDnOj0bdXa gyTVIPCtWgVDwlQmCl6wNIE4E0NiEwG1pgf5tFHcSN7KbZWjiXelyKX2s03d7WQX5nkx85 2PPn4eIxHxESnOHa86OWHi7YbgBrzLHrRfLAagUj+8ZXvdzNil9OgRyEwkCLV0LxCjEBdU fsnLbALfiVKTizYTqD/A34xO7DOjYUedjb2gm8Ao1K49vbjG5RvKQ4MZBEF7Nw== 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=1707846764; 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=EyDoax6b0GjrD7hausg4bv3VOAkEJB9pmkeRAW0+LCU=; b=uFHY4Fw//NlgV6A/hCXAVqt0AK7KVW5X3kyur0t2TanEvgGgGoCdOw2kv02NsXPQ+DZKPp MJdonCTDXxOv5SaBZq28ExxkEb7okGtXqzCerDO4zJ59EJv1iNcbKAaWHDI1Qh5FNZkchc vlycyyoM8/n3a7Z20ZYyTQ8i/NHSVTozsHODSAnj+aOdwMahlv3kjcyvYgWRGLLL6S7/6w NTd1dkninyNFOwYoo1x8xzH3bbCBKqjkHv0F969ASvgO9d+dUY8mNwg8PztMR9ty9biZfK OxnlrHYYIQO0B/WshPeiLKbvn2enEqCBp2ZCFHyx1OHLYaM4MZQDLhJgHTN/mg== 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 4TZ8701KwyzPX8; Tue, 13 Feb 2024 17:52:44 +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 41DHqiba054301; Tue, 13 Feb 2024 17:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41DHqi8k054297; Tue, 13 Feb 2024 17:52:44 GMT (envelope-from git) Date: Tue, 13 Feb 2024 17:52:44 GMT Message-Id: <202402131752.41DHqi8k054297@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: 2292dffacfc5 - stable/13 - Merge commit f577bfb99528 from llvm-project (by Alexander Potapenko): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 2292dffacfc56af7515830171a84f8651cc34a72 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2292dffacfc56af7515830171a84f8651cc34a72 commit 2292dffacfc56af7515830171a84f8651cc34a72 Author: Dimitry Andric AuthorDate: 2024-02-08 19:19:27 +0000 Commit: Dimitry Andric CommitDate: 2024-02-13 17:51:47 +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