Re: [PATCH] i2c: core: fix potential use-after-free on adapter removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michał,

> I looked briefly at the kobject machinery and it seems to ignore module
> dependencies. So while both approaches might work, I'd usually reverse

Thanks for checking!

> the order the init code is using: in this case module_get+device_get,
> so on release: device_put+module_put. I don't know what keeps the kernel

I agree this is good style. I'll add a comment why we reverse the order.
This will be also good to avoid regressions.

> from unloading the module after module_put() and before the function
> returns, but I assume that would blow up for both patches.

Yes. There are other users in the kernel doing it like this (RTC and
regmap IIRC), so I think problems would have become visible by then.

Thank you for your help!

   Wolfram

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux