Anatoly Pugachev <mator...@gmail.com> writes:

> On Fri, May 26, 2017 at 7:56 PM, Gert Doering <g...@greenie.muc.de> wrote:
>> Hi,
>>
>> On Fri, May 26, 2017 at 04:30:53PM +0200, Jeremie Courreges-Anglas wrote:
>>> I am the maintainer of openvpn in the OpenBSD ports tree.  Here's
>>> a report from Stefan Sperling (Cc'ed).
>>>
>>> > An openvpn server running on OpenBSD/sparc64 6.1 crashes when a client
>>> > connects and starts doing traffic. Is anyone else seeing this?
>>
>> Thanks for the report.  I'll look into it.
>>
>> Copying around the IP header doesn't feel like the proper solution,
>> though - it's basically replacing an unaligned access somewhere with
>> a larger (unaligned!) mem copy, where most likely changing a word
>> access to 2x byte access (etc) might achieve the same thing without
>> copying.
>>
>>> To work around this, the patch below (also written by Stefan) was
>>> committed in our ports tree.  TARGET_FREEBSD and TARGET_DRAGONFLY seem
>>> to be affected too.
>>
>> FreeBSD/Sparc64 traps unaligned memory accesses and handles them
>> kernel-side.  So you'll see a slowdown, but no signal.
>>
>> Linux/Sparc64 has the same restrictions (unaligned access causing a
>> signal), but nobody has reported that yet, so maybe the underlying
>> memory alignment of the allocated buffer happens to be good enough
>> there.
>
> Using mostly with linux sparc64, but I have openbsd sparc64 installed
> and I can't reproduce it here....
>
> we are using openvpn (2.4.0-6) on sparc64 linux (debian sid/unstable)
> as clients to x86_64 server (openvpn-2.3.14-137.4.x86_64) - works
> without errors.
>
> I made a few tests yesterday with openvpn static key:
>
> 1. server openvpn (2.4.0-6) on sparc64 linux, client is linux
> openvpn-2.3.14-1.fc25.x86_64 - works
>
> 2. server openvpn (2.4.0-6) on sparc64 linux, client openvpn 2.3.11
> openbsd 6.1 sparc64 - works
>
> 3. server 2.3.11 (old 6.0 version) openbsd 6.1 sparc64, client openvpn
> (2.4.0-6) on sparc64 linux - works
>
> 4. server 2.4.1 (6.1 version) openbsd 6.1 sparc64, client openvpn
> (2.4.0-6) on sparc64 linux - works

That's a lot of tests, thank you.  Dunno why you can't reproduce it with
2.4.1 (and 2.3.11 seems to contain the same code in write_tun_header).

[...]

> -bash-4.3$ cat l1.conf
> dev tun
> ifconfig 10.9.0.2 10.9.0.1
> comp-lzo
> mute-replay-warnings
> <secret>
> ...
> </secret>

OpenBSD 6.1 on sparc64, vanilla openvpn-2.4.2 freshly built.  Using
client mode with your configuration snippet and an IPv4 remote, I can
reliably trigger a SIGBUS.

xxx ~/src/openvpn-2.4.2$ gdb src/openvpn/openvpn openvpn.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc64-unknown-openbsd6.1"...
Core was generated by `openvpn'.
Program terminated with signal 10, Bus error.
Loaded symbols for /home/jca/src/openvpn-2.4.2/src/openvpn/openvpn
Reading symbols from /usr/lib/libssl.so.43.2...done.
Loaded symbols for /usr/lib/libssl.so.43.2
Reading symbols from /usr/lib/libcrypto.so.41.1...done.
Loaded symbols for /usr/lib/libcrypto.so.41.1
Reading symbols from /usr/lib/libc.so.89.3...done.
Loaded symbols for /usr/lib/libc.so.89.3
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  write_tun_header (tt=0x1ddd4e1900, buf=0x1d336921c5 "E", len=84) at 
tun.c:1661
1661            if (iph->ip_v == 6)
(gdb)

buf points to an odd address.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to