Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp853268pxb; Tue, 14 Sep 2021 10:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI3/fNphU1u+uyx8UCEHdRnFZ1zwsNmsHHJZJvoohjT2XGgjQ8l4jB8pL4PzReXUb5Ak1H X-Received: by 2002:a05:6512:3b2c:: with SMTP id f44mr13588921lfv.178.1631639155375; Tue, 14 Sep 2021 10:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631639155; cv=none; d=google.com; s=arc-20160816; b=z3SC360v20kGV+687FhAOc4OADhNDhlHB0/leO8m9nAVER5GaA+fkBzfDOAuYHGKew 3WU6KtK1voGaMTMUnQo9TAwqOMpUrGe3I7JL81e+QdLSoyCfwxAPIDTAMVGTpcq71VYC tiM4SMaQyVmtngnioCJZU4MZyVElUVo3CbmiXciLnSqy2s/M3GwIAOx+7xMaYm3PcHF/ Bz+2//zSi//RXmebMjLEib8148aRARslVFT91QNTtQtmbfNOpWuSouymMyVlZ1Dp/j4v gRXT3FmorwL7QVvFnBmh9pqrOostxlkQYOseKIOgoNtrvQeOYzayOQGpTdoM9jnYtfKM K3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FpYuQdlRzK6GCWUca0dJ/6Mx9yTrRJx6ugkdNS5urhU=; b=K1sE/iLXEkdjk41XoDIW1QbbPd6AG9Vg46q96BsF8vAOz/BHX/Uq/VufXHMtiC88Lv /4AVrBkaiyTKVcOgWwZuAUEnq6PRb7AqaWDcISx9R+G0u1Cy0tFtAFcHm/T45+8ylOxL pMnVMnFM0erO3VEnPn46FoqElGPeuz1FltNKnAwwFrju8PRFSXaM4cHG0Jrpo9LoDZAn Pt/rIlLP0kicvxd8ep3WYYRTDqlaUM7cAs+tWmkzALgtypwLnfKiu2jReDnTTeu3lIX/ kxdidPB6ewLy81+0O8+Ke5bFymbYF5wHvArq5CWS6YgBn5mRErBDSeW/9vA1D6ZCA93d mAKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WwWUY0+y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si15199702lji.413.2021.09.14.10.05.25; Tue, 14 Sep 2021 10:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WwWUY0+y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbhINRCh (ORCPT + 99 others); Tue, 14 Sep 2021 13:02:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhINRCg (ORCPT ); Tue, 14 Sep 2021 13:02:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DAA44610E6; Tue, 14 Sep 2021 17:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631638879; bh=YaevgdA3tVWWqnK3qgrVO5mk33AE2bodpz5BWxEyBmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WwWUY0+ycvXN5JE7MclYpLdYiVyU4Us3oCwRmKhdQJleDF++Rgn+dMx/Zt3dlbr0v Z8BtyDYbPh7/siqDh8MmQmxzjjeMk5Z+8OP+sDlWgMGFkvQvlD4TkMckO2lT3mbi2R G/Yrwpw8P6DO/4MmRnRBAodlCJgprmEZa0TSw5GgXTG0Vayw39BOwna4XTOfCvjCmM rlx6o2URwvgOX/+S4cdqWpVSjSfTPmHuorKzKUiFSQDgjWmuQEmQQTBg1nJbdwp+Zq kk+QcAxgy8NFhH4N/br3ky+lSmprKvCTKTElPsRzHG3D03my1OwPc2OOqXtLiFj6h0 JQ7NvK+Qu1uKg== Date: Tue, 14 Sep 2021 13:01:17 -0400 From: Sasha Levin To: Dan Williams Cc: Linux Kernel Mailing List , stable , Ben Widawsky , Jonathan Cameron , linux-cxl@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.14 04/25] cxl/pci: Introduce cdevm_file_operations Message-ID: References: <20210913223339.435347-1-sashal@kernel.org> <20210913223339.435347-4-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 08:42:04AM -0700, Dan Williams wrote: >On Mon, Sep 13, 2021 at 3:33 PM Sasha Levin wrote: >> >> From: Dan Williams >> >> [ 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