History

kprobes: Lock kprobe_mutex while showing kprobe_blacklist

Lock kprobe_mutex while showing kprobe_blacklist to prevent updating the kprobe_blacklist.

Masami Hiramatsu committed 6 years ago

Commit 4fdd8881 parent 2ef96a51 file · +7 −1Browse files

Unified · Split

kernel/kprobes.c+7−1
@@ -2420,6 +2420,7 @@ static const struct file_operations debugfs_kprobes_operations = { · 2419 unmodified lines
2420/* kprobes/blacklist -- shows which functions can not be probed */2420/* kprobes/blacklist -- shows which functions can not be probed */
2421static void *kprobe_blacklist_seq_start(struct seq_file *m, loff_t *pos)2421static void *kprobe_blacklist_seq_start(struct seq_file *m, loff_t *pos)
2422{2422{
2423 mutex_lock(&kprobe_mutex);
2423 return seq_list_start(&kprobe_blacklist, *pos);2424 return seq_list_start(&kprobe_blacklist, *pos);
2424}2425}
2425 2426
@@ -2446,10 +2447,15 @@ static int kprobe_blacklist_seq_show(struct seq_file *m, void *v) · 20 unmodified lines
2446 return 0;2447 return 0;
2447}2448}
2448 2449
2450static void kprobe_blacklist_seq_stop(struct seq_file *f, void *v)
2451{
2452 mutex_unlock(&kprobe_mutex);
2453}
2454
2449static const struct seq_operations kprobe_blacklist_seq_ops = {2455static const struct seq_operations kprobe_blacklist_seq_ops = {
2450 .start = kprobe_blacklist_seq_start,2456 .start = kprobe_blacklist_seq_start,
2451 .next = kprobe_blacklist_seq_next,2457 .next = kprobe_blacklist_seq_next,
2452 .stop = kprobe_seq_stop, /* Reuse void function */2458 .stop = kprobe_blacklist_seq_stop,
2453 .show = kprobe_blacklist_seq_show,2459 .show = kprobe_blacklist_seq_show,
2454};2460};
2455 2461

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t