search for: stackprotector

Displaying 20 results from an estimated 47 matches for "stackprotector".

2019 Sep 19
2
Fixing some StackProtector issues
PR43308 describes a case where StackProtector fails to protect against a fairly simple smash. This problem started after r363169, which removed StackProtector's own analysis function HasAddressTaken, and used CaptureTracking's PointerMayBeCaptured instead. The problem here is that "pointer is captured" and "pointer cou...
2019 May 14
2
Linker issue
...loop. We have gotten around this problem for the moment by applying LCSSA which inserts a PHI in the loop exit for the in loop uniform value that allows the divergent info to be passed onto isel. The LCSSA is being inserted into XXXDAGToDAGISel class but this causes a pass scheduling conflict with StackProtector. So what we've done is try to preserve StackProtector in LCSSA, the issue is that the linker fails in Debug build (but not Release build). StackProtector lies in CodeGen while LCSSA lies in Tranforms/Utils. Matt had mentioned to me that you can't refer to a preserved pass if it's not...
2019 Jun 06
3
[RFC] Expressing preserved-relations between passes from different modules (was: Re: Linker issue)
...haehnle at gmail.com> wrote: > > Hi all, > > re-upping and renaming this thread to get some attention, as we'd like > some feedback on a change that affects the future design direction. > > The concrete problem: We would like to mark the LCSSA pass as > preserving the StackProtector pass in order to be able to properly > express all dependencies we have. Unfortunately, those passes are > defined in different modules that do not (and should not) depend on > each other, which causes linking to fail. > > Our proposal is to introduce a collection of cross-module pas...
2016 Mar 26
0
[SSP] Simplifying SSP code paths
I'm still working on SSP support in LLVM. We have code that is in an IR pass StackProtector, SelectionDAG, FastISel, and some MachineFunction passes. Even in SelectiondDAG we have different code paths. I wonder if we can at least have only two code paths, one for SelectionDAG and the other for FastISel. IR pass may generate two forms of IR: 1) Almost pure IR, which contains only llvm.sta...
2011 Jul 20
2
[LLVMdev] Question about SimplifyXorInst
Hi all, I am master student in Edinburgh, UK. I am doing my MSc project with LLVM compiler and I have to modify LLVM to implement the StackGuard with a XOR random Canary. However, I am not familiar with LLVM. My problem is that I want to XOR the random canary word with the return address which are both 32 bits. I found a method called SimplifyXorInst(Value *, Value *, const TargetData
2019 Sep 10
2
Question on llvm.mem* intrinsics
Hi there lowering experts, Can the llvm.mem* intrinsics ever turn into a library call? Or do they invariably turn into inline code? This comes up because there was a patch to StackProtector to use CaptureTracking instead of a home-grown analysis, which changes the treatment of calls to intrinsics. (The old code treated them as normal calls, the new code decides intrinsics can never capture.) But if llvm.mem* intrinsics can turn into real function calls, we need to pay attention to th...
2008 Dec 29
0
[LLVMdev] Controlling the stack layout
...modifying llvm internals? I > looked at > writing a machine function pass, but I can't register one when > JITting. > Is the machine function pass the correct way of implementing this? > This might help. See how "stack protectors" is implemented here: lib/CodeGen/StackProtector.cpp It places a special value at a specific place on the stack. You can use the same trick to put your own information on a set stack position. There's more to the code than just that .cpp file. It's done with intrinsics. You'll also need to check out the PrologEpilogInserter.c...
2013 Dec 17
1
[LLVMdev] Out of tree targets: API Change to MFI::CreateStackObject
Hi, I will soon be committing a change to MachineFrameInfo::CreateStackObject that removes the "bool MayNeedSP" parameter. This API change is part of larger patch that re-works stack layout passes to use analysis from the StackProtector pass to layout StackProtected objects (http://llvm-reviews.chandlerc.com/D2158). Out of tree targets will need to update their usage accordingly. The most likely scenarios will be along these lines: - CreateStackObject(Size, Alignment, false /*isSS*/, false /*MayNeedSP*/); + CreateStackObject(S...
2011 Jul 28
1
[LLVMdev] New Problem: llc -O0: Broken module found, compilation aborted!
...But I find I still have the problem below: Both operands to a binary operator are not of the same type! %aaa = xor i8* %"Call Return Address", i32 1892499360 Instruction does not dominate all uses! %aaa = xor i8* %"Call Return Address", i32 1892499360 call void @llvm.stackprotector(i8* %aaa, i8** %StackGuardSlot) Logical operators only work with integral types! %abbaa = xor i8* %2, %"Call the return address" Both operands to ICmp instruction are not of the same type! %3 = icmp eq i32 1892499360, i8* %abbaa Instruction does not dominate all uses! %3 = icmp e...
2012 Oct 02
5
[LLVMdev] [PROPOSAL] Adding support for -fstack-protector-strong
...sspstrong, and sspreq to be specified on a function-by-function basis. - Already implemented privately for ssp and sspreq. Only sspstrong would need to be added. Ultimately all attributes would be contributed to the community. 4 Implement 'strong' heuristic in CodeGen/StackProtector.cpp - Mostly relaxing checks in current StackProtector pass. For example, when strong attribute is present, relax rules requiring arrays of char type, ssp-buffer-size, etc. - Add analysis to check for taking the address of local variables. - Make the IR attribute 'sspst...
2013 Jan 21
1
[LLVMdev] Testing canaries
...) I must change to have this done? Usually I insert canaries with the following command line: $> clang -S -fstack-protector hello.c But I would like to know which part of LLVM calls the pass that inserts the canaries. It seems it is llc, as the pass that inserts the canaries is in /lib/CodeGen/StackProtector.cpp. Yet, I cannot see 'fstack-protector' in the llc --help list, although I can see 'stack-protector-buffer-size' in llc --help. Sincerely, -- Izabela Maffra. *Ciência da Computação Universidade Federal de Minas Gerais (31) 8615-3077* "Don't count the days, make the d...
2012 Mar 25
1
[LLVMdev] LLVM Metadata to Dwarf tags
...een created and blown away the usefulness of the descriptions contained in that thread. (Example: AsmPrinter::processDebugLoc() no longer exists). Does anyone have any pointers on how to update this for LLVM/clang 3.0? To be more specific, I've added a special stack guard intrinsic similar to StackProtector.cpp which uses a per function random immediate instead of ___stack_chk_guard. What I am trying to accomplish is to get the offset into the final x86 object file of each one of these immediate values. An example of the output in Assembly looks like: movq $653406579, -8(%rbp) ## imm = 0x26F23173...
2008 Dec 29
2
[LLVMdev] Controlling the stack layout
Hi Bill, Bill Wendling wrote: > > This might help. See how "stack protectors" is implemented here: > > lib/CodeGen/StackProtector.cpp > > It places a special value at a specific place on the stack. You can > use the same trick to put your own information on a set stack > position. There's more to the code than just that .cpp file. It's done > with intrinsics. You'll also need to check out the...
2015 Dec 01
10
[RFC] Intrinsic naming convention (words with dots)
...@llvm.experimental.patchpoint @llvm.experimental.gc.statepoint @llvm.returnaddress @llvm.frameaddress @llvm.localescape @llvm.localrecover @llvm.stacksave @llvm.stackrestore @llvm.pcmarker @llvm.readcyclecounter @llvm.bitreverse @llvm.eh.begincatch @llvm.eh.endcatch @llvm.eh.padparam @llvm.stackprotector @llvm.stackprotectorcheck @llvm.objectsize @llvm.donothing Words with dots: @llvm.sadd.with.overflow @llvm.uadd.with.overflow @llvm.ssub.with.overflow @llvm.usub.with.overflow @llvm.smul.with.overflow @llvm.umul.with.overflow @llvm.convert.to.fp16 @llvm.convert.from.fp16 @llvm.eh.typeid.for @...
2012 Oct 02
0
[LLVMdev] [PROPOSAL] Adding support for -fstack-protector-strong
...e specified on a function-by-function basis. > - Already implemented privately for ssp and sspreq. Only sspstrong would > need to be added. Ultimately all attributes would be contributed to the > community. > > 4 Implement 'strong' heuristic in CodeGen/StackProtector.cpp > - Mostly relaxing checks in current StackProtector pass. For example, when > strong attribute is present, relax rules requiring arrays of char type, > ssp-buffer-size, etc. > - Add analysis to check for taking the address of local variables. > - Ma...
2008 Dec 27
5
[LLVMdev] Controlling the stack layout
Hi everyone, As a front-end developer, I'd like to add a language-specific information at a fixed location of each stack frame. The reason is that I want to retrieve this information when dynamically walking the stack. For example, X86 has the following stack layout for a function with two arguments and two locals: 12(%ebp) - second function parameter 8(%ebp) - first function
2008 Dec 30
0
[LLVMdev] Controlling the stack layout
Hi Nicolas, >> This might help. See how "stack protectors" is implemented here: >> >> lib/CodeGen/StackProtector.cpp >> >> It places a special value at a specific place on the stack. You can >> use the same trick to put your own information on a set stack >> position. There's more to the code than just that .cpp file. It's >> done >> with intrinsics. You'll al...
2008 Dec 05
3
[LLVMdev] Build errors on trunk for about a week now.
On Fri, Dec 5, 2008 at 1:58 PM, OvermindDL1 <overminddl1 at gmail.com> wrote: > On Fri, Dec 5, 2008 at 1:57 PM, OvermindDL1 <overminddl1 at gmail.com> wrote: >> On Fri, Dec 5, 2008 at 1:52 PM, OvermindDL1 <overminddl1 at gmail.com> wrote: >>> / * snip */ >> >> Actually, rebuilding it makes "debug tblgen" fail with the errors at >> the
2016 Feb 23
2
[PPC] Linker fails on -fstack-protector
On Mon, Feb 22, 2016 at 5:00 PM Eric Christopher <echristo at gmail.com> wrote: > Yeah, for most of the architectures listed there it's not particularly > useful as they support direct access to TLS variables (as Joerg says > later). That grep isn't representative of how the data is actually > accessed. If the current address space way of specifying isn't doable on
2017 Oct 12
3
[PATCH v1 00/27] x86: PIE support and option to extend KASLR randomization
...| 6 >> arch/x86/include/asm/pm-trace.h | 2 >> arch/x86/include/asm/processor.h | 12 + >> arch/x86/include/asm/sections.h | 8 + >> arch/x86/include/asm/setup.h | 2 >> arch/x86/include/asm/stackprotector.h | 19 ++ >> arch/x86/kernel/acpi/wakeup_64.S | 31 ++-- >> arch/x86/kernel/asm-offsets.c | 3 >> arch/x86/kernel/asm-offsets_32.c | 3 >> arch/x86/kernel/asm-offsets_64.c | 3 >> arch/x86/ker...