Aravinda Prasad | 6 Jun 2012 12:04
Picon

[PATCH 0/7] makedumpfile security key filtering with eppic

makedumpfile security key filtering enhancement - Add Eppic language
support (formerly known as SIAL) to specify rules to scrub data in a
dumpfile. Eppic was previously part of crash source code repository.

The following series of patches enhance the makedumpfile to provide
a more powerful way to specify rules and commands to traverse and
erase complex data structures in a dump file by integrating Embeddable
Pre-Processor and Interpreter for C (eppic).

Eppic is an interpreter that facilitates access to the symbol and type
information stored in an executable image or a dump file. Eppic defines
a language semantic which is similar to C. Eppic macros can be used to
specify rules/commands to erase data in an image file. makedumpfile
will interpret the rules/commands provided by eppic macros with the
help of eppic library and will suitably erase the required data in a
dump file. Eppic provides a lot of language constructs like conditional
statements, logical and arithmetic operators, nested loops, functions,
etc., to traverse nested lists and trees and conditionally erase data
in the dump file, enabling users to literally erase any data in the
dump file which is accessible through global symbols.

The series of patches integrates eppic with makdumpfile. These patches
require eppic library libeppic.a and eppic_api.h header file. The
libeppic.a library can be built from the eppic source code available
at the following URL:

http://code.google.com/p/eppic/

TODO:

