lkml.org 
[lkml]   [2021]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH AUTOSEL 5.14 04/25] cxl/pci: Introduce cdevm_file_operations
On Tue, Sep 14, 2021 at 08:42:04AM -0700, Dan Williams wrote:
>On Mon, Sep 13, 2021 at 3:33 PM Sasha Levin <sashal@kernel.org> wrote:
>>
>> From: Dan Williams <dan.j.williams@intel.com>
>>
>> [ Upstream commit 9cc238c7a526dba9ee8c210fa2828886fc65db66 ]
>>
>> In preparation for moving cxl_memdev allocation to the core, introduce
>> cdevm_file_operations to coordinate file operations shutdown relative to
>> driver data release.
>>
>> The motivation for moving cxl_memdev allocation to the core (beyond
>> better file organization of sysfs attributes in core/ and drivers in
>> cxl/), is that device lifetime is longer than module lifetime. The cxl_pci
>> module should be free to come and go without needing to coordinate with
>> devices that need the text associated with cxl_memdev_release() to stay
>> resident. The move will fix a use after free bug when looping driver
>> load / unload with CONFIG_DEBUG_KOBJECT_RELEASE=y.
>>
>> Another motivation for passing in file_operations to the core cxl_memdev
>> creation flow is to allow for alternate drivers, like unit test code, to
>> define their own ioctl backends.
>
>Hi Sasha,
>
>Please drop this. It's not a fix, it's just a reorganization for
>easing the addition of new features and capabilities.

I'll drop it, but just to satisfy my curiousity: the description says it
fixes a use-after-free bug in the existing code, is it not the case?

--
Thanks,
Sasha

\
 
 \ /
  Last update: 2021-09-14 19:02    [W:0.172 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site