On Mon, Aug 7, 2023 at 3:34 PM Curtis Malainey cujomalainey@google.com wrote:
It's just a RFC and only lightly tested.
Thanks for the series
I will be hammering this in my test setup for next several hours
Testing has yielded 0 bugs overnight.
After discussion it seems like this might be more of a workaround for the APIs than properly using them. Adding Stephen for more input but having two kobj in the same allocation is technically not correct as you essentially refcounting the same thing twice. Also having an empty release function essentially nullifies the purpose of the refcounts. We should probably consider something that uses the API as intended rather than trying to fight their function.
Curtis
Curtis
I myself am not sure whether this is the best way to go. It might be better to take Curtis' approach, just converting the device to its own allocation, too. (But I don't know whether Curtis' patch set covers all cases -- can still be a UAF of card_dev due to devres vs kobj release?)
My original commit does not cover the devres kobj release race, only the race among the kobj themselves.
Curtis