Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1437993
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 10/12] lkdtm: reorganize module paramaters |
| Date | 2016-07-07 00:40 +0200 |
| Message-ID | <rS3E6-6Mf-35@gated-at.bofh.it> (permalink) |
| References | <rS3E5-6Mf-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This reorganizes module parameters and global variables in the source
so they're grouped together with comments. Also moves early function
declarations to the top of the file.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/misc/lkdtm_core.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/misc/lkdtm_core.c b/drivers/misc/lkdtm_core.c
index 31b22f3b5fae..ff28bd03a9e8 100644
--- a/drivers/misc/lkdtm_core.c
+++ b/drivers/misc/lkdtm_core.c
@@ -51,6 +51,11 @@
#include "lkdtm.h"
+#define DEFAULT_COUNT 10
+
+static int lkdtm_parse_commandline(void);
+static void lkdtm_handler(void);
+
enum cname {
CN_INVALID,
CN_INT_HARDWARE_ENTRY,
@@ -159,29 +164,30 @@ static char* cp_type[] = {
"USERCOPY_KERNEL",
};
+/* Global jprobe entry and crashtype. */
static struct jprobe lkdtm_jprobe;
+static enum cname lkdtm_crashpoint = CN_INVALID;
+static enum ctype lkdtm_crashtype = CT_NONE;
-static int lkdtm_parse_commandline(void);
-static void lkdtm_handler(void);
-
-#define DEFAULT_COUNT 10
-static char* cpoint_name;
-static char* cpoint_type;
-static int cpoint_count = DEFAULT_COUNT;
-static int recur_count = -1;
+/* Global crash counter and spinlock. */
static int crash_count = DEFAULT_COUNT;
static DEFINE_SPINLOCK(crash_count_lock);
-static enum cname lkdtm_crashpoint = CN_INVALID;
-static enum ctype lkdtm_crashtype = CT_NONE;
-
+/* Module parameters */
+static int recur_count = -1;
module_param(recur_count, int, 0644);
MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test");
+
+static char* cpoint_name;
module_param(cpoint_name, charp, 0444);
MODULE_PARM_DESC(cpoint_name, " Crash Point, where kernel is to be crashed");
+
+static char* cpoint_type;
module_param(cpoint_type, charp, 0444);
MODULE_PARM_DESC(cpoint_type, " Crash Point Type, action to be taken on "\
"hitting the crash point");
+
+static int cpoint_count = DEFAULT_COUNT;
module_param(cpoint_count, int, 0644);
MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\
"crash point is to be hit to trigger action");
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/12] lkdtm: use struct arrays instead of enums Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 07/12] lkdtm: remove intentional off-by-one array access Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 09/12] lkdtm: rename globals for clarity Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 05/12] lkdtm: split heap corruption tests to separate file Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 04/12] lkdtm: split memory permissions tests to separate file Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 08/12] lkdtm: rename "count" to "crash_count" Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 03/12] lkdtm: split usercopy tests to separate file Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 06/12] lkdtm: split remaining logic bug tests to separate file Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 01/12] lkdtm: add usercopy test for blocking kernel text Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 11/12] lkdtm: move jprobe entry points to start of source Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 10/12] lkdtm: reorganize module paramaters Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 02/12] lkdtm: drop "alloc_size" parameter Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200 [PATCH 12/12] lkdtm: use struct arrays instead of enums Kees Cook <keescook@chromium.org> - 2016-07-07 00:40 +0200
csiph-web