Received: by 10.213.65.68 with SMTP id h4csp904400imn; Tue, 27 Mar 2018 10:55:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx48uM4EjsiV0xh+FqvDAMZ3izuXI79+WSlQU0U4Mvh8Y27nZBb6JWHpPEcm7tdlrznhDzHEr X-Received: by 2002:a17:902:b602:: with SMTP id b2-v6mr287886pls.11.1522173327071; Tue, 27 Mar 2018 10:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173327; cv=none; d=google.com; s=arc-20160816; b=ivGZeikaU0d5kKgz0WRtYwCXxNDiOBKSPrbtx6XG2o4qZbEdZMgfM53+Z+2U0WiVhM DVdOYrZZNb4qCVEmWYxU0VZTlwji4bRyaxaURfhgqiVuZrFoHz2mSo/6kNNfQHvHBFam Sgra8zMCnGtKNdHAIEtnWPBetVVsBU8fl9P/YrkOu9PU9UcUjV43pykmVreS+W1MJ65x Ycc/NBHkLR6uKxJt2VoPz0ZVKqgfNyPo+mQNHzSAPIellepkWNWk0uchjWa6LKdffC0i rS+uWsjPaW37svtxr0ocG4ZH9fdyE35W1faBMw6veLi9IdS8BKatj65oEvuPYJosW+VA NiNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PKANTlOIUy9vDUKzDCN7OvymnNV6h9Onohsm/O/WnTA=; b=B4uOHDoBDVDF9/az0pHB5wvkiaGOLq+bYcAgwRTSHkzAtOIhKknklqt4IamcUkjQE9 OhZmYtVJgekLmH4dMesWXqp0AFzu7n3QGtY5dLhOtVDL6PVNl2y7Zvjueewl+lpslkYY WDcTIgvJWneqYJ3rLUWY//+jLPSzVVHRoovAxwligR9SyDG7Y5Bi7PXheOFkAW37ucpr DkPhFpUOfiU7Pxj+uy1jd8TAWZxtz2wyUSxw72JNlyZEhdPYTvumWi9IVf+sC3IYJ4zm C8GrEk/IbzQHTQvHtWj77LY68FtwPdispmp7obQKuWQtTaBc+LGlev6Fjhyeb95aRRtr Zccg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j62si1111876pgc.583.2018.03.27.10.55.12; Tue, 27 Mar 2018 10:55:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753468AbeC0Qbw (ORCPT + 99 others); Tue, 27 Mar 2018 12:31:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43084 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027AbeC0Qbt (ORCPT ); Tue, 27 Mar 2018 12:31:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 34043EB5; Tue, 27 Mar 2018 16:31:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Mika Westerberg , Guenter Roeck , "Rafael J. Wysocki" Subject: [PATCH 4.9 33/67] ACPI / watchdog: Fix off-by-one error at resource assignment Date: Tue, 27 Mar 2018 18:27:25 +0200 Message-Id: <20180327162728.825261393@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit b1abf6fc49829d89660c961fafe3f90f3d843c55 upstream. The resource allocation in WDAT watchdog has off-one-by error, it sets one byte more than the actual end address. This may eventually lead to unexpected resource conflicts. Fixes: 058dfc767008 (ACPI / watchdog: Add support for WDAT hardware watchdog) Cc: 4.9+ # 4.9+ Signed-off-by: Takashi Iwai Acked-by: Mika Westerberg Acked-by: Guenter Roeck Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpi_watchdog.c | 4 ++-- drivers/watchdog/wdat_wdt.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c @@ -74,10 +74,10 @@ void __init acpi_watchdog_init(void) res.start = gas->address; if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { res.flags = IORESOURCE_MEM; - res.end = res.start + ALIGN(gas->access_width, 4); + res.end = res.start + ALIGN(gas->access_width, 4) - 1; } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { res.flags = IORESOURCE_IO; - res.end = res.start + gas->access_width; + res.end = res.start + gas->access_width - 1; } else { pr_warn("Unsupported address space: %u\n", gas->space_id); --- a/drivers/watchdog/wdat_wdt.c +++ b/drivers/watchdog/wdat_wdt.c @@ -392,7 +392,7 @@ static int wdat_wdt_probe(struct platfor memset(&r, 0, sizeof(r)); r.start = gas->address; - r.end = r.start + gas->access_width; + r.end = r.start + gas->access_width - 1; if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { r.flags = IORESOURCE_MEM; } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {