Re: [PATCH] driver core: Fix a null-ptr-deref in module_add_driver()

2024-08-12 Thread Greg Kroah-Hartman
On Mon, Aug 12, 2024 at 12:18:17PM +0200, Markus Elfring wrote: > > Inject fault while probing of-fpga-region, if kasprintf() fails in > > module_add_driver(), the second sysfs_remove_link() in exit path will cause > > null-ptr-deref as below because kernfs_name_hash() will call strlen() with > > N

Re: [PATCH] driver core: Fix a null-ptr-deref in module_add_driver()

2024-08-12 Thread Markus Elfring
> Inject fault while probing of-fpga-region, if kasprintf() fails in > module_add_driver(), the second sysfs_remove_link() in exit path will cause > null-ptr-deref as below because kernfs_name_hash() will call strlen() with > NULL driver_name. … How do you think about to use the term “null pointer

[PATCH] driver core: Fix a null-ptr-deref in module_add_driver()

2024-08-12 Thread Jinjie Ruan
Inject fault while probing of-fpga-region, if kasprintf() fails in module_add_driver(), the second sysfs_remove_link() in exit path will cause null-ptr-deref as below because kernfs_name_hash() will call strlen() with NULL driver_name. Fix it by releasing resources based on the exit path sequence.