lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YquFY50LfsezqrVn@shikoro>
Date:   Thu, 16 Jun 2022 21:32:51 +0200
From:   Wolfram Sang <wsa@...nel.org>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc:     linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: core: fix potential use-after-free on adapter
 removal

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


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