[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+AMecGH_yugc7YQX2tqMSKzsA-aJYJSVBOVjiyYcw994-_Zng@mail.gmail.com>
Date: Thu, 16 Nov 2023 11:12:58 -0800
From: Yuanyuan Zhong <yzhong@...estorage.com>
To: Keith Busch <kbusch@...nel.org>
Cc: Jens Axboe <axboe@...nel.dk>, hch@....de, sagi@...mberg.me,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
randyj@...estorage.com, hcoutinho@...estorage.com
Subject: Re: [PATCH] nvme-core: remove head->effects to fix use-after-free
On Wed, Nov 15, 2023 at 7:52 PM Keith Busch <kbusch@...nel.org> wrote:
>
> On Wed, Nov 15, 2023 at 02:44:04PM -0800, Yuanyuan Zhong wrote:
> > On Wed, Nov 15, 2023 at 11:55 AM Keith Busch <kbusch@...nel.org> wrote:
> > >
> > > On Wed, Nov 15, 2023 at 11:21:53AM -0800, Yuanyuan Zhong wrote:
> > > > On Wed, Nov 15, 2023 at 11:02 AM Jens Axboe <axboe@...nel.dk> wrote:
> > > >
> > > > Do you mean something like this? If not, can you please elaborate
> > > > "when we need"?
> > > > - struct nvme_effects_log *cel = xa_load(&ctrl->cels, ns->head->ids.csi);
> > > > + struct nvme_effects_log *cel = (ns->head->ids.csi == NVME_CSI_NVM) ?
> > > > + ctrl->effects : xa_load(&ctrl->cels, ns->head->ids.csi);
> > > > Will it be good to change ctrl->effects to ctrl->effects[3] for
> > > > already defined CSI?
> > >
> > > I suggest either re-assign the cached head->effects to one from a still
> > > live controller when current path is removed, or move the saved effects
> > > to the subsystem instead of the controller. All controllers in the
> > > subsystem should be reporting the same effects log anyway, so
> > Is it specified in spec that all controllers in the subsystem
> > should be reporting the same effects log?
>
> Yes, in section 5.16.1.6, "Commands Supported and Effects":
>
> This log page is used to describe the commands that the controller
> supports and the effects of those commands on the state of the NVM
> subsystem.
>
> Oddly enough, Figure 202 says the scope of the log page is "Controller"
> rather than "Subsystem". Sounds like ECN potential. You can memcmp the
> effects log from each controller for a sanity check if you think some
> subsystem controllers messed that up.
Yeah, it says scope is controller.
I think it’s valid to start upgrading one controller in the subsystem
to report different
effects log, e.g. adding or revoking CSUPP for some opcode.
If the saved effects log is kept in the subsystem, how to refresh it
for the subsystem?
Powered by blists - more mailing lists