[PATCH] Fixed null pointer exception when user namespace is empty

Aaron Avery aavery77 at hotmail.com
Sun Oct 17 20:27:04 UTC 2021


Thank you, Jason. Sorry I missed the Signed-off-by. As I said, I'm not that familiar with Linux development.
I'm quite sure I have the correct .config for my QNAP's kernel, and the WG kernel module I built works perfectly, with this patch. All of the *_NS entries in their config file are enabled.

After more research, I agree with you completely that this could easily be a QNAP-specific bug so shouldn't be merged. As a NAS, they probably have some custom network driver code and may have failed to initialize user_ns in this situation. The only somewhat-relevant kernel commit I could find for rtnetlink.c is https://github.com/torvalds/linux/commit/f428fe4a04cc339166c8bbd489789760de3a0cee and version 4.14.24 is more recent than that.

A lot of people like me use a QNAP NAS as their always-on "home server". Hopefully Google will crawl this message list so that tech-savvy people searching for Wireguard QNAP will find this patch and have a chance to use WG to remotely access their home network.

- Aaron

From: Jason A. Donenfeld <Jason at zx2c4.com>
Sent: Saturday, October 16, 2021 7:52 PM
To: Aaron Avery <aavery77 at hotmail.com>
Cc: WireGuard mailing list <wireguard at lists.zx2c4.com>
Subject: Re: [PATCH] Fixed null pointer exception when user namespace is empty 
 
Hi Aaron,

That patch is missing your Signed-off-by line, so I won't be able to
take it as-is.

However, I also wonder if it makes sense. I just grepped the entire
kernel and I couldn't find any other instances of net->user_ns being
NULL checked. Is it possible that there's a bug in QNAP's kernel
somewhere? Or you're compiling against the wrong .config so the struct
offsets are wrong? Or something else? When should net->user_ns be
NULL?

Thanks,
Jason


More information about the WireGuard mailing list