Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
nullpage.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 The University of Utah
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef __NULLPAGE_H__
20 #define __NULLPAGE_H__
21 
22 #include <glib.h>
23 #include "common.h"
24 #include "target_api.h"
25 #include "probe_api.h"
26 
27 struct np_config {
28  unsigned int do_mmap:1,
29  do_mprotect:1,
30  do_pgfault:1;
31  int ttctx;
32  int ttdetail;
33 };
34 
35 struct np_status {
36  struct np_config *config;
37 
38  struct target *target;
39 
40  /* Metaprobe. */
41  struct probe *np_probe;
42 
43  /* Subordinate probes. */
45  struct probe *mmap_probe;
47 
48  unsigned int mmap_violations;
49  unsigned int mprotect_violations;
50  unsigned int pgfault_violations;
51  unsigned int total_violations;
52 };
53 
54 #define NP_IS_MMAP(trigger,nps) ((trigger) == (nps)->mmap_probe)
55 #define NP_IS_MPROTECT(trigger,nps) ((trigger) == (nps)->mprotect_probe)
56 #define NP_IS_PGFAULT(trigger,nps) ((trigger) == (nps)->pgfault_probe)
57 
58 /*
59  * Create a null-page r/w/x "probe".
60  */
61 struct probe *probe_np(struct target *target,struct np_config *npc,
63  void *handler_data);
64 
65 extern struct argp np_argp;
66 
67 #endif /* __NULLPAGE_H__ */
result_t pre_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
Definition: spf.c:903
struct probe * mmap_probe
Definition: nullpage.h:45
int ttctx
Definition: nullpage.h:31
unsigned int pgfault_violations
Definition: nullpage.h:50
struct target * target
Definition: nullpage.h:38
struct probe * np_probe
Definition: nullpage.h:41
int ttdetail
Definition: nullpage.h:32
unsigned int do_mmap
Definition: nullpage.h:28
unsigned int do_pgfault
Definition: nullpage.h:28
struct argp np_argp
Definition: nullpage_util.c:48
struct probe * pgfault_probe
Definition: nullpage.h:44
result_t(* probe_handler_t)(struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
Definition: probe_api.h:70
unsigned int mmap_violations
Definition: nullpage.h:48
Definition: probe.h:308
unsigned int mprotect_violations
Definition: nullpage.h:49
struct np_config * config
Definition: nullpage.h:36
unsigned int do_mprotect
Definition: nullpage.h:28
result_t post_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
Definition: spf.c:908
struct probe * probe_np(struct target *target, struct np_config *npc, probe_handler_t pre_handler, probe_handler_t post_handler, void *handler_data)
struct probe * mprotect_probe
Definition: nullpage.h:46
unsigned int total_violations
Definition: nullpage.h:51
struct np_config npc