On Mon, Mar 23, 2020 at 09:22:53PM +0800, Yufen Yu wrote: > Since kobj->name can be freed by bdi_unregister(), we try to copy > the name into buffer rather than return name pointer. This patch > is prepare for following patch to fix use-after-free for bdi->dev. Well, most of these should have a bdi reference, because if they didn't you couldn't copy out anyway. I think you want to audit the callsites and see who "leaks" the pointer and only copy in those cases. And then preferably send one patch per broken caller. I'm also not really sure if we need the new helper.