All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
To: kumagai-atsushi@mxc.nes.nec.co.jp, kexec@lists.infradead.org
Cc: LChouinard@s2sys.com, mahesh@linux.vnet.ibm.com,
	tachibana@mxm.nes.nec.co.jp, ananth@in.ibm.com,
	buendgen@de.ibm.com
Subject: [PATCH v2 2/7] makedumpfile and eppic interface layer
Date: Thu, 08 Nov 2012 19:08:15 +0530	[thread overview]
Message-ID: <20121108133814.28410.44597.stgit@aravinda> (raw)
In-Reply-To: <20121108133554.28410.99763.stgit@aravinda>

This patch extends the makedumpfile functionality to include eppic
language support. The patch initializes eppic and then loads and
executes the specified eppic macros.

This patch also includes "--eppic" option to makedumpfile command to
specify the eppic macro or the directory containing eppic macros. The
specified eppic macro will be executed to scrub the data in the
dumpfile. In case of a directory, all the eppic macros inside the
directory will be executed for scrubbing the data.

TODO
	- Support specifying eppic macros in the makedumpfile.conf file.
	  A new command should be added to makedumpfile.conf to identify
	  an eppic macro. This command could be used in any section of
	  the makedumpfile.conf, where the section name indicates the kernel
	  module name. makedumpfile will only search for symbols encountered
	  by eppic macro only in the specified module. Because, searching
	  these symbols in all the modules will cause huge performance
	  overhead.

Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
---
 erase_info.c      |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 erase_info.h      |    4 ++++
 extension_eppic.h |    3 +++
 makedumpfile.c    |    7 ++++++-
 makedumpfile.h    |    6 ++++++
 5 files changed, 67 insertions(+), 3 deletions(-)

diff --git a/erase_info.c b/erase_info.c
index e2e6a52..5d4cfd1 100644
--- a/erase_info.c
+++ b/erase_info.c
@@ -1811,6 +1811,34 @@ process_config_file(const char *name_config)
 	return TRUE;
 }
 
+
+/* Process the eppic macro using eppic library */
+#ifdef EPPIC
+static int
+process_eppic_file(char *name_config)
+{
+	int ret = 0;
+
+	/* Initialize eppic*/
+	ret = eppic_init();
+	if (ret) {
+		ERRMSG("Eppic initialization failed\n");
+		return FALSE;
+	}
+
+	/* TODO
+	 * Support specifying eppic macros in makedumpfile.conf file
+	 */
+
+	/* Load/compile and execute the eppic macro */
+	eppic_load(name_config);
+
+	eppic_unload(name_config);
+
+	return TRUE;
+}
+#endif
+
 static void
 split_filter_info(struct filter_info *prev, unsigned long long next_paddr,
 						size_t size)
@@ -1904,7 +1932,7 @@ extract_filter_info(unsigned long long start_paddr,
 int
 gather_filter_info(void)
 {
-	int ret;
+	int ret = TRUE;
 
 	/*
 	 * Before processing filter config file, load the symbol data of
@@ -1915,7 +1943,25 @@ gather_filter_info(void)
 	if (!load_module_symbols())
 		return FALSE;
 
-	ret = process_config_file(info->name_filterconfig);
+	/*
+	 * This patch supports specifying both makedumpfile.conf and
+	 * eppic macro at the same time. Whether to retain or discard the
+	 * functionality provided by makedumpfile.conf is open for
+	 * discussion
+	 */
+	if (info->name_filterconfig)
+		ret = process_config_file(info->name_filterconfig);
+
+	if (info->name_eppic_config)
+#ifdef EPPIC
+		ret &= process_eppic_file(info->name_eppic_config);
+#else
+	{
+		MSG("'-eppic' option is disabled, because this ");
+		MSG("binary doesn't support scrubbing using eppic.\n");
+		MSG("Try `make EPPIC=on` when building.\n");
+	}
+#endif
 
 	/*
 	 * Remove modules symbol information, we dont need now.
diff --git a/erase_info.h b/erase_info.h
index 636fcfa..0e3c3a3 100644
--- a/erase_info.h
+++ b/erase_info.h
@@ -19,6 +19,10 @@
 #ifndef _ERASE_INFO_H
 #define _ERASE_INFO_H
 
+#ifdef EPPIC
+#include "extension_eppic.h"
+#endif
+
 #define MAX_SIZE_STR_LEN (26)
 
 /*
diff --git a/extension_eppic.h b/extension_eppic.h
index ca74ce4..67efd11 100644
--- a/extension_eppic.h
+++ b/extension_eppic.h
@@ -20,4 +20,7 @@
 
 #include "eppic_api.h"
 
+int eppic_init(void);    /* Eppic initialize */
+
 #endif /* _EXTENSION_EPPIC_H */
+
diff --git a/makedumpfile.c b/makedumpfile.c
index 4931319..3ba74ca 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -6943,7 +6943,8 @@ retry:
 		}
 	}
 
