All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] eppic: Create kernel version compatible scripts
@ 2016-12-21 10:05 Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version Kamalesh Babulal
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Kamalesh Babulal @ 2016-12-21 10:05 UTC (permalink / raw)
  To: kexec; +Cc: Atsushi Kumagai, Kamalesh Babulal

This patch series creates eppic scripts a for range kernel versions
they are compatible with. Eppic scripts directory host sample
scripts to scrub sensitive information from the dump file generated
using makedumpfile.

The initial version of these scripts was based on Fedora 19 kernel.
In brief, these scripts rely on hard coded kernel data structure
member offsets. Kernel data structures are bound to change in due course
and leading to failure when assumptions about the offsets differ.

Atsushi-San suggested that, it's better to have different version of
eppic scripts, those will be valid for the range of kernel release and
their naming convention hinting, of the release they are valid across.

The first patch renames the existing eppic script to reflect the kernel
release they are compatible with. Following the format:
<eppic_script>-<valid from kernel version>_to_<valid until kernel version>.c

Rest of three patches creates new eppic scripts to match with the kernel
data structures they work with.

Kamalesh Babulal (4):
  eppic: Rename scripts to reflect validity of kernel version
  eppic/vhost_net_buffers: Introduce changes for kernel 3.19
  eppic/dir_names: Introduce changes for kernel 3.14
  eppic/keyring: Introduce changes for kernel 4.4

 eppic_scripts/README                           |  26 +-
 eppic_scripts/ap_messages.c                    |  82 ------
 eppic_scripts/ap_messages_3_10_to_4_8.c        |  82 ++++++
 eppic_scripts/dir_names.c                      |  78 -----
 eppic_scripts/dir_names_3_10_to_3_13.c         |  78 +++++
 eppic_scripts/dir_names_3_14_to_4_8.c          |  82 ++++++
 eppic_scripts/keyring.c                        |  57 ----
 eppic_scripts/keyring_3_10_to_4_3.c            |  57 ++++
 eppic_scripts/keyring_4_4_to_4_8.c             | 378 +++++++++++++++++++++++++
 eppic_scripts/proc_names.c                     |  49 ----
 eppic_scripts/proc_names_3_10_to_4_8.c         |  49 ++++
 eppic_scripts/tcp_sk_buf.c                     |  82 ------
 eppic_scripts/tcp_sk_buf_3_10_to_4_8.c         |  82 ++++++
 eppic_scripts/udp_sk_buf.c                     |  83 ------
 eppic_scripts/udp_sk_buf_3_10_to_4_8.c         |  83 ++++++
 eppic_scripts/unix_sk_buff.c                   |  85 ------
 eppic_scripts/unix_sk_buff_3_10_to_4_8.c       |  85 ++++++
 eppic_scripts/vhost_net_buffers.c              |  99 -------
 eppic_scripts/vhost_net_buffers_3_10_to_3_18.c |  99 +++++++
 eppic_scripts/vhost_net_buffers_3_19_to_4_8.c  | 104 +++++++
 eppic_scripts/vhost_scsi_buffers.c             |  75 -----
 eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c |  75 +++++
 22 files changed, 1270 insertions(+), 700 deletions(-)
 delete mode 100644 eppic_scripts/ap_messages.c
 create mode 100644 eppic_scripts/ap_messages_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/dir_names.c
 create mode 100644 eppic_scripts/dir_names_3_10_to_3_13.c
 create mode 100644 eppic_scripts/dir_names_3_14_to_4_8.c
 delete mode 100644 eppic_scripts/keyring.c
 create mode 100644 eppic_scripts/keyring_3_10_to_4_3.c
 create mode 100644 eppic_scripts/keyring_4_4_to_4_8.c
 delete mode 100644 eppic_scripts/proc_names.c
 create mode 100644 eppic_scripts/proc_names_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/tcp_sk_buf.c
 create mode 100644 eppic_scripts/tcp_sk_buf_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/udp_sk_buf.c
 create mode 100644 eppic_scripts/udp_sk_buf_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/unix_sk_buff.c
 create mode 100644 eppic_scripts/unix_sk_buff_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/vhost_net_buffers.c
 create mode 100644 eppic_scripts/vhost_net_buffers_3_10_to_3_18.c
 create mode 100644 eppic_scripts/vhost_net_buffers_3_19_to_4_8.c
 delete mode 100644 eppic_scripts/vhost_scsi_buffers.c
 create mode 100644 eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c

-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version
  2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
