Reject the new event which has NULL location for kprobes. For kprobes, user must specify at least the location. Link: http://lkml.kernel.org/r/158779376597.6082.1411212055469099461.stgit@devnote2
Unified · Split
| @@ -940,6 +940,9 @@ EXPORT_SYMBOL_GPL(kprobe_event_cmd_init); · 939 unmodified lines | |||
| 940 | * complete command or only the first part of it; in the latter case, | 940 | * complete command or only the first part of it; in the latter case, |
| 941 | * kprobe_event_add_fields() can be used to add more fields following this. | 941 | * kprobe_event_add_fields() can be used to add more fields following this. |
| 942 | * | 942 | * |
| 943 | * Unlikely the synth_event_gen_cmd_start(), @loc must be specified. This | ||
| 944 | * returns -EINVAL if @loc == NULL. | ||
| 945 | * | ||
| 943 | * Return: 0 if successful, error otherwise. | 946 | * Return: 0 if successful, error otherwise. |
| 944 | */ | 947 | */ |
| 945 | int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe, | 948 | int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe, |
| @@ -953,6 +956,9 @@ int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe, · 7 unmodified lines | |||
| 953 | if (cmd->type != DYNEVENT_TYPE_KPROBE) | 956 | if (cmd->type != DYNEVENT_TYPE_KPROBE) |
| 954 | return -EINVAL; | 957 | return -EINVAL; |
| 955 | 958 | ||
| 959 | if (!loc) | ||
| 960 | return -EINVAL; | ||
| 961 | |||
| 956 | if (kretprobe) | 962 | if (kretprobe) |
| 957 | snprintf(buf, MAX_EVENT_NAME_LEN, "r:kprobes/%s", name); | 963 | snprintf(buf, MAX_EVENT_NAME_LEN, "r:kprobes/%s", name); |
| 958 | else | 964 | else |