Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933450AbcJUJWe (ORCPT ); Fri, 21 Oct 2016 05:22:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47203 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934591AbcJUJW0 (ORCPT ); Fri, 21 Oct 2016 05:22:26 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, linux-acpi@vger.kernel.org, Dan Williams , Linda Knippers , Vishal Verma Subject: [PATCH 4.8 56/57] acpi, nfit: check for the correct event code in notifications Date: Fri, 21 Oct 2016 11:18:19 +0200 Message-Id: <20161021091438.047981519@linuxfoundation.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161021091435.435647262@linuxfoundation.org> References: <20161021091435.435647262@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 55 4.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vishal Verma commit c09f12186d6b03b798832d95289af76495990192 upstream. Commit 209851649dc4 "acpi: nfit: Add support for hot-add" added support for _FIT notifications, but it neglected to verify the notification event code matches the one in the ACPI spec for "NFIT Update". Currently there is only one code in the spec, but once additional codes are added, older kernels (without this fix) will misbehave by assuming all event notifications are for an NFIT Update. Fixes: 209851649dc4 ("acpi: nfit: Add support for hot-add") Cc: Cc: Dan Williams Reported-by: Linda Knippers Signed-off-by: Vishal Verma Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/nfit/core.c | 3 +++ drivers/acpi/nfit/nfit.h | 4 ++++ 2 files changed, 7 insertions(+) --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2689,6 +2689,9 @@ static void acpi_nfit_notify(struct acpi dev_dbg(dev, "%s: event: %d\n", __func__, event); + if (event != NFIT_NOTIFY_UPDATE) + return; + device_lock(dev); if (!dev->driver) { /* dev->driver may be null if we're being removed */ --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h @@ -78,6 +78,10 @@ enum { NFIT_ARS_TIMEOUT = 90, }; +enum nfit_root_notifiers { + NFIT_NOTIFY_UPDATE = 0x80, +}; + struct nfit_spa { struct list_head list; struct nd_region *nd_region;