@ 2016-12-21 10:05 ` Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 2/4] eppic/vhost_net_buffers: Introduce changes for kernel 3.19 Kamalesh Babulal
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Kamalesh Babulal @ 2016-12-21 10:05 UTC (permalink / raw)
  To: kexec; +Cc: Atsushi Kumagai, Kamalesh Babulal

Rename the eppic script to follow the format:
<eppic_script>-<valid from kernel version>_to_<valid until kernel version>.c

Kernel data structures may be modified across kernel releases and
eppic scripts relies on pre-calculated offsets while de-referring
structure members. Any change to the kernel structure will lead to
failure, if the kernel data structure changes are not propagated to
the eppic scripts.

The idea to keep different versions of sample eppic scripts, which
will be valid for a range of kernel releases. This naming convention
will help users to choose the right eppic script version for their
kernel.

Suggested-by: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
---
 eppic_scripts/README                           | 26 ++++---
 eppic_scripts/ap_messages.c                    | 82 ---------------------
 eppic_scripts/ap_messages_3_10_to_4_8.c        | 82 +++++++++++++++++++++
 eppic_scripts/dir_names.c                      | 78 --------------------
 eppic_scripts/dir_names_3_10_to_3_13.c         | 78 ++++++++++++++++++++
 eppic_scripts/keyring.c                        | 57 ---------------
 eppic_scripts/keyring_3_10_to_4_3.c            | 57 +++++++++++++++
 eppic_scripts/proc_names.c                     | 49 -------------
 eppic_scripts/proc_names_3_10_to_4_8.c         | 49 +++++++++++++
 eppic_scripts/tcp_sk_buf.c                     | 82 ---------------------
 eppic_scripts/tcp_sk_buf_3_10_to_4_8.c         | 82 +++++++++++++++++++++
 eppic_scripts/udp_sk_buf.c                     | 83 ---------------------
 eppic_scripts/udp_sk_buf_3_10_to_4_8.c         | 83 +++++++++++++++++++++
 eppic_scripts/unix_sk_buff.c                   | 85 ----------------------
 eppic_scripts/unix_sk_buff_3_10_to_4_8.c       | 85 ++++++++++++++++++++++
 eppic_scripts/vhost_net_buffers.c              | 99 --------------------------
 eppic_scripts/vhost_net_buffers_3_10_to_3_18.c | 99 ++++++++++++++++++++++++++
 eppic_scripts/vhost_scsi_buffers.c             | 75 -------------------
 eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c | 75 +++++++++++++++++++
 19 files changed, 706 insertions(+), 700 deletions(-)
 delete mode 100644 eppic_scripts/ap_messages.c
 create mode 100644 eppic_scripts/ap_messages_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/dir_names.c
 create mode 100644 eppic_scripts/dir_names_3_10_to_3_13.c
 delete mode 100644 eppic_scripts/keyring.c
 create mode 100644 eppic_scripts/keyring_3_10_to_4_3.c
 delete mode 100644 eppic_scripts/proc_names.c
 create mode 100644 eppic_scripts/proc_names_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/tcp_sk_buf.c
 create mode 100644 eppic_scripts/tcp_sk_buf_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/udp_sk_buf.c
 create mode 100644 eppic_scripts/udp_sk_buf_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/unix_sk_buff.c
 create mode 100644 eppic_scripts/unix_sk_buff_3_10_to_4_8.c
 delete mode 100644 eppic_scripts/vhost_net_buffers.c
 create mode 100644 eppic_scripts/vhost_net_buffers_3_10_to_3_18.c
 delete mode 100644 eppic_scripts/vhost_scsi_buffers.c
 create mode 100644 eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c

diff --git a/eppic_scripts/README b/eppic_scripts/README
index 040b3ba..3038d15 100644
--- a/eppic_scripts/README
+++ b/eppic_scripts/README
@@ -2,9 +2,15 @@
  Eppic scripts README
 ==================================
 
-The eppic scripts are based on the fedora 19 kernel.
+These eppic scripts are based on the fedora 19 kernel. eppic scripts
+naming convention follows the format:
+<eppic_script name>-<valid from kernel version>_to_<valid until kernel version>.c
 
-1. Eppic script: proc_names.c
+For example consider dir_names_3_10_to_3_13.c. This script would scrub
+sensitive information successfully, when run against kernel version >= 3.10
+and kernel version <= 3.13.
+
+1. Eppic script: proc_names_3_10_to_4_8.c
    Description: Scrubs executable name of each user process
 
    Explanation:
@@ -29,7 +35,7 @@ The eppic scripts are based on the fedora 19 kernel.
        }
 
 
-2. Eppic script: dir_names.c
+2. Eppic script: dir_names_3_10_to_3_13.c
    Description: Scrubs filenames of cached dentries
 
    Explanation:
@@ -73,7 +79,7 @@ The eppic scripts are based on the fedora 19 kernel.
                walk_dentries(child);
        }
 
-3. Eppic script: keyring.c
+3. Eppic script: keyring_3_10_to_4_3.c
    Description: Scrubs all entries in the keyring
 
    Explanation:
@@ -114,7 +120,7 @@ The eppic scripts are based on the fedora 19 kernel.
 
        Clear value/rcudata/data dependent on the type of the key.
 
-4. Eppic script: ap_messages.c
+4. Eppic script: ap_messages_3_10_to_4_8.c
    Description: Clear the message data of all ap_bus requests
 
    Explanation:
@@ -158,7 +164,7 @@ The eppic scripts are based on the fedora 19 kernel.
 
        memset(apmsg->message, 0, apmsg->length);
 
-5. Eppic script: tcp_sk_buf.c
+5. Eppic script: tcp_sk_buf_3_10_to_4_8.c
    Description: Scrub data in tcp socket buffers
 
    Explanation:
@@ -206,7 +212,7 @@ The eppic scripts are based on the fedora 19 kernel.
                 ...
            };
 
-6. Eppic script: udp_sk_buf.c
+6. Eppic script: udp_sk_buf_3_10_to_4_8.c
    Description: Scrub data of udp socket buffers
 
    Explanation:
@@ -232,7 +238,7 @@ The eppic scripts are based on the fedora 19 kernel.
       For each struct sk_buff in the two lists clear the memory referenced
       by skb->data / skb->data_len.
 
-7. Eppic script: unix_sk_buf.c
+7. Eppic script: unix_sk_buff_3_10_to_4_8.c
    Description: Scrub data of unix socket buffers
 
    Explanation:
@@ -252,7 +258,7 @@ The eppic scripts are based on the fedora 19 kernel.
        For each struct sk_buff in the two lists clear the memory referenced
        by skb->data / skb->data_len.
 
-8. Eppic script: vhost_net_buffers.c
+8. Eppic script: vhost_net_buffers_3_10_to_3_18.c
    Description: Scrub socket buffers of guest network I/O
 
    Explanation:
@@ -278,7 +284,7 @@ The eppic scripts are based on the fedora 19 kernel.
          sk_write_queue list
 
 
-9. Eppic script: vhost_scsi_buffers.c
+9. Eppic script: vhost_scsi_buffers_3_10_to_4_8.c
    Description: Scrub buffers involved in guest block I/O
 
    Explanation:
diff --git a/eppic_scripts/ap_messages.c b/eppic_scripts/ap_messages.c
deleted file mode 100644
index 849e9bc..0000000
--- a/eppic_scripts/ap_messages.c
+++ /dev/null
@@ -1,82 +0,0 @@
-string
-ap_device_opt()
-{
-	    return "l";
-}
-
-string
-ap_device_usage()
-{
-	    return "\n";
-}
-
-static void
-ap_device_showusage()
-{
-	    printf("usage : ap_device %s", ap_device_usage());
-}
-
-string
-ap_device_help()
-{
-	    return "Help";
-}
-
-int
-ap_device()
-{
-	int i;
-	struct list_head *next;
-	struct list_head *head;
-	struct ap_device *off = 0;
-
-	head = (struct list_head *)&ap_device_list;
-	next = (struct list_head *)head->next;
-
-	if (!next)
-		return 1;
-
-	while (next != head)
-	{
-		struct ap_device *device;
-		struct list_head *next1, *head1;
-
-		device = (struct ap_device *)((unsigned long)next - ((unsigned long)&(off->list)));
-
-		head1 = (struct list_head *)&(device->pendingq);
-		next1 = (struct list_head *)device->pendingq.next;
-
-		while (next1 != head1)
-		{
-			struct ap_message *apmsg;
-			apmsg = (struct ap_message *)next1;
-
-			if (apmsg->length) {
-				memset((char *)apmsg->message, 'L', apmsg->length);
-				memset((char *)&(apmsg->length), 'L', 0x8);
-			}
-
-			next1 = (struct list_head *)apmsg->list.next;
-		}
-
-		head1 = (struct list_head *)&(device->requestq);
-		next1 = (struct list_head *)device->requestq.next;
-
-		while (next1 != head1)
-		{
-			struct ap_message *apmsg;
-			apmsg = (struct ap_message *)next1;
-
-			if (apmsg->length) {
-				memset((char *)apmsg->message, 'L', apmsg->length);
-				memset((char *)&(apmsg->length), 'L', 0x8);
-			}
-
-			next1 = (struct list_head *)apmsg->list.next;
-		}
-
-		next = (struct list_head *)device->list.next;
-	}
-
-	return 1;
-}
diff --git a/eppic_scripts/ap_messages_3_10_to_4_8.c b/eppic_scripts/ap_messages_3_10_to_4_8.c
new file mode 100644
index 0000000..849e9bc
--- /dev/null
+++ b/eppic_scripts/ap_messages_3_10_to_4_8.c
@@ -0,0 +1,82 @@
+string
+ap_device_opt()
+{
+	    return "l";
+}
+
+string
+ap_device_usage()
+{
+	    return "\n";
+}
+
+static void
+ap_device_showusage()
+{
+	    printf("usage : ap_device %s", ap_device_usage());
+}
+
+string
+ap_device_help()
+{
+	    return "Help";
+}
+
+int
+ap_device()
+{
+	int i;
+	struct list_head *next;
+	struct list_head *head;
+	struct ap_device *off = 0;
+
+	head = (struct list_head *)&ap_device_list;
+	next = (struct list_head *)head->next;
+
+	if (!next)
+		return 1;
+
+	while (next != head)
+	{
+		struct ap_device *device;
+		struct list_head *next1, *head1;
+
+		device = (struct ap_device *)((unsigned long)next - ((unsigned long)&(off->list)));
+
+		head1 = (struct list_head *)&(device->pendingq);
+		next1 = (struct list_head *)device->pendingq.next;
+
+		while (next1 != head1)
+		{
+			struct ap_message *apmsg;
+			apmsg = (struct ap_message *)next1;
+
+			if (apmsg->length) {
+				memset((char *)apmsg->message, 'L', apmsg->length);
+				memset((char *)&(apmsg->length), 'L', 0x8);
+			}
+
+			next1 = (struct list_head *)apmsg->list.next;
+		}
+
+		head1 = (struct list_head *)&(device->requestq);
+		next1 = (struct list_head *)device->requestq.next;
+
+		while (next1 != head1)
+		{
+			struct ap_message *apmsg;
+			apmsg = (struct ap_message *)next1;
+
+			if (apmsg->length) {
+				memset((char *)apmsg->message, 'L', apmsg->length);
+				memset((char *)&(apmsg->length), 'L', 0x8);
+			}
+
+			next1 = (struct list_head *)apmsg->list.next;
+		}
+
+		next = (struct list_head *)device->list.next;
+	}
+
+	return 1;
+}
diff --git a/eppic_scripts/dir_names.c b/eppic_scripts/dir_names.c
deleted file mode 100644
index dbe6d00..0000000
--- a/eppic_scripts/dir_names.c
+++ /dev/null
@@ -1,78 +0,0 @@
-string
-vfs_opt()
-{
-	    return "l";
-}
-
-string
-vfs_usage()
-{
-	    return "\n";
-}
-
-static void
-vfs_showusage()
-{
-	    printf("usage : vfs %s", vfs_usage());
-}
-
-string
-vfs_help()
-{
-	    return "Help";
-}
-
-void
-rm_names(struct dentry *dir)
-{
-	struct list_head *next, *head;
-
-	memset(dir->d_iname, 0, 0x20);
-	memset(dir->d_name.name, 0, 0x20);
-
-	head = (struct list_head *)&(dir->d_subdirs);
-	next = (struct list_head *)dir->d_subdirs.next;
-
-	while (next != head)
-	{
-		struct dentry *child, *off = 0;
-
-		child = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_u));
-		rm_names(child);
-		next = child->d_u.d_child.next;
-	}
-
-	return;
-}
-
-int
-vfs()
-{
-	int i;
-	struct list_head *tab;
-
-	tab = (struct list_head *)mount_hashtable;
-
-	for (i = 0; i < 256; i++)
-	{
-		struct list_head *head, *next;
-
-		head = (struct list_head *) (tab + i);
-		next = (struct list_head *) head->next;
-
-		if (!next)
-			continue;
-
-		while (next != head)
-		{
-			struct mount *mntfs;
-			struct dentry *root;
-
-			mntfs = (struct mount *)((unsigned long)next);
-			root = (struct dentry *)mntfs->mnt.mnt_root;
-			rm_names(root);
-			next = mntfs->mnt_hash.next;
-		}
-	}
-	return 1;
-}
diff --git a/eppic_scripts/dir_names_3_10_to_3_13.c b/eppic_scripts/dir_names_3_10_to_3_13.c
new file mode 100644
index 0000000..dbe6d00
--- /dev/null
+++ b/eppic_scripts/dir_names_3_10_to_3_13.c
@@ -0,0 +1,78 @@
+string
+vfs_opt()
+{
+	    return "l";
+}
+
+string
+vfs_usage()
+{
+	    return "\n";
+}
+
+static void
+vfs_showusage()
+{
+	    printf("usage : vfs %s", vfs_usage());
+}
+
+string
+vfs_help()
+{
+	    return "Help";
+}
+
+void
+rm_names(struct dentry *dir)
+{
+	struct list_head *next, *head;
+
+	memset(dir->d_iname, 0, 0x20);
+	memset(dir->d_name.name, 0, 0x20);
+
+	head = (struct list_head *)&(dir->d_subdirs);
+	next = (struct list_head *)dir->d_subdirs.next;
+
+	while (next != head)
+	{
+		struct dentry *child, *off = 0;
+
+		child = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_u));
+		rm_names(child);
+		next = child->d_u.d_child.next;
+	}
+
+	return;
+}
+
+int
+vfs()
+{
+	int i;
+	struct list_head *tab;
+
+	tab = (struct list_head *)mount_hashtable;
+
+	for (i = 0; i < 256; i++)
+	{
+		struct list_head *head, *next;
+
+		head = (struct list_head *) (tab + i);
+		next = (struct list_head *) head->next;
+
+		if (!next)
+			continue;
+
+		while (next != head)
+		{
+			struct mount *mntfs;
+			struct dentry *root;
+
+			mntfs = (struct mount *)((unsigned long)next);
+			root = (struct dentry *)mntfs->mnt.mnt_root;
+			rm_names(root);
+			next = mntfs->mnt_hash.next;
+		}
+	}
+	return 1;
+}
diff --git a/eppic_scripts/keyring.c b/eppic_scripts/keyring.c
deleted file mode 100644
index 22e7db8..0000000
--- a/eppic_scripts/keyring.c
+++ /dev/null
@@ -1,57 +0,0 @@
-string
-skey_opt()
-{
-	    return "l";
-}
-
-string
-skey_usage()
-{
-	    return "\n";
-}
-
-static void
-skey_showusage()
-{
-	    printf("usage : skey %s", skey_usage());
-}
-
-string
-skey_help()
-{
-	    return "Help";
-}
-
-int
-skey()
-{
-	int i;
-	struct list_head **tab;
-
-	tab = &keyring_name_hash;
-
-	for (i = 0; i < 32; i++)
-	{
-		struct list_head *next, *head;
-
-		head = (struct list_head *) (tab + i);
-		next = (struct list_head *) head->next;
-
-		if (!next)
-			continue;
-
-		while (next != head)
-		{
-			struct key *mykey, *off = 0;
-
-			mykey = (struct key *)((unsigned long)(next) - ((unsigned long)&(off->type_data)));
-
-			memset((char *)&(mykey->payload.value), 'A', 0x8);
-			memset((char *)mykey->payload.rcudata, 'A', 0x20);
-			memset((char *)mykey->payload.data, 'A', 0x20);
-
-			next = (struct list_head *) mykey->type_data.link.next;
-		}
-	}
-	return 1;
-}
diff --git a/eppic_scripts/keyring_3_10_to_4_3.c b/eppic_scripts/keyring_3_10_to_4_3.c
new file mode 100644
index 0000000..22e7db8
--- /dev/null
+++ b/eppic_scripts/keyring_3_10_to_4_3.c
@@ -0,0 +1,57 @@
+string
+skey_opt()
+{
+	    return "l";
+}
+
+string
+skey_usage()
+{
+	    return "\n";
+}
+
+static void
+skey_showusage()
+{
+	    printf("usage : skey %s", skey_usage());
+}
+
+string
+skey_help()
+{
+	    return "Help";
+}
+
+int
+skey()
+{
+	int i;
+	struct list_head **tab;
+
+	tab = &keyring_name_hash;
+
+	for (i = 0; i < 32; i++)
+	{
+		struct list_head *next, *head;
+
+		head = (struct list_head *) (tab + i);
+		next = (struct list_head *) head->next;
+
+		if (!next)
+			continue;
+
+		while (next != head)
+		{
+			struct key *mykey, *off = 0;
+
+			mykey = (struct key *)((unsigned long)(next) - ((unsigned long)&(off->type_data)));
+
+			memset((char *)&(mykey->payload.value), 'A', 0x8);
+			memset((char *)mykey->payload.rcudata, 'A', 0x20);
+			memset((char *)mykey->payload.data, 'A', 0x20);
+
+			next = (struct list_head *) mykey->type_data.link.next;
+		}
+	}
+	return 1;
+}
diff --git a/eppic_scripts/proc_names.c b/eppic_scripts/proc_names.c
deleted file mode 100644
index 12876df..0000000
--- a/eppic_scripts/proc_names.c
+++ /dev/null
@@ -1,49 +0,0 @@
-string
-proc_opt()
-{
-	    return "l";
-}
-
-string
-proc_usage()
-{
-	    return "\n";
-}
-
-static void
-proc_showusage()
-{
-	    printf("usage : proc %s", proc_usage());
-}
-
-string
-proc_help()
-{
-	    return "Help";
-}
-
-int
-proc()
-{
-	struct list_head *head, *next;
-	struct task_struct *tsk;
-
-	tsk = &init_task;
-
-	head = (struct list_head *) &(tsk->tasks);
-	next = (struct list_head *) tsk->tasks.next;
-
-	while (next != head)
-	{
-		struct task_struct *task, *off = 0;
-
-		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
-
-		if (task->mm)
-			memset((char *)task->comm, 'L', 0x16);
-
-		next = (struct list_head *)task->tasks.next;
-	}
-
-	return 1;
-}
diff --git a/eppic_scripts/proc_names_3_10_to_4_8.c b/eppic_scripts/proc_names_3_10_to_4_8.c
new file mode 100644
index 0000000..12876df
--- /dev/null
+++ b/eppic_scripts/proc_names_3_10_to_4_8.c
@@ -0,0 +1,49 @@
+string
+proc_opt()
+{
+	    return "l";
+}
+
+string
+proc_usage()
+{
+	    return "\n";
+}
+
+static void
+proc_showusage()
+{
+	    printf("usage : proc %s", proc_usage());
+}
+
+string
+proc_help()
+{
+	    return "Help";
+}
+
+int
+proc()
+{
+	struct list_head *head, *next;
+	struct task_struct *tsk;
+
+	tsk = &init_task;
+
+	head = (struct list_head *) &(tsk->tasks);
+	next = (struct list_head *) tsk->tasks.next;
+
+	while (next != head)
+	{
+		struct task_struct *task, *off = 0;
+
+		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
+
+		if (task->mm)
+			memset((char *)task->comm, 'L', 0x16);
+
+		next = (struct list_head *)task->tasks.next;
+	}
+
+	return 1;
+}
diff --git a/eppic_scripts/tcp_sk_buf.c b/eppic_scripts/tcp_sk_buf.c
deleted file mode 100644
index 922f507..0000000
--- a/eppic_scripts/tcp_sk_buf.c
+++ /dev/null
@@ -1,82 +0,0 @@
-string
-tcp_opt()
-{
-	    return "l";
-}
-
-string
-tcp_usage()
-{
-	    return "\n";
-}
-
-static void
-tcp_showusage()
-{
-	    printf("usage : tcp %s", tcp_non_legacy_usage());
-}
-
-string
-tcp_help()
-{
-	    return "Help";
-}
-
-int
-tcp()
-{
-	int i;
-	struct inet_hashinfo *tab;
-	struct sock_common *off = 0;
-
-	tab = &tcp_hashinfo;
-
-	for (i = 0; i < 32; i++) {
-		struct hlist_nulls_node *pos;
-
-		pos = tab->listening_hash[i].head.first;
-
-		while (!((unsigned long)pos & 1)) {
-			struct sock *sk;
-			struct sk_buff *next;
-			struct sk_buff_head *head;
-			struct hlist_nulls_node *node;
-
-			sk  = (struct sock *)((unsigned long)pos - (unsigned long)&(off->skc_dontcopy_begin));
-
-			head = (struct sk_buff_head *)&(sk->sk_receive_queue);
-			next = (struct sk_buff *)sk->sk_receive_queue.next;
-
-			while (next != head)
-			{
-				struct sk_buff *buff = (struct sk_buff *) next;
-
-				if (buff->data_len) {
-					memset((char *)buff->data, 'L', buff->data_len);
-					memset((char *)&(buff->data_len), 'L', 0x4);
-				}
-
-				next = buff->next;
-			}
-
-			head = (struct sk_buff_head *)&(sk->sk_write_queue);
-			next = (struct sk_buff *)sk->sk_write_queue.next;
-
-			while (next != head)
-			{
-				struct sk_buff *buff = (struct sk_buff *) next;
-
-				if (buff->data_len) {
-					memset((char *)buff->data, 'L', buff->data_len);
-					memset((char *)&(buff->data_len), 'L', 0x4);
-				}
-
-				next = buff->next;
-			}
-
-			node = (struct hlist_nulls_node *)((unsigned long)sk + (unsigned long)&(off->skc_dontcopy_begin));
-			pos = node->next;
-		}
-	}
-	return 1;
-}
diff --git a/eppic_scripts/tcp_sk_buf_3_10_to_4_8.c b/eppic_scripts/tcp_sk_buf_3_10_to_4_8.c
new file mode 100644
index 0000000..922f507
--- /dev/null
+++ b/eppic_scripts/tcp_sk_buf_3_10_to_4_8.c
@@ -0,0 +1,82 @@
+string
+tcp_opt()
+{
+	    return "l";
+}
+
+string
+tcp_usage()
+{
+	    return "\n";
+}
+
+static void
+tcp_showusage()
+{
+	    printf("usage : tcp %s", tcp_non_legacy_usage());
+}
+
+string
+tcp_help()
+{
+	    return "Help";
+}
+
+int
+tcp()
+{
+	int i;
+	struct inet_hashinfo *tab;
+	struct sock_common *off = 0;
+
+	tab = &tcp_hashinfo;
+
+	for (i = 0; i < 32; i++) {
+		struct hlist_nulls_node *pos;
+
+		pos = tab->listening_hash[i].head.first;
+
+		while (!((unsigned long)pos & 1)) {
+			struct sock *sk;
+			struct sk_buff *next;
+			struct sk_buff_head *head;
+			struct hlist_nulls_node *node;
+
+			sk  = (struct sock *)((unsigned long)pos - (unsigned long)&(off->skc_dontcopy_begin));
+
+			head = (struct sk_buff_head *)&(sk->sk_receive_queue);
+			next = (struct sk_buff *)sk->sk_receive_queue.next;
+
+			while (next != head)
+			{
+				struct sk_buff *buff = (struct sk_buff *) next;
+
+				if (buff->data_len) {
+					memset((char *)buff->data, 'L', buff->data_len);
+					memset((char *)&(buff->data_len), 'L', 0x4);
+				}
+
+				next = buff->next;
+			}
+
+			head = (struct sk_buff_head *)&(sk->sk_write_queue);
+			next = (struct sk_buff *)sk->sk_write_queue.next;
+
+			while (next != head)
+			{
+				struct sk_buff *buff = (struct sk_buff *) next;
+
+				if (buff->data_len) {
+					memset((char *)buff->data, 'L', buff->data_len);
+					memset((char *)&(buff->data_len), 'L', 0x4);
+				}
+
+				next = buff->next;
+			}
+
+			node = (struct hlist_nulls_node *)((unsigned long)sk + (unsigned long)&(off->skc_dontcopy_begin));
+			pos = node->next;
+		}
+	}
+	return 1;
+}
diff --git a/eppic_scripts/udp_sk_buf.c b/eppic_scripts/udp_sk_buf.c
deleted file mode 100644
index ca8c77b..0000000
--- a/eppic_scripts/udp_sk_buf.c
+++ /dev/null
@@ -1,83 +0,0 @@
-string
-udp_opt()
-{
-	    return "l";
-}
-
-string
-udp_usage()
-{
-	    return "\n";
-}
-
-static void
-udp_showusage()
-{
-	    printf("usage : udp %s", udp_usage());
-}
-
-string
-udp_help()
-{
-	    return "Help";
-}
-
-int
-udp()
-{
-	int i;
-	int size;
-	struct udp_table *table;
-	struct sock_common *off = 0;
-
-	table = (struct udp_table *)&udp_table;
-
-	for (i = 0; i < table->mask; i++) {
-		struct hlist_nulls_node *pos;
-
-		pos = table->hash[i].head.first;
-
-		while (!((unsigned long)pos & 1)) {
-			struct sock *sk;
-			struct sk_buff *next;
-			struct sk_buff_head *head;
-			struct hlist_nulls_node *node;
-
-			sk  = (struct sock *)((unsigned long)pos - ((unsigned long)&(off->skc_dontcopy_begin)));
-
-			head = (struct sk_buff_head *)&(sk->sk_receive_queue);
-			next = (struct sk_buff *)sk->sk_receive_queue.next;
-
-			while (next != head)
-			{
-				struct sk_buff *buff = (struct sk_buff *)next;
-
-				if (buff->data_len) {
-					memset((char *)buff->data, 'L', buff->data_len);
-					memset((char *)&(buff->data_len), 'L', 0x4);
-				}
-
-				next = buff->next;
-			}
-
-                        head = (struct sk_buff_head *)&(sk->sk_write_queue);
-			next = (struct sk_buff *)sk->sk_write_queue.next;
-
-			while (next != head)
-			{
-				struct sk_buff *buff = (struct sk_buff *)next;
-
-				if (buff->data_len) {
-					memset((char *)buff->data, 'L', buff->data_len);
-					memset((char *)&(buff->data_len), 'L', 0x4);
-				}
-
-				next = buff->next;
-                        }
-
-			node = (struct hlist_nulls_node *)((unsigned long)sk + (unsigned long)&(off->skc_dontcopy_begin));
-		        pos = node->next;
-		}
-	}
-	return 1;
-}
diff --git a/eppic_scripts/udp_sk_buf_3_10_to_4_8.c b/eppic_scripts/udp_sk_buf_3_10_to_4_8.c
new file mode 100644
index 0000000..ca8c77b
--- /dev/null
+++ b/eppic_scripts/udp_sk_buf_3_10_to_4_8.c
@@ -0,0 +1,83 @@
+string
+udp_opt()
+{
+	    return "l";
+}
+
+string
+udp_usage()
+{
+	    return "\n";
+}
+
+static void
+udp_showusage()
+{
+	    printf("usage : udp %s", udp_usage());
+}
+
+string
+udp_help()
+{
+	    return "Help";
+}
+
+int
+udp()
+{
+	int i;
+	int size;
+	struct udp_table *table;
+	struct sock_common *off = 0;
+
+	table = (struct udp_table *)&udp_table;
+
+	for (i = 0; i < table->mask; i++) {
+		struct hlist_nulls_node *pos;
+
+		pos = table->hash[i].head.first;
+
+		while (!((unsigned long)pos & 1)) {
+			struct sock *sk;
+			struct sk_buff *next;
+			struct sk_buff_head *head;
+			struct hlist_nulls_node *node;
+
+			sk  = (struct sock *)((unsigned long)pos - ((unsigned long)&(off->skc_dontcopy_begin)));
+
+			head = (struct sk_buff_head *)&(sk->sk_receive_queue);
+			next = (struct sk_buff *)sk->sk_receive_queue.next;
+
+			while (next != head)
+			{
+				struct sk_buff *buff = (struct sk_buff *)next;
+
+				if (buff->data_len) {
+					memset((char *)buff->data, 'L', buff->data_len);
+					memset((char *)&(buff->data_len), 'L', 0x4);
+				}
+
+				next = buff->next;
+			}
+
+                        head = (struct sk_buff_head *)&(sk->sk_write_queue);
+			next = (struct sk_buff *)sk->sk_write_queue.next;
+
+			while (next != head)
+			{
+				struct sk_buff *buff = (struct sk_buff *)next;
+
+				if (buff->data_len) {
+					memset((char *)buff->data, 'L', buff->data_len);
+					memset((char *)&(buff->data_len), 'L', 0x4);
+				}
+
+				next = buff->next;
+                        }
+
+			node = (struct hlist_nulls_node *)((unsigned long)sk + (unsigned long)&(off->skc_dontcopy_begin));
+		        pos = node->next;
+		}
+	}
+	return 1;
+}
diff --git a/eppic_scripts/unix_sk_buff.c b/eppic_scripts/unix_sk_buff.c
deleted file mode 100644
index 12e1e6c..0000000
--- a/eppic_scripts/unix_sk_buff.c
+++ /dev/null
@@ -1,85 +0,0 @@
-string
-sunix_opt()
-{
-	    return "l";
-}
-
-string
-sunix_usage()
-{
-	    return "\n";
-}
-
-static void
-sunix_showusage()
-{
-	    printf("usage : sunix %s", sunix_usage());
-}
-
-string
-sunix_help()
-{
-	    return "Help";
-}
-
-int
-sunix()
-{
-	int i;
-	int size;
-	struct hlist_head **tab;
-	struct sock_common *off = 0;
-
-	tab = &unix_socket_table;
-
-	for (i = 0; i < 256; i++) {
-		struct hlist_node *pos;
-		struct hlist_node *node;
-		struct hlist_head *tmp;
-
-		tmp = (struct hlist_head *)(tab + i);
-		pos = tmp->first;
-
-		while (pos) {
-			struct sock *sk;
-			struct sk_buff *next;
-			struct sk_buff_head *head;
-
-			sk = (struct sock *)((unsigned long)pos - (unsigned long)&(off->skc_dontcopy_begin));
-
-			head = (struct sk_buff_head *)&(sk->sk_receive_queue);
-			next = (struct sk_buff *)sk->sk_receive_queue.next;
-
-			while (next != head)
-			{
-				struct sk_buff *buff = (struct sk_buff *)next;
-
-				if (buff->data_len) {
-					memset((char *)buff->data, 'L', buff->data_len);
-					memset((char *)&(buff->data_len), 'L', 0x4);
-				}
-
-				next = buff->next;
-			}
-
-			head = (struct sk_buff_head *)&(sk->sk_write_queue);
-			next = (struct sk_buff *)sk->sk_write_queue.next;
-
-			while (next != head)
-			{
-				struct sk_buff *buff = (struct sk_buff *)next;
-
-				if (buff->data_len) {
-					memset((char *)buff->data, 'L', buff->data_len);
-					memset((char *)&(buff->data_len), 'L', 0x4);
-				}
-
-			        next = buff->next;
-			}
-
-			node = (struct hlist_node *)((unsigned long)sk + (unsigned long)&(off->skc_dontcopy_begin));
-			pos = node->next;
-		}
-	}
-	return 1;
-}
diff --git a/eppic_scripts/unix_sk_buff_3_10_to_4_8.c b/eppic_scripts/unix_sk_buff_3_10_to_4_8.c
new file mode 100644
index 0000000..12e1e6c
--- /dev/null
+++ b/eppic_scripts/unix_sk_buff_3_10_to_4_8.c
@@ -0,0 +1,85 @@
+string
+sunix_opt()
+{
+	    return "l";
+}
+
+string
+sunix_usage()
+{
+	    return "\n";
+}
+
+static void
+sunix_showusage()
+{
+	    printf("usage : sunix %s", sunix_usage());
+}
+
+string
+sunix_help()
+{
+	    return "Help";
+}
+
+int
+sunix()
+{
+	int i;
+	int size;
+	struct hlist_head **tab;
+	struct sock_common *off = 0;
+
+	tab = &unix_socket_table;
+
+	for (i = 0; i < 256; i++) {
+		struct hlist_node *pos;
+		struct hlist_node *node;
+		struct hlist_head *tmp;
+
+		tmp = (struct hlist_head *)(tab + i);
+		pos = tmp->first;
+
+		while (pos) {
+			struct sock *sk;
+			struct sk_buff *next;
+			struct sk_buff_head *head;
+
+			sk = (struct sock *)((unsigned long)pos - (unsigned long)&(off->skc_dontcopy_begin));
+
+			head = (struct sk_buff_head *)&(sk->sk_receive_queue);
+			next = (struct sk_buff *)sk->sk_receive_queue.next;
+
+			while (next != head)
+			{
+				struct sk_buff *buff = (struct sk_buff *)next;
+
+				if (buff->data_len) {
+					memset((char *)buff->data, 'L', buff->data_len);
+					memset((char *)&(buff->data_len), 'L', 0x4);
+				}
+
+				next = buff->next;
+			}
+
+			head = (struct sk_buff_head *)&(sk->sk_write_queue);
+			next = (struct sk_buff *)sk->sk_write_queue.next;
+
+			while (next != head)
+			{
+				struct sk_buff *buff = (struct sk_buff *)next;
+
+				if (buff->data_len) {
+					memset((char *)buff->data, 'L', buff->data_len);
+					memset((char *)&(buff->data_len), 'L', 0x4);
+				}
+
+			        next = buff->next;
+			}
+
+			node = (struct hlist_node *)((unsigned long)sk + (unsigned long)&(off->skc_dontcopy_begin));
+			pos = node->next;
+		}
+	}
+	return 1;
+}
diff --git a/eppic_scripts/vhost_net_buffers.c b/eppic_scripts/vhost_net_buffers.c
deleted file mode 100644
index 39ae595..0000000
--- a/eppic_scripts/vhost_net_buffers.c
+++ /dev/null
@@ -1,99 +0,0 @@
-string
-vhost_opt()
-{
-	    return "l";
-}
-
-string
-vhost_usage()
-{
-	    return "\n";
-}
-
-static void
-vhost_showusage()
-{
-	    printf("usage : net_ %s", vhost_usage());
-}
-
-string
-vhost_help()
-{
-	    return "Help";
-}
-
-void
-vhost_net(struct vhost_net *net)
-{
-	int i;
-
-	for (i = 0; i < 2; i++) {
-		struct vhost_net_virtqueue *nvq = &net->vqs[i];
-		struct vhost_virtqueue *vq = &nvq->vq;
-		struct socket *sock = (struct socket *)vq->private_data;
-		struct sock *sk = sock->sk;
-
-		struct sk_buff_head *head = &(sk->sk_receive_queue);
-		struct sk_buff *next = sk->sk_receive_queue.next;
-
-		while (next != head)
-		{
-			struct sk_buff *buff = (struct sk_buff *) next;
-
-			if (buff->data_len) {
-				memset((char *)buff->data, 'L', buff->data_len);
-				memset((char *)&(buff->data_len), 'L', 0x4);
-			}
-
-			next = buff->next;
-		}
-
-		head = (struct sk_buff_head *)&(sk->sk_write_queue);
-		next = (struct sk_buff *)sk->sk_write_queue.next;
-
-		while (next != head)
-		{
-			struct sk_buff *buff = (struct sk_buff *) next;
-
-			if (buff->data_len) {
-				memset((char *)buff->data, 'L', buff->data_len);
-				memset((char *)&(buff->data_len), 'L', 0x4);
-			}
-
-			next = buff->next;
-
-		}
-	}
-}
-
-int
-vhost()
-{
-	struct list_head *head, *next;
-	struct task_struct *tsk;
-
-	tsk = &init_task;
-
-	head = (struct list_head *) &(tsk->tasks);
-	next = (struct list_head *) tsk->tasks.next;
-
-	while (next != head)
-	{
-		int i;
-		struct task_struct *task, *off = 0;
-
-		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
-
-		if (task->files && task->files->fdt) {
-			for (i = 0; i < task->files->fdt->max_fds; i++) {
-				if (task->files->fdt->fd[i] && task->files->fdt->fd[i]->f_op
-					&& task->files->fdt->fd[i]->f_op->open == &vhost_net_open)
-					vhost_net((struct vhost_net *)task->files->fdt->fd[i]->private_data);
-			}
-		}
-
-		next = (struct list_head *)task->tasks.next;
-	}
-
-	return 1;
-}
diff --git a/eppic_scripts/vhost_net_buffers_3_10_to_3_18.c b/eppic_scripts/vhost_net_buffers_3_10_to_3_18.c
new file mode 100644
index 0000000..39ae595
--- /dev/null
+++ b/eppic_scripts/vhost_net_buffers_3_10_to_3_18.c
@@ -0,0 +1,99 @@
+string
+vhost_opt()
+{
+	    return "l";
+}
+
+string
+vhost_usage()
+{
+	    return "\n";
+}
+
+static void
+vhost_showusage()
+{
+	    printf("usage : net_ %s", vhost_usage());
+}
+
+string
+vhost_help()
+{
+	    return "Help";
+}
+
+void
+vhost_net(struct vhost_net *net)
+{
+	int i;
+
+	for (i = 0; i < 2; i++) {
+		struct vhost_net_virtqueue *nvq = &net->vqs[i];
+		struct vhost_virtqueue *vq = &nvq->vq;
+		struct socket *sock = (struct socket *)vq->private_data;
+		struct sock *sk = sock->sk;
+
+		struct sk_buff_head *head = &(sk->sk_receive_queue);
+		struct sk_buff *next = sk->sk_receive_queue.next;
+
+		while (next != head)
+		{
+			struct sk_buff *buff = (struct sk_buff *) next;
+
+			if (buff->data_len) {
+				memset((char *)buff->data, 'L', buff->data_len);
+				memset((char *)&(buff->data_len), 'L', 0x4);
+			}
+
+			next = buff->next;
+		}
+
+		head = (struct sk_buff_head *)&(sk->sk_write_queue);
+		next = (struct sk_buff *)sk->sk_write_queue.next;
+
+		while (next != head)
+		{
+			struct sk_buff *buff = (struct sk_buff *) next;
+
+			if (buff->data_len) {
+				memset((char *)buff->data, 'L', buff->data_len);
+				memset((char *)&(buff->data_len), 'L', 0x4);
+			}
+
+			next = buff->next;
+
+		}
+	}
+}
+
+int
+vhost()
+{
+	struct list_head *head, *next;
+	struct task_struct *tsk;
+
+	tsk = &init_task;
+
+	head = (struct list_head *) &(tsk->tasks);
+	next = (struct list_head *) tsk->tasks.next;
+
+	while (next != head)
+	{
+		int i;
+		struct task_struct *task, *off = 0;
+
+		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
+
+		if (task->files && task->files->fdt) {
+			for (i = 0; i < task->files->fdt->max_fds; i++) {
+				if (task->files->fdt->fd[i] && task->files->fdt->fd[i]->f_op
+					&& task->files->fdt->fd[i]->f_op->open == &vhost_net_open)
+					vhost_net((struct vhost_net *)task->files->fdt->fd[i]->private_data);
+			}
+		}
+
+		next = (struct list_head *)task->tasks.next;
+	}
+
+	return 1;
+}
diff --git a/eppic_scripts/vhost_scsi_buffers.c b/eppic_scripts/vhost_scsi_buffers.c
deleted file mode 100644
index 840cdd5..0000000
--- a/eppic_scripts/vhost_scsi_buffers.c
+++ /dev/null
@@ -1,75 +0,0 @@
-string
-vhost_opt()
-{
-	    return "l";
-}
-
-string
-vhost_usage()
-{
-	    return "\n";
-}
-
-static void
-vhost_showusage()
-{
-	    printf("usage : vhost %s", vhost_usage());
-}
-
-string
-vhost_help()
-{
-	    return "Help";
-}
-
-void
-vhost_scsi(struct vhost_scsi *vs)
-{
-	if (vs == NULL)
-		return;
-
-	for (i = 0; i < 128; i++) {
-		struct vhost_virtqueue *vq = (struct vhost_virtqueue *)vs->vqs[i].vq;
-
-		for (j = 0; j < 1024; j++) {
-
-			if (vq->iov[j].iov_len) {
-				memset((char *)vq->iov[j].iov_base, 'L', vq->iov[j].iov_len);
-				memset((char *)&(vq->iov[j].iov_len), 'L', 0x8);
-			}
-		}
-	}
-}
-
-int
-vhost()
-{
-	struct list_head *head, *next;
-	struct task_struct *tsk;
-
-	tsk = &init_task;
-
-	head = (struct list_head *) &(tsk->tasks);
-	next = (struct list_head *) tsk->tasks.next;
-
-	while (next != head)
-	{
-		int i;
-		struct task_struct *task, *off = 0;
-
-		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
-
-		if (task->files && task->files->fdt) {
-			for (i = 0; i < task->files->fdt->max_fds; i++) {
-				if (task->files->fdt->fd[i] && task->files->fdt->fd[i]->f_op
-					&& task->files->fdt->fd[i]->f_op->open == &vhost_scsi_open)
-					vhost_scsi((struct vhost_scsi *)task->files->fdt->fd[i]->private_data);
-			}
-		}
-
-
-		next = (struct list_head *)task->tasks.next;
-	}
-
-	return 1;
-}
diff --git a/eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c b/eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c
new file mode 100644
index 0000000..840cdd5
--- /dev/null
+++ b/eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c
@@ -0,0 +1,75 @@
+string
+vhost_opt()
+{
+	    return "l";
+}
+
+string
+vhost_usage()
+{
+	    return "\n";
+}
+
+static void
+vhost_showusage()
+{
+	    printf("usage : vhost %s", vhost_usage());
+}
+
+string
+vhost_help()
+{
+	    return "Help";
+}
+
+void
+vhost_scsi(struct vhost_scsi *vs)
+{
+	if (vs == NULL)
+		return;
+
+	for (i = 0; i < 128; i++) {
+		struct vhost_virtqueue *vq = (struct vhost_virtqueue *)vs->vqs[i].vq;
+
+		for (j = 0; j < 1024; j++) {
+
+			if (vq->iov[j].iov_len) {
+				memset((char *)vq->iov[j].iov_base, 'L', vq->iov[j].iov_len);
+				memset((char *)&(vq->iov[j].iov_len), 'L', 0x8);
+			}
+		}
+	}
+}
+
+int
+vhost()
+{
+	struct list_head *head, *next;
+	struct task_struct *tsk;
+
+	tsk = &init_task;
+
+	head = (struct list_head *) &(tsk->tasks);
+	next = (struct list_head *) tsk->tasks.next;
+
+	while (next != head)
+	{
+		int i;
+		struct task_struct *task, *off = 0;
+
+		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
+
+		if (task->files && task->files->fdt) {
+			for (i = 0; i < task->files->fdt->max_fds; i++) {
+				if (task->files->fdt->fd[i] && task->files->fdt->fd[i]->f_op
+					&& task->files->fdt->fd[i]->f_op->open == &vhost_scsi_open)
+					vhost_scsi((struct vhost_scsi *)task->files->fdt->fd[i]->private_data);
+			}
+		}
+
+
+		next = (struct list_head *)task->tasks.next;
+	}
+
+	return 1;
+}
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RFC PATCH 2/4] eppic/vhost_net_buffers: Introduce changes for kernel 3.19
  2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version Kamalesh Babulal
@ 2016-12-21 10:05 ` Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 3/4] eppic/dir_names: Introduce changes for kernel 3.14 Kamalesh Babulal
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Kamalesh Babulal @ 2016-12-21 10:05 UTC (permalink / raw)
  To: kexec; +Cc: Atsushi Kumagai, Kamalesh Babulal

