Ah, I see. I thought that you said ri is use-after-free, but in reality,
rp is use-after-free (use-after-init). OK.
And the problem here is destructive, it destroyed all the data of theYes, so I think we should do
previously registered kretprobe,
it can lead to a system crash, memory leak, use-after-free and even some
other unexpected behavior.
+ /* Return error if it's being re-registered */
+ ret = check_kprobe_rereg(&rp->kp);
+ if (WARN_ON(ret))
+ return ret;
This will give a warning message to the developer.
Thank you,