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: <CAPcyv4ikttQ2zjo9QZ4bSW5inX4z9cKvpL8JfMr0ugQfwFB3Jg@mail.gmail.com>
Date:   Thu, 1 Sep 2016 12:46:21 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     "linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>
Cc:     Linux ACPI <linux-acpi@...r.kernel.org>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Toshi Kani <toshi.kani@....com>
Subject: Re: [PATCH 2/3] acpi, nfit: add dimm device notification support

On Tue, Aug 23, 2016 at 2:54 PM, Dan Williams <dan.j.williams@...el.com> wrote:
> Per "ACPI 6.1 Section 9.20.3" NVDIMM devices, children of the ACPI0012
> NVDIMM Root device, can receive health event notifications.
>
> Given that these devices are precluded from registering a notification
> handler via acpi_driver.acpi_device_ops (due to no _HID), we use
> acpi_install_notify_handler() directly.  The registered handler,
> acpi_nvdimm_notify(), triggers a poll(2) event on the nmemX/nfit/flags
> sysfs attribute when a health event notification is received.
>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Cc: Toshi Kani <toshi.kani@....com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> ---
>  drivers/acpi/nfit/core.c   |   83 ++++++++++++++++++++++++++++++++++++++++++--
>  drivers/acpi/nfit/nfit.h   |    5 +++
>  drivers/nvdimm/dimm_devs.c |    6 +++
>  include/linux/libnvdimm.h  |    1 +
>  4 files changed, 91 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 8120e8218f93..65f155db4283 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
[..]
> @@ -2400,6 +2464,7 @@ static int acpi_nfit_desc_init_scrub_attr(struct acpi_nfit_desc *acpi_desc)
>
>  static void acpi_nfit_destruct(void *data)
>  {
> +       struct nfit_mem *nfit_mem;
>         struct acpi_nfit_desc *acpi_desc = data;
>         struct device *bus_dev = to_nvdimm_bus_dev(acpi_desc->nvdimm_bus);
>
> @@ -2415,6 +2480,16 @@ static void acpi_nfit_destruct(void *data)
>          * either submit or see ->cancel set.
>          */
>         device_lock(bus_dev);
> +       /*
> +        * Clear out the nfit_mem->flags_attr and shut down dimm event
> +        * notifications.
> +        */
> +       list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) {
> +               sysfs_put(nfit_mem->flags_attr);
> +               nfit_mem->flags_attr = NULL;

We need to check if flags_attr is NULL here in the case when the DIMM
failed to initialize.  I believe the crash I am hitting is fixed by
Toshi's patch https://patchwork.kernel.org/patch/9284427/, but I'll
still fix this up for other cases.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