Re: [PATCH] drivers core: don't do anything in device_del() when device_add() fail

2021-04-02 Thread Greg KH
On Thu, Apr 01, 2021 at 09:01:38AM -0400, Yufen Yu wrote: > Recently, our syzbot test reported NULL pointer dereference in > device_del() by injecting memory allocation fail in device_add(). Don't do that :) > For now, callers of device_add(), such as add_disk(), may ignore > device_add()'s fail

Re: [PATCH] drivers core: don't do anything in device_del() when device_add() fail

2021-04-01 Thread Rafael J. Wysocki
On Thu, Apr 1, 2021 at 2:56 PM Yufen Yu wrote: > > Recently, our syzbot test reported NULL pointer dereference in > device_del() by injecting memory allocation fail in device_add(). > > For now, callers of device_add(), such as add_disk(), may ignore > device_add()'s fail and go on working. In unr

[PATCH] drivers core: don't do anything in device_del() when device_add() fail

2021-04-01 Thread Yufen Yu
Recently, our syzbot test reported NULL pointer dereference in device_del() by injecting memory allocation fail in device_add(). For now, callers of device_add(), such as add_disk(), may ignore device_add()'s fail and go on working. In unregister path, it will call device_del() from del_gendisk().