Restrict kstats and print real pointers

There are several places where we use zfs_dbgmsg and %p to
print pointers. In the Linux kernel, these values obfuscated
to prevent information leaks which means the pointers aren't
very useful for debugging crash dumps. We decided to restrict
the permissions of dbgmsg (and some other kstats while we were
at it) and print pointers with %px in zfs_dbgmsg as well as
spl_dumpstack

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Gallagher <john.gallagher@delphix.com>
Signed-off-by: sara hartse <sara.hartse@delphix.com>
Closes #8467 
Closes #8476
This commit is contained in:
Sara Hartse
2019-04-04 18:57:06 -07:00
committed by Brian Behlendorf
parent af65079300
commit a887d653b3
18 changed files with 33 additions and 17 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ void spl_dumpstack(void);
if (!(_verify3_left OP _verify3_right)) \
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
"failed (%p " #OP " %p)\n", \
"failed (%px" #OP " %px)\n", \
(void *) (_verify3_left), \
(void *) (_verify3_right)); \
} while (0)
+1 -1
View File
@@ -196,7 +196,7 @@ extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
extern void kstat_proc_entry_init(kstat_proc_entry_t *kpep,
const char *module, const char *name);
extern void kstat_proc_entry_delete(kstat_proc_entry_t *kpep);
extern void kstat_proc_entry_install(kstat_proc_entry_t *kpep,
extern void kstat_proc_entry_install(kstat_proc_entry_t *kpep, mode_t mode,
const struct file_operations *file_ops, void *data);
extern void __kstat_install(kstat_t *ksp);
+1
View File
@@ -58,6 +58,7 @@ typedef struct procfs_list_node {
void procfs_list_install(const char *module,
const char *name,
mode_t mode,
procfs_list_t *procfs_list,
int (*show)(struct seq_file *f, void *p),
int (*show_header)(struct seq_file *f),
+1
View File
@@ -375,6 +375,7 @@ typedef struct procfs_list_node {
void procfs_list_install(const char *module,
const char *name,
mode_t mode,
procfs_list_t *procfs_list,
int (*show)(struct seq_file *f, void *p),
int (*show_header)(struct seq_file *f),