Linux kernel commit 56b174256b69 ("net: add rbnode to struct sk_buff"),
moves sk_buff->next into an union of sk_buff->{next/prev/tstamp/rb_node}.
Introduce this structure member change, while traversing the socket
buffer list.

These changes are not compatible with previous kernel versions,
so add vhost_net_buffers script file for kernel version >= 3.19 to
kernel version <= 4.8.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
---
 eppic_scripts/vhost_net_buffers_3_19_to_4_8.c | 104 ++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 eppic_scripts/vhost_net_buffers_3_19_to_4_8.c

diff --git a/eppic_scripts/vhost_net_buffers_3_19_to_4_8.c b/eppic_scripts/vhost_net_buffers_3_19_to_4_8.c
new file mode 100644
index 0000000..1260acb
--- /dev/null
+++ b/eppic_scripts/vhost_net_buffers_3_19_to_4_8.c
@@ -0,0 +1,104 @@
+string
+vhost_opt()
+{
+	    return "l";
+}
+
+string
+vhost_usage()
+{
+	    return "\n";
+}
+
+static void
+vhost_showusage()
+{
+	    printf("usage : net_ %s", vhost_usage());
+}
+
+string
+vhost_help()
+{
+	    return "Help";
+}
+
+void
+vhost_net(struct vhost_net *net)
+{
+	int i;
+
+	for (i = 0; i < 2; i++) {
+		struct vhost_net_virtqueue *nvq = &net->vqs[i];
+		struct vhost_virtqueue *vq = &nvq->vq;
+		struct socket *sock = (struct socket *)vq->private_data;
+		struct sock *sk = sock->sk;
+
+		struct sk_buff_head *head = &(sk->sk_receive_queue);
+		struct sk_buff *next = sk->sk_receive_queue.next;
+
+		while (next != head)
+		{
+			struct sk_buff *buff = (struct sk_buff *) next;
+
+			if (buff->data_len) {
+				memset((char *)buff->data, 'L', buff->data_len);
+				memset((char *)&(buff->data_len), 'L', 0x4);
+			}
+
+			/*
+			 * .next is the first entry.
+			 */
+			next = (struct sk_buff *)(unsigned long)*buff;
+		}
+
+		head = (struct sk_buff_head *)&(sk->sk_write_queue);
+		next = (struct sk_buff *)sk->sk_write_queue.next;
+
+		while (next != head)
+		{
+			struct sk_buff *buff = (struct sk_buff *) next;
+
+			if (buff->data_len) {
+				memset((char *)buff->data, 'L', buff->data_len);
+				memset((char *)&(buff->data_len), 'L', 0x4);
+			}
+
+			/*
+			 * .next is the first entry.
+			 */
+			next = (struct sk_buff *)(unsigned long)*buff;
+		}
+	}
+}
+
+int
+vhost()
+{
+	struct list_head *head, *next;
+	struct task_struct *tsk;
+
+	tsk = &init_task;
+
+	head = (struct list_head *) &(tsk->tasks);
+	next = (struct list_head *) tsk->tasks.next;
+
+	while (next != head)
+	{
+		int i;
+		struct task_struct *task, *off = 0;
+
+		task = (struct task_struct *)((unsigned long)next - ((unsigned long)&(off->tasks)));
+
+		if (task->files && task->files->fdt) {
+			for (i = 0; i < task->files->fdt->max_fds; i++) {
+				if (task->files->fdt->fd[i] && task->files->fdt->fd[i]->f_op
+					&& task->files->fdt->fd[i]->f_op->open == &vhost_net_open)
+					vhost_net((struct vhost_net *)task->files->fdt->fd[i]->private_data);
+			}
+		}
+
+		next = (struct list_head *)task->tasks.next;
+	}
+
+	return 1;
+}
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RFC PATCH 3/4] eppic/dir_names: Introduce changes for kernel 3.14
  2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 2/4] eppic/vhost_net_buffers: Introduce changes for kernel 3.19 Kamalesh Babulal
