search for: uptr

Displaying 20 results from an estimated 55 matches for "uptr".

Did you mean: ptr
2017 Feb 23
4
RFC: Generalize means the sanitizers work with memory
...ry we also need a set of functions that efficiently perform operations on specified ranges of virtual addresses: // Fills a virtual memory with a given value. May release zeroed pages. For // DFsan we may need a version of this function that takes 16-bit values to // fill with. void vshadow_memset(uptr vs, u8 value, uptr size); // Similarly to vshadow_memset(), this function fills a range of virtual // memory with a given value and additionally claims that range as read-only // so the memory manager is not required to support modifying accesses for // these addresses. void fill_rodata_vshadow(up...
2016 Jul 13
2
[LLVM/Clang v3.8.1] Missing Git branches/tags and source-tarballs?
On Wed, Jul 13, 2016 at 04:48:51PM +0200, Sedat Dilek via llvm-dev wrote: > [ CCed all people who were involved in this thread ] > > Hi Tom, > > personally, I am interested to test the prebuilt-toolchains for > Ubuntu/xenial alias 16.04 LTS and Debian/Jessie v8.5.0 AMD64. > The available toolchains are incomplete and thus useless. > > Just as a fact: There is still no
2016 Jun 17
2
Attempt to modify memory sanitizer for support of X86
.../msan/msan.h: diff --git a/lib/msan/msan.h b/lib/msan/msan.h index be74f6e..10b5b05 100644 --- a/lib/msan/msan.h +++ b/lib/msan/msan.h @@ -147,6 +147,26 @@ const MappingDesc kMemoryLayout[] = { #define MEM_TO_SHADOW(mem) (LINEARIZE_MEM((mem)) + 0x100000000000ULL) #define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x280000000000) +#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 32 + +const MappingDesc kMemoryLayout[] = { + {0x00000000ULL, 0x10000000ULL, MappingDesc::APP, "app-1"}, + {0x10000000ULL, 0x20000000ULL, MappingDesc::SHADOW, "shadow-1"}, + {0x20000000U...
2008 Mar 20
1
[RFC/PATCH 05/15] kvm-s390: s390 arch backend for the kvm kernel module
...2 * PAGE_SIZE)) + guestaddr -= prefix; + + if (guestaddr > memsize) + return (void __user __force *) ERR_PTR(-EFAULT); + + guestaddr += origin; + + return (void __user *) guestaddr; +} + +static inline int get_guest_u64(struct kvm_vcpu *vcpu, u64 guestaddr, + u64 *result) +{ + void __user *uptr = __guestaddr_to_user(vcpu, guestaddr); + + if (guestaddr & 7) + BUG(); + + if (IS_ERR((void __force *) uptr)) + return PTR_ERR((void __force *) uptr); + + return get_user(*result, (u64 __user *) uptr); +} + +static inline int get_guest_u32(struct kvm_vcpu *vcpu, u64 guestaddr, + u32 *resu...
2008 Mar 20
1
[RFC/PATCH 05/15] kvm-s390: s390 arch backend for the kvm kernel module
...2 * PAGE_SIZE)) + guestaddr -= prefix; + + if (guestaddr > memsize) + return (void __user __force *) ERR_PTR(-EFAULT); + + guestaddr += origin; + + return (void __user *) guestaddr; +} + +static inline int get_guest_u64(struct kvm_vcpu *vcpu, u64 guestaddr, + u64 *result) +{ + void __user *uptr = __guestaddr_to_user(vcpu, guestaddr); + + if (guestaddr & 7) + BUG(); + + if (IS_ERR((void __force *) uptr)) + return PTR_ERR((void __force *) uptr); + + return get_user(*result, (u64 __user *) uptr); +} + +static inline int get_guest_u32(struct kvm_vcpu *vcpu, u64 guestaddr, + u32 *resu...
2015 Nov 12
4
Fwd: asan for allocas on powerpc64
...em is in the call to __asan_allocas_unpoison that is inserted at the end of the "for" loop (just before a stackrestore instruction). The call function is created something like this (paraphrasing from lib/Transfoms/Instrumentation/AddressSanitizer.cpp): // call __asan_allocas_unpoison(uptr top, uptr bottom); // NB "top" here means lowest address and "bottom" means highest! IRB.CreateCall( AsanAllocasUnpoisonFunc, { IRB.CreateLoad(DynamicAllocaLayout), IRB.CreatePointerToInt(SaveRestoreInst->getOperand(0), IntptrTy) } ); I think t...
2013 May 31
2
[LLVMdev] compiler-rt tests in cmake?
As a temporary fix, you can replace this line in sanitizer_linux_libcdep.c: const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1216, 2304); with const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1168, 2304); The tests should pass after that. I need to figure out which ifdefs to put this under, so I might not be able to land the fix until Monday. On Fri, May 31, 2013 at 8:...
2015 Nov 17
3
asan for allocas on powerpc64
...that is inserted at > the end of the "for" loop (just before a stackrestore instruction). > > The call function is created something like this (paraphrasing from > lib/Transfoms/Instrumentation/AddressSanitizer.cpp): > > // call __asan_allocas_unpoison(uptr top, uptr bottom); > // NB "top" here means lowest address and "bottom" means highest! > > IRB.CreateCall( > AsanAllocasUnpoisonFunc, > { > IRB.CreateLoad(DynamicAllocaLayout), > IRB.CreatePointerToInt(SaveRestoreIns...
2013 May 31
0
[LLVMdev] compiler-rt tests in cmake?
> const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1168, 2304); Yes, that change causes all tests to pass. > I need to figure out which ifdefs to put this under, so I might not be able to land the fix until Monday. Okay, no worries, thanks for doing this. I've moved over to release_33 for the s...
2020 Jul 10
2
RFC: Removing ptrtoint from asan instrumentation
...addresses, it does not work after seeing ptrtoint as one of the uses. The same applies to any optimization that deals with alias analysis or pointers in general. The hurdle in getting rid of the introduced ptrtoint in instrumentation is the fact that all runtime function expects the address as a uptr (uptr is unsigned long). Changing the data type of addresses passed to sanitizer runtime functions from uptr to void* will eliminate the need for the conversion to integer using ptrtoint. Removing the ptrtoint from asan instrumentation will boost the performance and will reduce the differences with...
2015 Mar 25
2
[LLVMdev] [PATCH] Test failures
...ommon/tests/sanitizer_libc_test.cc @@ -85,7 +85,7 @@ TEST(SanitizerCommon, FileOps) { EXPECT_EQ(len2, internal_write(fd, str2, len2)); internal_close(fd); - openrv = OpenFile(tmpfile, WrOnly); + openrv = OpenFile(tmpfile, RdWr); EXPECT_FALSE(internal_iserror(openrv)); fd = openrv; uptr fsize = internal_filesize(fd); @@ -134,7 +134,7 @@ TEST(SanitizerCommon, InternalMmapWithOffset) { char tmpfile[128]; temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.internalmmapwithoffset.tmp."); - uptr res = OpenFile(tmpfile, WrOnly); + uptr res = Op...
2015 Sep 25
2
Dynamic VMA in Sanitizers for AArch64
Jakub makes a good point, are you sure that there is no single shadow offset value that works for all VMA variants? What exactly breaks when 1<<36 is used on 42-bit VMA? On Fri, Sep 25, 2015 at 3:28 AM, Yury Gribov via llvm-dev <llvm-dev at lists.llvm.org> wrote: > On 09/25/2015 01:27 PM, Yury Gribov wrote: >> >> On 09/25/2015 11:53 AM, Jakub Jelinek via llvm-dev
2015 Nov 23
2
asan for allocas on powerpc64
...e "for" loop (just before a stackrestore instruction). >>> >>> The call function is created something like this (paraphrasing from >>> lib/Transfoms/Instrumentation/AddressSanitizer.cpp): >>> >>> // call __asan_allocas_unpoison(uptr top, uptr bottom); >>> // NB "top" here means lowest address and "bottom" means highest! >>> >>> IRB.CreateCall( >>> AsanAllocasUnpoisonFunc, >>> { >>> IRB.CreateLoad(DynamicAllocaLa...
2014 Jun 10
4
[LLVMdev] use of undeclared identifier '__NR_*' error while building clang
...-i386/i386: /home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc /home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:123:27: error: use of undeclared identifier '__NR_open' return internal_syscall(SYSCALL(open), (uptr)filename, flags); ^ /home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc:17:24: note: expanded from macro 'SYSCALL' # define SYSCALL(name) __NR_ ## name ^ <scratch space>:62:1: note: expa...
2013 Feb 27
2
[LLVMdev] [PATCH] [Embtk] [compiler-rt] ASAN: Add mips support
...;awg at embtoolkit.org> --- lib/asan/asan_linux.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index 845493d..417ecad 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -88,6 +88,11 @@ void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { stk_ptr = (uptr *) *sp; *bp = stk_ptr[15]; # endif +#elif defined(__mips__) + ucontext_t *ucontext = (ucontext_t*)context; + *pc = ucontext->uc_mcontext.gregs[31]; + *bp = ucontext->uc_mcontext.gregs[30]; + *sp = ucontext->uc_mcontext.gregs[29]; #else...
2015 Nov 23
2
asan for allocas on powerpc64
...n). >>>>> >>>>> The call function is created something like this (paraphrasing >>>>> from >>>>> lib/Transfoms/Instrumentation/AddressSanitizer.cpp): >>>>> >>>>> // call __asan_allocas_unpoison(uptr top, uptr bottom); >>>>> // NB "top" here means lowest address and "bottom" means >>>>> highest! >>>>> >>>>> IRB.CreateCall( >>>>> AsanAllocasUnpoisonFunc, >>>>>...
2019 Apr 26
2
[ASan][Windows] Interceptor function type not compatible with intercepted function
...UNC` a bit stricter. My best guess is that the type of the defined interceptor is not compatible (in C++ typing terms) with the “real” function. This seems to be the case for the following 2 functions: CreateThread “no conversion”: From: 'DWORD (__cdecl *)(void * , __sanitizer::uptr, DWORD (__cdecl *)(void *), void *, DWORD, void * )' To : 'HANDLE (__cdecl *)(LPSECURITY_ATTRIBUTES, SIZE_T , LPTHREAD_START_ROUTINE , LPVOID, DWORD, LPDWORD)' __C_specific_handler: From: 'int (__cdecl *)(void * , void *, void * , void...
2020 Mar 20
1
[PATCH 3/4] mm: simplify device private page handling in hmm_range_fault
...t; + struct mm_struct *mm = dmirror->mm; >> + unsigned long start, end; >> + unsigned long size = cmd->npages << PAGE_SHIFT; >> + unsigned long addr; >> + unsigned long next; >> + uint64_t pfns[64]; >> + unsigned char perm[64]; >> + char __user *uptr; >> + struct hmm_range range = { >> + .pfns = pfns, >> + .flags = dmirror_hmm_flags, >> + .values = dmirror_hmm_values, >> + .pfn_shift = DPT_SHIFT, >> + .pfn_flags_mask = ~0ULL, > > Same here, especially since this is snapshot > > Jason Actua...
2014 Dec 15
4
[LLVMdev] ubsan - active member check for unions
...9;d' here Runtime functions I've added: struct StringVec { unsigned NumElts; const char *Elts[]; }; struct UnionStaticData { TypeDescriptor *Type; StringVec* FieldNames; }; extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __ubsan_union_set_active_field_index(uptr Addr, const UnionStaticData *Data, const SourceLocation *ActivationLoc, unsigned ActiveFieldIndex); extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __ubsan_union_check_access(uptr Addr, const SourceLoca...
2008 Mar 20
34
[RFC/PATCH 00/15] kvm on big iron
This patch series introduces a backend for kvm to run on IBM System z machines that uses the mainframe's sie virtualization capability. This work runs 64bit guests on z800/z890/z900/z990/z9/z10 class machines with a 64bit linux host. Userspace will follow once we're done brushing it over. The patch queue consists of the following patches, which can be applied in sequence on top of kvm.git