On 2023/9/12 5:39, Steven Rostedt wrote:
> On Mon, 11 Sep 2023 20:51:25 +0900
> Masami Hiramatsu (Google) wrote:
>
>> Instead,
>>
>> ef = eventfs_add_subsystem_dir(name, parent);
>> if (IS_ERR(ef)) {
>> ...
>> } else
>> dir->ef = ef;
>
>
> Note, as th
On 2023/9/11 19:51, Masami Hiramatsu (Google) wrote:
> Hi Jinjie,
>
> On Mon, 11 Sep 2023 13:28:17 +0800
> Jinjie Ruan wrote:
>
>> Inject fault while probing btrfs.ko, if kstrdup() fails in
>> eventfs_prepare_ef() in eventfs_add_dir(), it will return ERR_PTR
>> to assign file->ef. But the eve
Inject fault while probing btrfs.ko, if kstrdup() fails in
eventfs_prepare_ef() in eventfs_add_dir(), it will return ERR_PTR
to assign file->ef. But the eventfs_remove() check NULL in
trace_module_remove_events(), which causes the below NULL
pointer dereference.
As both Masami and Steven suggest,
On Mon, 11 Sep 2023 20:51:25 +0900
Masami Hiramatsu (Google) wrote:
> Instead,
>
> ef = eventfs_add_subsystem_dir(name, parent);
> if (IS_ERR(ef)) {
> ...
> } else
> dir->ef = ef;
Note, as the error has a goto out_free, it just needs to be:
Hi Jinjie,
On Mon, 11 Sep 2023 13:28:17 +0800
Jinjie Ruan wrote:
> Inject fault while probing btrfs.ko, if kstrdup() fails in
> eventfs_prepare_ef() in eventfs_add_dir(), it will return ERR_PTR
> to assign file->ef. But the eventfs_remove() check NULL in
> trace_module_remove_events(), which cau