-	if (info->name_filterconfig && !gather_filter_info())
+	if ((info->name_filterconfig || info->name_eppic_config)
+			&& !gather_filter_info())
 		return FALSE;
 
 	if (!create_dump_bitmap())
@@ -7779,6 +7780,7 @@ static struct option longopts[] = {
 	{"diskset", required_argument, NULL, 'k'},
 	{"non-cyclic", no_argument, NULL, 'Y'},
 	{"cyclic-buffer", required_argument, NULL, 'Z'},
+	{"eppic", required_argument, NULL, 'S'},
 	{0, 0, 0, 0}
 };
 
@@ -7874,6 +7876,9 @@ main(int argc, char *argv[])
 		case 's':
 			info->flag_split = 1;
 			break;
+		case 'S':
+			info->name_eppic_config = optarg;
+			break;
 		case 'r':
 			info->flag_reassemble = 1;
 			break;
diff --git a/makedumpfile.h b/makedumpfile.h
index 2b88fa4..f7e0616 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -830,6 +830,12 @@ struct DumpInfo {
 	FILE		*file_filterconfig;
 
 	/*
+	 * Filter config file containing eppic language filtering rules
+	 * to filter out kernel data from vmcore
+	 */
+	char		*name_eppic_config;
+
+	/*
 	 * diskdimp info:
 	 */
 	int		block_order;


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

  parent reply	other threads:[~2012-11-08 13:38 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08 13:37 [PATCH v2 0/7] makedumpfile security key filtering with eppic Aravinda Prasad
2012-11-08 13:38 ` [PATCH v2 1/7] Initialize and setup eppic Aravinda Prasad
2012-11-15 16:04   ` Vivek Goyal
2012-11-16  9:43     ` Aravinda Prasad
2012-11-08 13:38 ` Aravinda Prasad [this message]
2012-11-08 13:38 ` [PATCH v2 3/7] Eppic call back functions to query a dump image Aravinda Prasad
2012-11-08 13:38 ` [PATCH v2 4/7] Implement apigetctype call back function Aravinda Prasad
2012-11-08 13:39 ` [PATCH v2 5/7] Implement apimember and apigetrtype call back functions Aravinda Prasad
2012-11-08 13:39 ` [PATCH v2 6/7] Extend eppic built-in functions to include memset function Aravinda Prasad
2012-11-08 13:39 ` [PATCH v2 7/7] Support fully typed symbol access mode Aravinda Prasad
2012-11-14  1:15 ` [PATCH v2 0/7] makedumpfile security key filtering with eppic Atsushi Kumagai
2012-11-14 14:54 ` Vivek Goyal
2012-11-14 17:06   ` Aravinda Prasad
2012-11-14 17:53     ` Vivek Goyal
2012-11-15 12:50       ` Aravinda Prasad
2012-11-15 14:27         ` Dave Anderson
2012-11-15 15:55           ` Vivek Goyal
2012-11-16  9:52             ` Aravinda Prasad
2012-11-16 14:36               ` Vivek Goyal
2012-11-20  9:47                 ` Atsushi Kumagai
2012-11-21  7:19                   ` Aravinda Prasad
2012-11-21 13:57                     ` Vivek Goyal
2012-11-22 17:14                       ` Aravinda Prasad
2012-11-26 14:04                         ` Vivek Goyal
2012-12-03  6:02                           ` Aravinda Prasad
2012-12-03 13:20                             ` Vivek Goyal
2012-12-03 14:35                               ` Aravinda Prasad
2012-12-03 18:40                                 ` Vivek Goyal
2012-12-04  8:36                                   ` Atsushi Kumagai
2012-12-04  8:56                                     ` Aravinda Prasad
2012-12-06 15:26                             ` Dave Anderson
2012-12-07  6:05                               ` Aravinda Prasad
2012-12-07 13:46                                 ` Luc Chouinard
2012-12-07 21:59                                   ` Vivek Goyal
2012-12-10  7:32                                     ` Aravinda Prasad
2012-12-10 11:35                                       ` Aravinda Prasad
2012-11-16  9:49           ` Aravinda Prasad
2012-11-15 15:49         ` Vivek Goyal
2012-11-16 11:10           ` Aravinda Prasad
2012-11-16 14:59             ` Vivek Goyal
2012-11-14 20:15     ` Vivek Goyal
2012-11-15 12:55       ` Aravinda Prasad
2012-11-14 20:21     ` Dave Anderson
2012-11-15 13:27       ` Aravinda Prasad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121108133814.28410.44597.stgit@aravinda \
    --to=aravinda@linux.vnet.ibm.com \
    --cc=LChouinard@s2sys.com \
    --cc=ananth@in.ibm.com \
    --cc=buendgen@de.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=tachibana@mxm.nes.nec.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.