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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hjq+X=Gej072jwY2Uf4BgvqPHvHTON2p0Mszd5ntjjJA@mail.gmail.com>
Date:   Tue, 16 Nov 2021 17:29:56 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Qian Cai <quic_qiancai@...cinc.com>
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] software node: Skip duplicated software_node sysfs

On Tue, Nov 16, 2021 at 4:54 AM Qian Cai <quic_qiancai@...cinc.com> wrote:
>
> On Fri, Nov 05, 2021 at 09:39:42PM +0200, Andy Shevchenko wrote:
> > > Anyway, what's the "upper layer"? Is that "struct device" or "struct
> > > swnode"? I suppose you meant:
> >
> > struct device here.
> >
> > > - Remove "secondary" field from "struct fwnode_handle".
> > > - Replace "fwnode" from "upper layer" with
> > >   "struct list_head fwnode_head;".
> > > - Modify all functions in "software_node_ops" to use "fwnode_head".
> > >
> > > Is that correct?
> >
> > Yes.
> >
> > It might be a bit complicated taking into account how much fwnode is
> > spreaded in the kernel... Basically, you need to fix all direct
> > accesses to the dev->fwnode first.
> > Besides that you need to check that fwnode, which is used out of the
> > device scope, like in IRQ domains, doesn't use secondary pointer(s).
> >
> > This nevertheless adds a lot of flexibility and we may add whatever
> > type of fwnodes and mix them together.
>
> Okay, here is my plan until someone still has an idea to avoid a
> redesign.
>
> Frist, fixes all dev->fwnode / dev.fwnode to use dev_fwnode(). This
> could be a standalone tree-wide patchset going out to avoid
> heavy-lifting later.
>
> Then, we can create another patchset on top. I have audited
> "irq_domain" but not seen any "secondary" leakage. Struct
> "cht_int33fe_data" does have some need to fix.
>
> Rename set_secondary_fwnode() to insert_secondary_fwnode(). Fix things
> in drivers/base/core.c, swnode.c etc to use the new fwnode_head and
> anything I can't think of right now.
>
> Since we will have multiple "software_node" (secondary fwnode:s) for a
> single "device". What would be the usual way to deal with a
> linked-list in the sysfs? I can think of just let "software_node"
> become a directory to host a list of symlinks named from
> swnode->id. Thoughts?

Note that one pointer dereference in ACPI_COMPANION() is enough.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