From 63d81e2089c80d7d6131a9ea66dc0e7b5b726361 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Thu, 5 Apr 2018 12:37:17 +0530 Subject: [PATCH] Testing: Add testcase for correlating static local variable This patch adds a reproducer testcase for correlating static local variables added in .rodata* section, ahead of .toc section. This testcase is for issue seen on PowerPC. For more details on the issue refer pull request: 793 and 817. It add's the testcase for: - Fedora-27 Kernel version 4.15.10-300 - Centos-7 Kernel version 3.10.0-693 and - Ubuntu-16.04 Kernel version 4.13.0-25.29 Signed-off-by: Kamalesh Babulal --- .../centos-7/gcc-static-local-var-6.patch | 14 ++++++++++++++ .../fedora-27/gcc-static-local-var-6.patch | 14 ++++++++++++++ .../ubuntu-16.04/gcc-static-local-var-6.patch | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 test/integration/centos-7/gcc-static-local-var-6.patch create mode 100644 test/integration/fedora-27/gcc-static-local-var-6.patch create mode 100644 test/integration/ubuntu-16.04/gcc-static-local-var-6.patch diff --git a/test/integration/centos-7/gcc-static-local-var-6.patch b/test/integration/centos-7/gcc-static-local-var-6.patch new file mode 100644 index 000000000..d04679d95 --- /dev/null +++ b/test/integration/centos-7/gcc-static-local-var-6.patch @@ -0,0 +1,14 @@ +diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c +index a9d587a..23336ed 100644 +--- a/net/ipv6/netfilter.c ++++ b/net/ipv6/netfilter.c +@@ -119,6 +121,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, + struct dst_entry *result; + int err; + ++ if (!jiffies) ++ printk("kpatch nf_ip6_route foo\n"); ++ + result = ip6_route_output(net, sk, &fl->u.ip6); + err = result->error; + if (err) diff --git a/test/integration/fedora-27/gcc-static-local-var-6.patch b/test/integration/fedora-27/gcc-static-local-var-6.patch new file mode 100644 index 000000000..1e068014c --- /dev/null +++ b/test/integration/fedora-27/gcc-static-local-var-6.patch @@ -0,0 +1,14 @@ +diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c +index 9bf2604..026ac6c 100644 +--- a/net/ipv6/netfilter.c ++++ b/net/ipv6/netfilter.c +@@ -122,6 +124,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, + struct dst_entry *result; + int err; + ++ if (!jiffies) ++ printk("kpatch nf_ip6_route foo\n"); ++ + result = ip6_route_output(net, sk, &fl->u.ip6); + err = result->error; + if (err) diff --git a/test/integration/ubuntu-16.04/gcc-static-local-var-6.patch b/test/integration/ubuntu-16.04/gcc-static-local-var-6.patch new file mode 100644 index 000000000..9be90bab4 --- /dev/null +++ b/test/integration/ubuntu-16.04/gcc-static-local-var-6.patch @@ -0,0 +1,14 @@ +diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c +index 39970e2..85e750d 100644 +--- a/net/ipv6/netfilter.c ++++ b/net/ipv6/netfilter.c +@@ -121,6 +123,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, + struct dst_entry *result; + int err; + ++ if (!jiffies) ++ printk("kpatch nf_ip6_route foo\n"); ++ + result = ip6_route_output(net, sk, &fl->u.ip6); + err = result->error; + if (err)