@ 2016-12-21 10:05 ` Kamalesh Babulal
  2016-12-21 10:05 ` [RFC PATCH 4/4] eppic/keyring: Introduce changes for kernel 4.4 Kamalesh Babulal
  2016-12-27  5:22 ` [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Atsushi Kumagai
  4 siblings, 0 replies; 7+ messages in thread
From: Kamalesh Babulal @ 2016-12-21 10:05 UTC (permalink / raw)
  To: kexec; +Cc: Atsushi Kumagai, Kamalesh Babulal

Linux kernel commit 38129a13e6e7 ("switch mnt_hash to hlist"),
moves mnt_hash from list_head to hlist_node. Introduce these
list type changes to iterate over the mounted filesystem and
walk dentries.

These changes are not compatible with previous kernel versions,
so add new dir_names script file for kernel version >= 3.14
to kernel version <= 4.8.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
---
 eppic_scripts/dir_names_3_14_to_4_8.c | 82 +++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 eppic_scripts/dir_names_3_14_to_4_8.c

diff --git a/eppic_scripts/dir_names_3_14_to_4_8.c b/eppic_scripts/dir_names_3_14_to_4_8.c
new file mode 100644
index 0000000..5bf08fe
--- /dev/null
+++ b/eppic_scripts/dir_names_3_14_to_4_8.c
@@ -0,0 +1,82 @@
+string
+vfs_opt()
+{
+	    return "l";
+}
+
+string
+vfs_usage()
+{
+	    return "\n";
+}
+
+static void
+vfs_showusage()
+{
+	    printf("usage : vfs %s", vfs_usage());
+}
+
+string
+vfs_help()
+{
+	    return "Help";
+}
+
+void
+rm_names(struct dentry *dir)
+{
+	struct list_head *next, *head;
+	unsigned int hash_len;
+	int i;
+
+	memset(dir->d_iname, 0, 0x20);
+	hash_len = *((unsigned int *)&dir->d_name);
+	memset(dir->d_name.name, 0, hash_len);
+
+	head = (struct list_head *)&(dir->d_subdirs);
+	next = (struct list_head *)dir->d_subdirs.next;
+
+	while (next != head)
+	{
+		struct dentry *child, *off = 0;
+
+		child = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_child));
+		rm_names(child);
+		next = child->d_child.next;
+	}
+
+	return;
+}
+
+int
+vfs()
+{
+	int i;
+	struct hlist_bl_head *tab;
+	unsigned int d_hash_size = d_hash_mask;
+
+	tab = (struct hlist_bl_head *)dentry_hashtable;
+
+	for (i = 0; i < d_hash_size; i++)
+	{
+		struct hlist_bl_head *head;
+		struct hlist_bl_node *head_node, *next;
+
+		head = (struct hlist_bl_head *) (tab + i);
+		head_node = head->first;
+		if (!head_node)
+			continue;
+
+		next = head_node;
+
+		while (next)
+		{
+			struct dentry *root, *off = 0;
+
+			root = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_hash));
+			rm_names(root);
+			next = next->next;
+		}
+	}
+	return 1;
+}
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RFC PATCH 4/4] eppic/keyring: Introduce changes for kernel 4.4
  2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
                   ` (2 preceding siblings ...)
  2016-12-21 10:05 ` [RFC PATCH 3/4] eppic/dir_names: Introduce changes for kernel 3.14 Kamalesh Babulal
@ 2016-12-21 10:05 ` Kamalesh Babulal
  2016-12-27  5:22 ` [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Atsushi Kumagai
  4 siblings, 0 replies; 7+ messages in thread
From: Kamalesh Babulal @ 2016-12-21 10:05 UTC (permalink / raw)
  To: kexec; +Cc: Atsushi Kumagai, Kamalesh Babulal

Linux kernel commit 146aa8b1453b ("KEYS: Merge the type-specific data
with the payload data") merges the type-specific data with the payload
data. Introduce these changes to access type/payload data and scrub
the key type.

These changes are not compatible with previous kernel versions,
so add new keyring script file for kernel version >= 4.4 and
kernel version <= 4.8.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
---
 eppic_scripts/keyring_4_4_to_4_8.c | 378 +++++++++++++++++++++++++++++++++++++
 1 file changed, 378 insertions(+)
 create mode 100644 eppic_scripts/keyring_4_4_to_4_8.c

diff --git a/eppic_scripts/keyring_4_4_to_4_8.c b/eppic_scripts/keyring_4_4_to_4_8.c
new file mode 100644
index 0000000..db74033
--- /dev/null
+++ b/eppic_scripts/keyring_4_4_to_4_8.c
@@ -0,0 +1,378 @@
+string
+skey_opt()
+{
+	    return "l";
+}
+
+string
+skey_usage()
+{
+	    return "\n";
+}
+
+static void
+skey_showusage()
+{
+	    printf("usage : skey %s", skey_usage());
+}
+
+string
+skey_help()
+{
+	    return "Help";
+}
+
+#define ASSOC_ARRAY_FAN_OUT 16
+#define ASSOC_ARRAY_FAN_MASK            (ASSOC_ARRAY_FAN_OUT - 1)
+#define ASSOC_ARRAY_LEVEL_STEP          (ilog2(ASSOC_ARRAY_FAN_OUT))
+#define ASSOC_ARRAY_LEVEL_STEP_MASK     (ASSOC_ARRAY_LEVEL_STEP - 1)
+#define ASSOC_ARRAY_KEY_CHUNK_MASK      (ASSOC_ARRAY_KEY_CHUNK_SIZE - 1)
+#define ASSOC_ARRAY_KEY_CHUNK_SHIFT     (ilog2(BITS_PER_LONG))
+#define ASSOC_ARRAY_PTR_TYPE_MASK 0x1UL
+#define ASSOC_ARRAY_PTR_LEAF_TYPE 0x0UL /* Points to leaf (or nowhere) */
+#define ASSOC_ARRAY_PTR_META_TYPE 0x1UL /* Points to node or shortcut */
+#define ASSOC_ARRAY_PTR_SUBTYPE_MASK    0x2UL
+#define ASSOC_ARRAY_PTR_NODE_SUBTYPE    0x0UL
+#define ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE 0x2UL
+
+/* Keyring stuff */
+#define KEYRING_PTR_SUBTYPE     0x2UL
+
+static int keyring_ptr_is_keyring(const struct assoc_array_ptr *x)
+{
+	return (unsigned long)x & KEYRING_PTR_SUBTYPE;
+}
+
+static int assoc_array_ptr_is_meta(const struct assoc_array_ptr *x)
+{
+        return (unsigned long)x & ASSOC_ARRAY_PTR_TYPE_MASK;
+}
+
+static int assoc_array_ptr_is_leaf(const struct assoc_array_ptr *x)
+{
+        return !assoc_array_ptr_is_meta(x);
+}
+static int assoc_array_ptr_is_shortcut(const struct assoc_array_ptr *x)
+{
+        return (unsigned long)x & ASSOC_ARRAY_PTR_SUBTYPE_MASK;
+}
+static int assoc_array_ptr_is_node(const struct assoc_array_ptr *x)
+{
+        return !assoc_array_ptr_is_shortcut(x);
+}
+
+static void *assoc_array_ptr_to_leaf(const struct assoc_array_ptr *x)
+{
+        return (void *)((unsigned long)x & ~ASSOC_ARRAY_PTR_TYPE_MASK);
+}
+
+static
+unsigned long __assoc_array_ptr_to_meta(const struct assoc_array_ptr *x)
+{
+        return (unsigned long)x &
+                ~(ASSOC_ARRAY_PTR_SUBTYPE_MASK | ASSOC_ARRAY_PTR_TYPE_MASK);
+}
+static
+struct assoc_array_node *assoc_array_ptr_to_node(const struct assoc_array_ptr *x)
+{
+        return (struct assoc_array_node *)__assoc_array_ptr_to_meta(x);
+}
+static
+struct assoc_array_shortcut *assoc_array_ptr_to_shortcut(const struct assoc_array_ptr *x)
+{
+        return (struct assoc_array_shortcut *)__assoc_array_ptr_to_meta(x);
+}
+
+static
+struct assoc_array_ptr *__assoc_array_x_to_ptr(const void *p, unsigned long t)
+{
+        return (struct assoc_array_ptr *)((unsigned long)p | t);
+}
+static
+struct assoc_array_ptr *assoc_array_leaf_to_ptr(const void *p)
+{
+        return __assoc_array_x_to_ptr(p, ASSOC_ARRAY_PTR_LEAF_TYPE);
+}
+static
+struct assoc_array_ptr *assoc_array_node_to_ptr(const struct assoc_array_node *p)
+{
+        return __assoc_array_x_to_ptr(
+                p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_NODE_SUBTYPE);
+}
+
+static
+struct assoc_array_ptr *assoc_array_shortcut_to_ptr(const struct assoc_array_shortcut *p)
+{
+        return __assoc_array_x_to_ptr(
+                p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE);
+}
+
+/* Keyring stuff */
+static inline struct key *keyring_ptr_to_key(const struct assoc_array_ptr *x)
+{
+        void *object = assoc_array_ptr_to_leaf(x);
+        return (struct key *)((unsigned long)object & ~KEYRING_PTR_SUBTYPE);
+}
+
+/* BEGIN: struct key access */
+struct keyring_index_key *get_index_key_from_key(struct key *key)
+{
+	return (struct keyring_index_key *)((unsigned long)&(key->flags)
+					    + sizeof(key->flags));
+}
+
+struct key_type *get_type_from_key(struct key *key)
+{
+	return (struct key_type *)((unsigned long)&(key->flags)
+				   + sizeof(key->flags));
+}
+
+char *get_description_from_key(struct key *key)
+{
+	return (char *)((unsigned long)&(key->flags)
+				   + sizeof(key->flags)
+				   + sizeof(struct key_type *));
+}
+
+union key_payload *get_payload_from_key(struct key *key)
+{
+	return (union key_payload *)((unsigned long)&(key->flags)
+				     + sizeof(key->flags)
+				     + sizeof(struct keyring_index_key));
+}
+
+struct list_head *get_name_link_from_key(struct key *key)
+{
+	return (struct list_head *)((unsigned long)&(key->flags)
+					 + sizeof(key->flags)
+					 + sizeof(struct keyring_index_key));
+}
+
+struct assoc_array *get_keys_from_key(struct key *key)
+{
+	return (struct assoc_array *)((unsigned long)&(key->flags)
+				      + sizeof(key->flags)
+				      + sizeof(struct keyring_index_key)
+				      + sizeof(struct list_head));
+}
+/* END: struct key access */
+
+static void delete_keyring_subtree(struct assoc_array_ptr *root)
+{
+	struct assoc_array_shortcut *shortcut;
+	struct assoc_array_node *node;
+	struct assoc_array_ptr *cursor, *parent;
+	int slot = -1;
+
+	cursor = root;
+	if (!cursor) {
+		return;
+	}
+
+	if (assoc_array_ptr_is_shortcut(cursor)) {
+		/* Descend through a shortcut */
+		shortcut = assoc_array_ptr_to_shortcut(cursor);
+		parent = cursor;
+		cursor = shortcut->next_node;
+	}
+
+	node = assoc_array_ptr_to_node(cursor);
+	slot = 0;
+
+	if(node->nr_leaves_on_branch <= 0) return;
+
+	do {
+		for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) {
+			struct assoc_array_ptr *ptr = node->slots[slot];
+
+			if (!ptr)
+				continue;
+			if (assoc_array_ptr_is_meta(ptr)) {
+				parent = cursor;
+				cursor = ptr;
+				if (assoc_array_ptr_is_shortcut(cursor)) {
+					/* Descend through a shortcut */
+					shortcut = assoc_array_ptr_to_shortcut(cursor);
+					parent = cursor;
+					cursor = shortcut->next_node;
+				}
+				node = assoc_array_ptr_to_node(cursor);
+				slot = 0;
+			} else {
+				struct key *leaf;
+				struct keyring_index_key *index_key;
+				char *description;
+				void *payload_ptr;
+				int i,j;
+
+				/* no need to delete keyrings, only data */
+				if(keyring_ptr_is_keyring(ptr))
+					continue;
+
+				/* delete the leaf payload */
+				leaf = (struct key *)assoc_array_ptr_to_leaf(ptr);
+				index_key = get_index_key_from_key(leaf);
+				/*
+				   Now delete the keys of the different key types.
+				   The following key types are handled for now:
+				   user, ceph, pkcs7_test, asymmetric(X509), rxpc
+
+				   The following key types are NOT  handled (yet):
+				   dns_resolver (no secret keys, just used for DNS)
+
+				   Add a new else if() for new key types.
+				*/
+				if(getstr(index_key->type->name) == "user") {
+					struct user_key_payload **user_key_payload;
+					unsigned short datalen;
+
+					payload_ptr=(void *)get_payload_from_key(leaf);
+					user_key_payload = (struct user_key_payload **)payload_ptr;
+					datalen = (*user_key_payload)->datalen;
+					memset((char *)&(*user_key_payload)->data, 'A', datalen);
+				} else if(getstr(index_key->type->name) == "ceph") {
+					struct ceph_crypto_key **ceph_payload;
+					int len;
+
+					payload_ptr=(void *)get_payload_from_key(leaf);
+					ceph_payload = (struct ceph_crypto_key **)payload_ptr;
+					len = (*ceph_payload)->len;
+					memset((char *)&(*ceph_payload)->key, 'A', len);
+				} else if(getstr(index_key->type->name) == "pkcs7_test") {
+					struct user_key_payload **user_key_payload;
+					unsigned short datalen;
+
+					payload_ptr=(void *)get_payload_from_key(leaf);
+					user_key_payload = (struct user_key_payload **)payload_ptr;
+					datalen = (*user_key_payload)->datalen;
+					memset((char *)&(*user_key_payload)->data, 'A', datalen);
+				} else if(getstr(index_key->type->name) == "asymmetric") {
+					struct public_key **public_key;
+					unsigned short keylen;
+
+					/* data[0] is asym_crypto */
+					payload_ptr=(void *)get_payload_from_key(leaf);
+					public_key = (struct public_key **)payload_ptr;
+					keylen = (*public_key)->keylen;
+					memset((char *)&(*public_key)->key, 'A', keylen);
+				} else if(getstr(index_key->type->name) == ".request_key_auth") {
+					struct request_key_auth **request_key;
+					unsigned short datalen;
+
+					payload_ptr=(void *)get_payload_from_key(leaf);
+					request_key = (struct request_key_auth **)payload_ptr;
+					datalen = leaf->datalen;
+					memset((char *)&(*request_key)->data, 'A', datalen);
+				} else if(getstr(index_key->type->name) == "rxrpc") {
+					struct rxrpc_key_token **rxrpc_key_token, *token;
+					struct rxkad_key *kad;
+					struct rxk5_key *k5;
+					int token_count = 0;
+
+					payload_ptr=(void *)get_payload_from_key(leaf);
+					rxrpc_key_token = (struct rxrpc_key_token **)payload_ptr;
+					for(; rxrpc_key_token;
+					    rxrpc_key_token = &(*rxrpc_key_token)->next,
+						    token_count++) {
+						token = *rxrpc_key_token;
+						switch(token->security_index) {
+						case 2 : /* RXRPC_SECURITY_RXKAD */
+							/* anonymous union, use pointer arithmetic */
+							kad = token->next +
+								sizeof(struct rxrpc_key_token *);
+							memset(&kad.session_key, 'A', 8);
+							memset(&kad.ticket, 'A', kad.ticket_len);
+							break;
+						case 5 : /* RXRPC_SECURITY_RXK5 */
+							/* anonymous union, use pointer arithmetic */
+							k5 = token->next +
+								sizeof(struct rxrpc_key_token *);
+							memset(k5.ticket, 'A', k5.ticket_len);
+							memset(k5.ticket2, 'A', k5.ticket2_len);
+							memset(k5.session.data, 'A', k5.session.data_len);
+							memset(k5->addresses.data, 'A', k5->addresses.data_len);
+							memset(k5->authdata.data, 'A', k5->authdata.data_len);
+							break;
+						default :
+							printf("WARNING: unknown security index: %d\n",
+								token->security_index);
+						}
+						/* max number of tokens = 8 */
+						if(token_count > 8) {
+							printf("WARNING: too many rxrpc tokens!\n");
+							break;
+						}
+					}
+				} else if(getstr(index_key->type->name) == "dns_resolver") {
+					/* nothing to do here, no secret data */
+				} else if(getstr(index_key->type->name) == "big_key") {
+					printf("WARNING: key_type=big_key not handled!\n");
+				} else {
+					printf("WARNING: unsupported key type = %s!\n",
+					       getstr(index_key->type->name));
+				}
+			}
+		}
+
+		parent = node->back_pointer;
+		slot = node->parent_slot;
+		if (parent) {
+			/* Move back up to the parent */
+			if (assoc_array_ptr_is_shortcut(parent)) {
+				shortcut = assoc_array_ptr_to_shortcut(parent);
+				cursor = parent;
+				parent = shortcut->back_pointer;
+				slot = shortcut->parent_slot;
+			}
+
+			/* Ascend to next slot in parent node */
+			cursor = parent;
+			node = assoc_array_ptr_to_node(cursor);
+			slot++;
+		}
+	} while(parent);
+
+	return;
+}
+
+void delete_keyring(struct assoc_array *keyring)
+{
+	delete_keyring_subtree(keyring->root);
+}
+
+int
+skey()
+{
+	int i,j,k;
+	struct list_head **tab;
+
+	tab = &keyring_name_hash;
+
+	for (i = 0; i < 32; i++)
+	{
+		struct list_head *next, *head;
+
+		head = (struct list_head *) (tab + i);
+		next = (struct list_head *) head->next;
+
+		if (!next)
+			continue;
+
+		while (next != head)
+		{
+			struct key *mykey, *off = 0;
+			struct list_head *name_link;
+			struct assoc_array *keys;
+
+			mykey = (struct key *)((unsigned long)(next)
+					       - (unsigned long)&(off->flags)
+					       - sizeof(off->flags)
+					       - sizeof(struct keyring_index_key));
+			name_link = get_name_link_from_key(mykey);
+			keys = get_keys_from_key(mykey);
+			delete_keyring(keys);
+			next = (struct list_head *) name_link->next;
+		}
+	}
+	return 1;
+}
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [RFC PATCH 0/4] eppic: Create kernel version compatible scripts
  2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
                   ` (3 preceding siblings ...)
  2016-12-21 10:05 ` [RFC PATCH 4/4] eppic/keyring: Introduce changes for kernel 4.4 Kamalesh Babulal
@ 2016-12-27  5:22 ` Atsushi Kumagai
  2016-12-27  6:37   ` Kamalesh Babulal
  4 siblings, 1 reply; 7+ messages in thread
From: Atsushi Kumagai @ 2016-12-27  5:22 UTC (permalink / raw)
  To: Kamalesh Babulal; +Cc: kexec

Hello Kamalesh,

>This patch series creates eppic scripts a for range kernel versions
>they are compatible with. Eppic scripts directory host sample
>scripts to scrub sensitive information from the dump file generated
>using makedumpfile.
>
>The initial version of these scripts was based on Fedora 19 kernel.
>In brief, these scripts rely on hard coded kernel data structure
>member offsets. Kernel data structures are bound to change in due course
>and leading to failure when assumptions about the offsets differ.
>
>Atsushi-San suggested that, it's better to have different version of
>eppic scripts, those will be valid for the range of kernel release and
>their naming convention hinting, of the release they are valid across.
>
>The first patch renames the existing eppic script to reflect the kernel
>release they are compatible with. Following the format:
><eppic_script>-<valid from kernel version>_to_<valid until kernel version>.c
>
>Rest of three patches creates new eppic scripts to match with the kernel
>data structures they work with.

Thank you for reflecting my comments, looks good to me.
v1.6.1 is ready now, these patches will be merged into v1.6.2.

Thanks,
Atsushi Kumagai

>Kamalesh Babulal (4):
>  eppic: Rename scripts to reflect validity of kernel version
>  eppic/vhost_net_buffers: Introduce changes for kernel 3.19
>  eppic/dir_names: Introduce changes for kernel 3.14
>  eppic/keyring: Introduce changes for kernel 4.4
>
> eppic_scripts/README                           |  26 +-
> eppic_scripts/ap_messages.c                    |  82 ------
> eppic_scripts/ap_messages_3_10_to_4_8.c        |  82 ++++++
> eppic_scripts/dir_names.c                      |  78 -----
> eppic_scripts/dir_names_3_10_to_3_13.c         |  78 +++++
> eppic_scripts/dir_names_3_14_to_4_8.c          |  82 ++++++
> eppic_scripts/keyring.c                        |  57 ----
> eppic_scripts/keyring_3_10_to_4_3.c            |  57 ++++
> eppic_scripts/keyring_4_4_to_4_8.c             | 378 +++++++++++++++++++++++++
> eppic_scripts/proc_names.c                     |  49 ----
> eppic_scripts/proc_names_3_10_to_4_8.c         |  49 ++++
> eppic_scripts/tcp_sk_buf.c                     |  82 ------
> eppic_scripts/tcp_sk_buf_3_10_to_4_8.c         |  82 ++++++
> eppic_scripts/udp_sk_buf.c                     |  83 ------
> eppic_scripts/udp_sk_buf_3_10_to_4_8.c         |  83 ++++++
> eppic_scripts/unix_sk_buff.c                   |  85 ------
> eppic_scripts/unix_sk_buff_3_10_to_4_8.c       |  85 ++++++
> eppic_scripts/vhost_net_buffers.c              |  99 -------
> eppic_scripts/vhost_net_buffers_3_10_to_3_18.c |  99 +++++++
> eppic_scripts/vhost_net_buffers_3_19_to_4_8.c  | 104 +++++++
> eppic_scripts/vhost_scsi_buffers.c             |  75 -----
> eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c |  75 +++++
> 22 files changed, 1270 insertions(+), 700 deletions(-)
> delete mode 100644 eppic_scripts/ap_messages.c
> create mode 100644 eppic_scripts/ap_messages_3_10_to_4_8.c
> delete mode 100644 eppic_scripts/dir_names.c
> create mode 100644 eppic_scripts/dir_names_3_10_to_3_13.c
> create mode 100644 eppic_scripts/dir_names_3_14_to_4_8.c
> delete mode 100644 eppic_scripts/keyring.c
> create mode 100644 eppic_scripts/keyring_3_10_to_4_3.c
> create mode 100644 eppic_scripts/keyring_4_4_to_4_8.c
> delete mode 100644 eppic_scripts/proc_names.c
> create mode 100644 eppic_scripts/proc_names_3_10_to_4_8.c
> delete mode 100644 eppic_scripts/tcp_sk_buf.c
> create mode 100644 eppic_scripts/tcp_sk_buf_3_10_to_4_8.c
> delete mode 100644 eppic_scripts/udp_sk_buf.c
> create mode 100644 eppic_scripts/udp_sk_buf_3_10_to_4_8.c
> delete mode 100644 eppic_scripts/unix_sk_buff.c
> create mode 100644 eppic_scripts/unix_sk_buff_3_10_to_4_8.c
> delete mode 100644 eppic_scripts/vhost_net_buffers.c
> create mode 100644 eppic_scripts/vhost_net_buffers_3_10_to_3_18.c
> create mode 100644 eppic_scripts/vhost_net_buffers_3_19_to_4_8.c
> delete mode 100644 eppic_scripts/vhost_scsi_buffers.c
> create mode 100644 eppic_scripts/vhost_scsi_buffers_3_10_to_4_8.c
>
>--
>2.7.4
>
>
>_______________________________________________
>kexec mailing list
>kexec@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC PATCH 0/4] eppic: Create kernel version compatible scripts
  2016-12-27  5:22 ` [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Atsushi Kumagai
@ 2016-12-27  6:37   ` Kamalesh Babulal
  0 siblings, 0 replies; 7+ messages in thread
From: Kamalesh Babulal @ 2016-12-27  6:37 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: kexec



On Tuesday 27 December 2016 10:52 AM, Atsushi Kumagai wrote:

Hi Atsushi-San,

>> This patch series creates eppic scripts a for range kernel versions
>> they are compatible with. Eppic scripts directory host sample
>> scripts to scrub sensitive information from the dump file generated
>> using makedumpfile.
>>
>> The initial version of these scripts was based on Fedora 19 kernel.
>> In brief, these scripts rely on hard coded kernel data structure
>> member offsets. Kernel data structures are bound to change in due course
>> and leading to failure when assumptions about the offsets differ.
>>
>> Atsushi-San suggested that, it's better to have different version of
>> eppic scripts, those will be valid for the range of kernel release and
>> their naming convention hinting, of the release they are valid across.
>>
>> The first patch renames the existing eppic script to reflect the kernel
>> release they are compatible with. Following the format:
>> <eppic_script>-<valid from kernel version>_to_<valid until kernel version>.c
>>
>> Rest of three patches creates new eppic scripts to match with the kernel
>> data structures they work with.
> Thank you for reflecting my comments, looks good to me.
> v1.6.1 is ready now, these patches will be merged into v1.6.2.

Thank you for the reviews and picking them. Happy New Year.

-- 
cheers,
Kamalesh.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-27  6:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
2016-12-21 10:05 ` [RFC PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version Kamalesh Babulal
2016-12-21 10:05 ` [RFC PATCH 2/4] eppic/vhost_net_buffers: Introduce changes for kernel 3.19 Kamalesh Babulal
2016-12-21 10:05 ` [RFC PATCH 3/4] eppic/dir_names: Introduce changes for kernel 3.14 Kamalesh Babulal
2016-12-21 10:05 ` [RFC PATCH 4/4] eppic/keyring: Introduce changes for kernel 4.4 Kamalesh Babulal
2016-12-27  5:22 ` [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Atsushi Kumagai
2016-12-27  6:37   ` Kamalesh Babulal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.