(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:04
Picon

[PATCH 1/7] Initialize and setup eppic

This patch contains routines which initialize eppic and register call
back function which will be called whenever a new eppic macro is loaded
using eppic_load() API. The registered call back function executes the
eppic macro as soon as it is loaded.

The -ltinfo is included in LIBS in the Makefile, because eppic
currently calls few functions in libtinfo and the compiler complains
about it, if not included. I think the paths where libeppic calls
libtinfo functions are not exercised by makedumpfile.

Including -ltinfo will increase the size of makedumpfile static
version

TODO:
	- Check out a way to get rid of -ltinfo

Signed-off-by: Aravinda Prasad <aravinda@...>
---
 Makefile          |    6 ++--
 extension_eppic.c |   84 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 extension_eppic.h |   23 +++++++++++++++
 3 files changed, 110 insertions(+), 3 deletions(-)
 create mode 100644 extension_eppic.c
 create mode 100644 extension_eppic.h

diff --git a/Makefile b/Makefile
index 7337c58..bdfdbab 100644
--- a/Makefile
+++ b/Makefile
 <at>  <at>  -40,12 +40,12  <at>  <at>  CFLAGS_ARCH += -m32
(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:05
Picon

[PATCH 2/7] makedumpfile and eppic interface layer

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@...>
---
 erase_info.c      |   40 ++++++++++++++++++++++++++++++++++++++--
 erase_info.h      |    2 ++
 extension_eppic.h |    3 +++
 makedumpfile.c    |    7 ++++++-
 makedumpfile.h    |    6 ++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/erase_info.c b/erase_info.c
(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:05
Picon

[PATCH 3/7] Eppic call back functions to query a dump image

This patch implements a series of apigetuint* call back functions
which are used to access data from the dump image. Eppic uses these
call back functions to fetch the actual value of the global variables.

This patch also adds other call back functions as a place holder which
will be implemented in later patches. This is mainly to avoid
compilation error while registering the call back functions using
eppic_apiset() function.

Signed-off-by: Aravinda Prasad <aravinda@...>
---
 extension_eppic.c |  128 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 extension_eppic.h |   50 ++++++++++++++++++++-
 2 files changed, 176 insertions(+), 2 deletions(-)

diff --git a/extension_eppic.c b/extension_eppic.c
index f6c7ff1..2c01fdf 100644
--- a/extension_eppic.c
+++ b/extension_eppic.c
 <at>  <at>  -20,6 +20,7  <at>  <at> 
 #include <sys/types.h>
 #include <fcntl.h>

+#include "makedumpfile.h"
 #include "extension_eppic.h"

 /*
 <at>  <at>  -64,6 +65,131  <at>  <at>  reg_callback(char *name, int load)
 	return;
 }
(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:06
Picon

[PATCH 4/7] Implement apigetctype call back function

libeppic will call apigetctype call back function whenever it
encounters a token in the eppic macro. The call back function will use
DWARF to query information related to the requested token and will
pass it back to eppic using libeppic API calls. If the token does not
exist, then apigetctype call returns 0.

Signed-off-by: Aravinda Prasad <aravinda@...>
---
 dwarf_info.c      |   83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 dwarf_info.h      |    9 ++++++
 extension_eppic.c |   25 +++++++++++++++-
 3 files changed, 116 insertions(+), 1 deletions(-)

diff --git a/dwarf_info.c b/dwarf_info.c
index 1429858..32170ad 100644
--- a/dwarf_info.c
+++ b/dwarf_info.c
 <at>  <at>  -51,6 +51,7  <at>  <at>  struct dwarf_info {
 	long	enum_number;		/* OUT */
 	unsigned char	type_flag;	/* OUT */
 	char	src_name[LEN_SRCFILE];	/* OUT */
+	Dwarf_Off die_offset;		/* OUT */
 };
 static struct dwarf_info	dwarf_info;

 <at>  <at>  -103,6 +104,22  <at>  <at>  is_search_typedef(int cmd)
 }

 static int
+is_search_domain(int cmd)
(Continue reading)

Atsushi Kumagai | 29 Oct 2012 09:06
Picon
Picon

Re: [PATCH 4/7] Implement apigetctype call back function

Hello Aravinda,

I have two comments, please see below.

On Wed, 06 Jun 2012 15:36:02 +0530
Aravinda Prasad <aravinda@...> wrote:

> libeppic will call apigetctype call back function whenever it
> encounters a token in the eppic macro. The call back function will use
> DWARF to query information related to the requested token and will
> pass it back to eppic using libeppic API calls. If the token does not
> exist, then apigetctype call returns 0.
> 
> Signed-off-by: Aravinda Prasad <aravinda@...>
> ---
>  dwarf_info.c      |   83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  dwarf_info.h      |    9 ++++++
>  extension_eppic.c |   25 +++++++++++++++-
>  3 files changed, 116 insertions(+), 1 deletions(-)
> 
> diff --git a/dwarf_info.c b/dwarf_info.c
> index 1429858..32170ad 100644
> --- a/dwarf_info.c
> +++ b/dwarf_info.c
>  <at>  <at>  -51,6 +51,7  <at>  <at>  struct dwarf_info {
>  	long	enum_number;		/* OUT */
>  	unsigned char	type_flag;	/* OUT */
>  	char	src_name[LEN_SRCFILE];	/* OUT */
> +	Dwarf_Off die_offset;		/* OUT */
>  };
(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:06
Picon

[PATCH 5/7] Implement apimember and apigetrtype call back functions

The patch includes functionality for apimember and apigetrtype eppic
callback routines along with helper functions to fetch information
related to the member of the structure/union

Whenever a structure/union member is accessed inside the eppic macro,
eppic will query makedumpfile through call back functions requesting
more information on the structure or union member. The information
includes member name, offset from structure, data type and size.
makedumpfile will get all these information using DWARF and pass
back to eppic using libeppic API calls.

Signed-off-by: Aravinda Prasad <aravinda@...>
---
 dwarf_info.c      |  203 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 dwarf_info.h      |    7 ++
 extension_eppic.c |  177 +++++++++++++++++++++++++++++++++++++++++++++-
 extension_eppic.h |    2 +
 4 files changed, 385 insertions(+), 4 deletions(-)

diff --git a/dwarf_info.c b/dwarf_info.c
index 32170ad..9029e46 100644
--- a/dwarf_info.c
+++ b/dwarf_info.c
 <at>  <at>  -465,6 +465,26  <at>  <at>  get_dwarf_base_type(Dwarf_Die *die)
 }

 /*
+ * Get the die, given the offset
+ */
+static int
(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:06
Picon

[PATCH 6/7] Extend eppic built-in functions to include memset function

The memset function will be used to specify the virtual address
and the length of the data to be scrubbed in the dump file from
the eppic macro. makedumpfile will convert these requests into
filter_info nodes which will be enqueued for filtering. Existing
makedumpfile functionality reads the filter_info nodes and scrubs the
data accordingly.

Signed-off-by: Aravinda Prasad <aravinda@...>
---
 erase_info.c      |   32 +++++++++++++++++++++++++++++++-
 erase_info.h      |    1 +
 extension_eppic.c |   19 +++++++++++++++++++
 extension_eppic.h |    2 ++
 4 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/erase_info.c b/erase_info.c
index d301f20..79baecc 100644
--- a/erase_info.c
+++ b/erase_info.c
 <at>  <at>  -66,6 +66,8  <at>  <at>  struct filter_info {
 	int			erase_info_idx;	/* 0= invalid index */
 	int			size_idx;

+	int			erase_ch;
+
 	struct filter_info      *next;
 	unsigned short          nullify;
 };
 <at>  <at>  -1574,6 +1576,7  <at>  <at>  update_filter_info(struct config_entry *filter_symbol,
 	fl_info->paddr   = vaddr_to_paddr(sym_addr);
(Continue reading)

Aravinda Prasad | 6 Jun 2012 12:07
Picon

[PATCH 7/7] Support fully typed symbol access mode

Eppic enables access to symbols in two ways. The first, is a more
natural mode in that it makes symbols available as fully typed
entities. The second, is generic and treats all symbols as an address
to data which then needs to be cast to the proper type explicitly. The
former obviously enables an easier cut & pasting of target code into
eppic code.

Currently generic symbol access mode is supported. This patch extends
the functionality to include support for fully typed symbol access mode
(which will be the default mode) in eppic macros. User can switch to
generic symbol access mode by setting the following environmental
variable - EPPIC_LEGACY_MODE. libeppic.a will take care of handling
EPPIC_LEGACY_MODE. libeppic.a will pass NULL to VALUE_S* argument of
apigetval() call back function if EPPIC_LEGACY_MODE is set.

Refer to http://code.google.com/p/eppic/ for more information.
---
 dwarf_info.c      |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 dwarf_info.h      |    2 ++
 extension_eppic.c |   25 +++++++++++++++++++++++++
 3 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/dwarf_info.c b/dwarf_info.c
index 9029e46..745dc56 100644
--- a/dwarf_info.c
+++ b/dwarf_info.c
 <at>  <at>  -120,6 +120,15  <at>  <at>  is_search_domain(int cmd)
 }

 static int
(Continue reading)

Atsushi Kumagai | 11 Jun 2012 10:44
Picon
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hello Aravinda,

On Wed, 06 Jun 2012 15:34:23 +0530
Aravinda Prasad <aravinda@...> wrote:

> makedumpfile security key filtering enhancement - Add Eppic language
> support (formerly known as SIAL) to specify rules to scrub data in a
> dumpfile. Eppic was previously part of crash source code repository.
> 
> The following series of patches enhance the makedumpfile to provide
> a more powerful way to specify rules and commands to traverse and
> erase complex data structures in a dump file by integrating Embeddable
> Pre-Processor and Interpreter for C (eppic).
> 
> Eppic is an interpreter that facilitates access to the symbol and type
> information stored in an executable image or a dump file. Eppic defines
> a language semantic which is similar to C. Eppic macros can be used to
> specify rules/commands to erase data in an image file. makedumpfile
> will interpret the rules/commands provided by eppic macros with the
> help of eppic library and will suitably erase the required data in a
> dump file. Eppic provides a lot of language constructs like conditional
> statements, logical and arithmetic operators, nested loops, functions,
> etc., to traverse nested lists and trees and conditionally erase data
> in the dump file, enabling users to literally erase any data in the
> dump file which is accessible through global symbols.
> 
> The series of patches integrates eppic with makdumpfile. These patches
> require eppic library libeppic.a and eppic_api.h header file. The
> libeppic.a library can be built from the eppic source code available
> at the following URL:
(Continue reading)

Aravinda Prasad | 16 Aug 2012 08:25
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic


On Monday 11 June 2012 02:14 PM, Atsushi Kumagai wrote:

> Hello Aravinda,
> 
> On Wed, 06 Jun 2012 15:34:23 +0530
> Aravinda Prasad <aravinda@...> wrote:
> 
>> makedumpfile security key filtering enhancement - Add Eppic language
>> support (formerly known as SIAL) to specify rules to scrub data in a
>> dumpfile. Eppic was previously part of crash source code repository.
>>
>> The following series of patches enhance the makedumpfile to provide
>> a more powerful way to specify rules and commands to traverse and
>> erase complex data structures in a dump file by integrating Embeddable
>> Pre-Processor and Interpreter for C (eppic).
>>
>> Eppic is an interpreter that facilitates access to the symbol and type
>> information stored in an executable image or a dump file. Eppic defines
>> a language semantic which is similar to C. Eppic macros can be used to
>> specify rules/commands to erase data in an image file. makedumpfile
>> will interpret the rules/commands provided by eppic macros with the
>> help of eppic library and will suitably erase the required data in a
>> dump file. Eppic provides a lot of language constructs like conditional
>> statements, logical and arithmetic operators, nested loops, functions,
>> etc., to traverse nested lists and trees and conditionally erase data
>> in the dump file, enabling users to literally erase any data in the
>> dump file which is accessible through global symbols.
>>
>> The series of patches integrates eppic with makdumpfile. These patches
(Continue reading)

Atsushi Kumagai | 17 Aug 2012 06:16
Picon
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hello Aravinda,

On Thu, 16 Aug 2012 11:55:55 +0530
Aravinda Prasad <aravinda@...> wrote:

> Hello Kumagai-san,
> 
> Did you get a chance to review the makedumpfile security key enhancement
> patches?
> 
> - Aravinda

Sorry for not responding.

I'm afraid that I can't start to review them yet.
I've been working on the cyclic mode feature for a few months,
and I'm now preparing the next release including the feature.

I'll release the next version soon, I'll review your patches after that.

Thanks
Atsushi Kumagai

> 
> > 
> > 
> > Thanks
> > Atsushi Kumagai
> > 
> >> TODO:
(Continue reading)

Mahesh Jagannath Salgaonkar | 12 Oct 2012 07:29
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

On 08/17/2012 09:46 AM, Atsushi Kumagai wrote:
> Hello Aravinda,
> 
> On Thu, 16 Aug 2012 11:55:55 +0530
> Aravinda Prasad <aravinda@...> wrote:
> 
>> Hello Kumagai-san,
>>
>> Did you get a chance to review the makedumpfile security key enhancement
>> patches?
>>
>> - Aravinda
> 
> Sorry for not responding.
> 
> I'm afraid that I can't start to review them yet.
> I've been working on the cyclic mode feature for a few months,
> and I'm now preparing the next release including the feature.
> 
> I'll release the next version soon, I'll review your patches after that.
> 

Hi Atsushi,

Did you get chance to review these patches?

Thanks,
-Mahesh.

>>
(Continue reading)

Atsushi Kumagai | 15 Oct 2012 06:46
Picon
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hello Mahesh,

On Fri, 12 Oct 2012 10:59:17 +0530
Mahesh Jagannath Salgaonkar <mahesh@...> wrote:

> On 08/17/2012 09:46 AM, Atsushi Kumagai wrote:
> > Hello Aravinda,
> > 
> > On Thu, 16 Aug 2012 11:55:55 +0530
> > Aravinda Prasad <aravinda@...> wrote:
> > 
> >> Hello Kumagai-san,
> >>
> >> Did you get a chance to review the makedumpfile security key enhancement
> >> patches?
> >>
> >> - Aravinda
> > 
> > Sorry for not responding.
> > 
> > I'm afraid that I can't start to review them yet.
> > I've been working on the cyclic mode feature for a few months,
> > and I'm now preparing the next release including the feature.
> > 
> > I'll release the next version soon, I'll review your patches after that.
> > 
> 
> Hi Atsushi,
> 
> Did you get chance to review these patches?
(Continue reading)

Aravinda Prasad | 15 Oct 2012 09:04
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hi Atsushi,

On 2012-10-15 10:16, Atsushi Kumagai wrote:

> Hello Mahesh,
> 
> On Fri, 12 Oct 2012 10:59:17 +0530
> Mahesh Jagannath Salgaonkar <mahesh@...> wrote:
> 
>> On 08/17/2012 09:46 AM, Atsushi Kumagai wrote:
>>> Hello Aravinda,
>>>
>>> On Thu, 16 Aug 2012 11:55:55 +0530
>>> Aravinda Prasad <aravinda@...> wrote:
>>>
>>>> Hello Kumagai-san,
>>>>
>>>> Did you get a chance to review the makedumpfile security key enhancement
>>>> patches?
>>>>
>>>> - Aravinda
>>>
>>> Sorry for not responding.
>>>
>>> I'm afraid that I can't start to review them yet.
>>> I've been working on the cyclic mode feature for a few months,
>>> and I'm now preparing the next release including the feature.
>>>
>>> I'll release the next version soon, I'll review your patches after that.
>>>
(Continue reading)

Atsushi Kumagai | 29 Oct 2012 09:06
Picon
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hello Aravinda,

Now, I have reviewed your patches to [PATCH 4/7], 
so please give me a little more time.

BTW, do you have any test case for this feature ?
If you can give it to me, it's very helpful.

Thanks
Atsushi Kumagai

On Wed, 06 Jun 2012 15:34:23 +0530
Aravinda Prasad <aravinda@...> wrote:

> makedumpfile security key filtering enhancement - Add Eppic language
> support (formerly known as SIAL) to specify rules to scrub data in a
> dumpfile. Eppic was previously part of crash source code repository.
> 
> The following series of patches enhance the makedumpfile to provide
> a more powerful way to specify rules and commands to traverse and
> erase complex data structures in a dump file by integrating Embeddable
> Pre-Processor and Interpreter for C (eppic).
> 
> Eppic is an interpreter that facilitates access to the symbol and type
> information stored in an executable image or a dump file. Eppic defines
> a language semantic which is similar to C. Eppic macros can be used to
> specify rules/commands to erase data in an image file. makedumpfile
> will interpret the rules/commands provided by eppic macros with the
> help of eppic library and will suitably erase the required data in a
> dump file. Eppic provides a lot of language constructs like conditional
(Continue reading)

Aravinda Prasad | 29 Oct 2012 11:15
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hi Atsushi,

Thanks for reviewing. I will work on your comments.

On 2012-10-29 13:36, Atsushi Kumagai wrote:

> Hello Aravinda,
> 
> Now, I have reviewed your patches to [PATCH 4/7], 
> so please give me a little more time.
>

sure...

 
> BTW, do you have any test case for this feature ?
> If you can give it to me, it's very helpful.
>

I have developed few semi-automated tests. I will automate it completely
and mail it to you in 2-3 days.

 
> 
> Thanks
> Atsushi Kumagai
> 
> 
> On Wed, 06 Jun 2012 15:34:23 +0530
> Aravinda Prasad <aravinda@...> wrote:
(Continue reading)

Atsushi Kumagai | 31 Oct 2012 05:21
Picon
Picon

Re: [PATCH 0/7] makedumpfile security key filtering with eppic

Hello Aravinda,

On Mon, 29 Oct 2012 15:45:37 +0530
Aravinda Prasad <aravinda@...> wrote:

> Hi Atsushi,
> 
> Thanks for reviewing. I will work on your comments.
> 
> On 2012-10-29 13:36, Atsushi Kumagai wrote:
> 
> > Hello Aravinda,
> > 
> > Now, I have reviewed your patches to [PATCH 4/7], 
> > so please give me a little more time.
> >
> 
> 
> sure...

I've finished reviewing your patches completely. 
Some errors are found by checkpatch.pl, so please check and fix each patches.

  $ <linux kernel source>/scripts/checkpatch.pl <your patch>

So, could you post the v2 patches which include my comments above and
in other threads ?

> > BTW, do you have any test case for this feature ?
> > If you can give it to me, it's very helpful.
(Continue reading)


Gmane