Received: by 10.213.65.68 with SMTP id h4csp852913imn; Tue, 27 Mar 2018 09:59:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx488fohueh76edIFx89bpC3iXKiU3QlD7+zkjfXssXPfx9N2H8lFUX76ImOz9VrHnb/UeQOu X-Received: by 10.99.110.198 with SMTP id j189mr69375pgc.71.1522169964450; Tue, 27 Mar 2018 09:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522169964; cv=none; d=google.com; s=arc-20160816; b=kMN8un68LAzy/bwZhkHqYGZ4TDO7LKjnLIJkDu2hvA6HNVSCD0yFe66i9BOkTx3WdF Gc+aNjg2SQqM1UefT5fABMGJEU/lX24G4tmq17jLdraLijGI1S7tWV/ZqYFfxe8LP7oI S3VlUo0tlPdMO5R2dhX675P65E/9crIlpp/TbrfWTCVnNyaTlx+vjEJJ0DJa7zYnBbF2 b5f1AAf98prcUtSkcFginGv7YKl9zVzCGbgRI8QbSrgEC2nRp6TyKRI+KiNgKhQcROBV lukCWpLKmrfVUQsQcEbCPafMb8Ljf1N5oLutJXlf09R9Av1QuJMHe7nqp1KRqPBiD1cR 2HDg== 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=/814o5Xw1iUZeIrAQuNx4m/TEM9PpGUpQVjYySi0zrY=; b=fTKIegDwaZADwPnDlWhtRUnqpE6HuAzEr82Xx7aNr1FFbxFKyhOuL9s/DjYe9h7csH J/Tv1vmZ0ZON0+Ja7STWHkYxYKll7sh4syaDhtztlrJ00g2OQB2QH6EaxH7lXosX3n3M JlO+57QW3U2Yns/ofNHvp5gyyY7MVQ8cT6eCwbiI0CMRG1+Ho2leYYEKuc8Xb53qI7D2 4NpwhkjmJ9F+awBM4ed5jdy3IwqPNfWjrFAEG9OMFv0WjL0zQmKdWynbIPg3nBcQh1FF f9+3YiD5fK5XVOZkAR2t+kAViDCPo37g1fPOH/WZIcYxSE7Hq+s6at1/G95WCzZRaD7x ujTQ== 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 r9si1286182pfg.8.2018.03.27.09.59.09; Tue, 27 Mar 2018 09:59:24 -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 S932539AbeC0QlZ (ORCPT + 99 others); Tue, 27 Mar 2018 12:41:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48706 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755530AbeC0QlX (ORCPT ); Tue, 27 Mar 2018 12:41:23 -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 718F2EF9; Tue, 27 Mar 2018 16:41:22 +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.15 065/105] ACPI / watchdog: Fix off-by-one error at resource assignment Date: Tue, 27 Mar 2018 18:27:45 +0200 Message-Id: <20180327162801.706198836@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@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.15-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) {