lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1420831129.4160.78.camel@linaro.org>
Date:	Fri, 09 Jan 2015 19:18:49 +0000
From:	"Jon Medhurst (Tixy)" <tixy@...aro.org>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Wang Nan <wangnan0@...wei.com>, masami.hiramatsu.pt@...achi.com,
	lizefan@...wei.com, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v20 08/11] ARM: kprobes: enable OPTPROBES for ARM 32

On Fri, 2015-01-09 at 17:57 +0000, Russell King - ARM Linux wrote:
[...]
> For me:
> 
> $ echo 'asm ("bx r2\n");' | arm-linux-gcc -x c -c -marm -march=armv4 -v - -o o.o
> 
> calls the assembler thusly:
> 
> /usr/local/lib/gcc/arm-linux-gnueabi/4.7.4/../../../../arm-linux-gnueabi/bin/as \
> -v -march=armv4 -meabi=5 --fix-v4bx -o o.o /tmp/ccB0cZgO.s
> 
> Sure enough, the object file contains:
> 
> 00000000 <.text>:
>    0:   e12fff12        bx      r2
>                         0: R_ARM_V4BX   *ABS*
> 
> so it looks like it's been told...  Then if you do:
> 
> $ arm-linux-ld --fix-v4bx -o o1.o o.o
> $ arm-linux-objdump -dr o1.o
> 
> you get:
> 
>     8074:       e1a0f002        mov     pc, r2

I get results consistent with what you get above. A bit of googling
seems to indicate the generate-BX-and-fix-it-in-the-linker came in many
years ago with AEABI support.

> Hmm, I wonder if this means we should have the kernel linker deal with
> V4BX relocations on ARMv4, converting them to their mov pc, X variant.
> 
> Also, do we need --fix-v4bx for the link of vmlinux?

I guess the answer is yes if we want to catch uses of BX in inline
assembly. A quick and not very thorough grep of arch/arm for 'bx'
doesn't seem to turn up any existing dodgy uses, except in the kprobes
test code I wrote :-(

-- 
Tixy


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