Subject: Re: [vserver] linux 3.14.22 and patch-3.14.17-vs2.3.6.13.diff
From: Corey Wright <undefined@pobox.com>
Date: Sat, 15 Nov 2014 14:57:42 -0600
Sat, 15 Nov 2014 14:57:42 -0600
On Mon, 27 Oct 2014 03:41:34 -0500
Corey Wright <undefined@pobox.com> wrote:

> applying patch-3.14.17-vs2.3.6.13.diff to linux 3.14.22 fails in both
> patching and testing/functionality.

applying patch-3.14.17-vs2.3.6.13.diff to linux 3.14.24 fails in patching.

> the upstream addition of including "linux/hash.h" in "fs/namei.c" [1]
> invalidated the patch hunk context.
> 
> [1]
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-3.10.y&id=d4c96061fddd129778ce8b70fb093aa532f422d0
> 
> the upstream change of masking all capabilities above CAP_LAST_CAP (which the
> linux-vserver patch does not adjust to account for its own CAP_CONTEXT)
> breaks changing/manipulating contexts.
> 
> # vserver-info | grep V
> 
> Assumed 'SYSINFO' as no other option given; try '--help' for more information.
> Versions:
>                    VS-API: ???
>                       VCI: ???
> # chcontext --xid 1 -- true
> chcontext: vc_new_s_context(): Function not implemented
> 
> [2]
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-3.10.y&id=76f01555c78e496203105bd29b878db3431a2260

the upstream addition of including "net/ipv6.h" in "drivers/net/tun.c" [1]
invalidated the patch hunk context.

patching file drivers/net/tun.c
Hunk #1 FAILED at 65.
Hunk #2 succeeded at 171 (offset 1 line).
Hunk #3 succeeded at 405 (offset 1 line).
Hunk #4 succeeded at 1431 (offset 12 lines).
Hunk #5 succeeded at 1648 (offset 12 lines).
Hunk #6 succeeded at 2014 (offset 7 lines).
1 out of 6 hunks FAILED -- saving rejects to file drivers/net/tun.c.rej

[1]
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=63de6fcc826404270c6c576381fd3ad92fd807f9

> the attached patches account for the change in patch hunk context and the
> masking of CAP_CONTEXT.

the attached patch accounts for the change in patch hunk context.

> 1. acquire linux-3.14.22
> 2. apply patch-3.14.17-vs2.3.6.13.diff
> 3. apply the attached patch-3.14.17-19-include_hash-vs2.3.6.13.diff
> 4. apply the attached patch-3.14.17-19-remove_caps-vs2.3.6.13.diff
> 5. manually fix the Makefile reject (EXTRAVERSION)

1. acquire linux-3.14.24
2. apply patch-3.14.17-vs2.3.6.13.diff
3. apply the previously attached
patch-3.14.17-19-include_hash-vs2.3.6.13.diff [2]
4. apply the previously attached patch-3.14.17-19-remove_caps-vs2.3.6.13.diff
[3]
5. apply the attached patch-3.14.17-24-include_ipv6-vs2.3.6.13.diff
6. manually fix the Makefile reject (EXTRAVERSION)

[2]
http://archives.linux-vserver.org/201410/att-0050/patch-3.14.17-19-include_hash-vs2.3.6.13.diff
[3]
http://archives.linux-vserver.org/201410/att-0050/patch-3.14.17-19-remove_caps-vs2.3.6.13.diff

> i've built the resulting kernel and tested it in virtualbox against testme.sh
> and testfs.sh, started-entered-exited-stopped a vserver guest, and (specific
> to the capabilities fix) tested "vserver-info | grep V" and "chcontext --xid
> 1 -- true" (though that's also indirectly tested through testme.sh and
> exercising a vserver guest).

i've built the resulting kernel and tested it in virtualbox against testme.sh
and testfs.sh, and started-entered-exited-stopped a vserver guest.

corey
--
undefined@pobox.com

> corey
> --
> undefined@pobox.com


upstream addition of "#include <net/ipv6.h>" to drivers/net/tun.c invalidated
patch hunk context

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=63de6fcc826404270c6c576381fd3ad92fd807f9

diff -urNpd linux-3.14.24-vs2.3.6.13~/drivers/net/tun.c linux-3.14.24-vs2.3.6.13/drivers/net/tun.c
--- linux-3.14.24-vs2.3.6.13~/drivers/net/tun.c	2014-11-15 12:33:09.000000000 -0600
+++ linux-3.14.24-vs2.3.6.13/drivers/net/tun.c	2014-11-15 12:44:49.000000000 -0600
@@ -65,6 +65,7 @@
 #include <linux/nsproxy.h>
 #include <linux/virtio_net.h>
 #include <linux/rcupdate.h>
+#include <linux/vs_network.h>
 #include <net/ipv6.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>