Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5997643ybc; Wed, 27 Nov 2019 13:08:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwxymdCFb7DOZKTIMIWItVba6J1PuEg02Ff79FeCtzropedbqUKEJ2fptOFMGz2FJpNhSh/ X-Received: by 2002:a50:a2c5:: with SMTP id 63mr35094067edm.48.1574888890223; Wed, 27 Nov 2019 13:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888890; cv=none; d=google.com; s=arc-20160816; b=TQ+OfGNDtB6OPRBYOe21gUZwoO8fwnZS0QKpAesj+cVAR3NtFP2ExPQtnHaoqaQ4pq 1H7MBxDn14mqfGQDuwXRzJGXrC6volF/tidC1meGCKDUbfJolHt8veisgqC5VeyIpqAJ huYqy81YcblPGoW+qpWU2+3KI5bBmuuoS0IUs9e977SEXuUk/LtufpEEuMUYnIgHXcgY C8CgvJ1SZim17wLGj5a1vbev20d6GZAN+LsHEQxX7Jf4G0zycylx5Cy8j+CHfEku09pq fzyKCt8rw+rl6A4lu55/17f1/Na9n7IZgz1mWfB+19S8OhwZNNGYJLpuG6Iv7yPOetj6 eGmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DGjHdPTIpEVdElyfCex3dlraXi0rGT2dVIZC6PS6D2Q=; b=L/yJvyI1lAQ3GsaDC8wZc3wLqNBZkidhp68ND38gzdusukEOlVDx8gpac5XCFXXg+n BNta7JVyG+GpJsmCD18CHPdcgCHCACL1w7mXqy6gQUvgBHc7l3ybg5QJHUJbgULmxKfS zE16aEw14nJR8+PcxtKU/Ki2//REb+NtETXUdvWZyx76Pb2R5RsJYOODPulAXtMznUR+ +nFe68eqX4KvnVRpdrQUp48i0kGNn7d8e59ABGb9yP/UdcCqiIl0XeWHkIZJkp8RqlnA aQKAWFroprjQ4XD3cwV8z1lc1TV/Rp/CSlOcv1huowqbIV0i2pRUEawwS/BmH8HLrauz hU5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IFwnjBI4; 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 o28si12003085edc.353.2019.11.27.13.07.46; Wed, 27 Nov 2019 13:08:10 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=IFwnjBI4; 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 S1731299AbfK0VEp (ORCPT + 99 others); Wed, 27 Nov 2019 16:04:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:58254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbfK0VEm (ORCPT ); Wed, 27 Nov 2019 16:04:42 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 849C92086A; Wed, 27 Nov 2019 21:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888681; bh=O+KNYKwrYXlnpwO1GIlUFnzRl1BQrKkUD6M9YTg3B08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IFwnjBI4duFcFXok4hMqj2oEWPzCGS0oEaAUlI0aV6it02BEx+/1M1ske2EE3T25l IW/2CdcAiTlQuP3dv7LXKL5dcXAKXR++8aGJCVQiw0Pmoq5xwr3KFt9RM/+5dSKYMI 3MVhtcOgx0aS4oL5g7g5r/v1TiILPS2Wz+5wRrXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Kelley , Thomas Gleixner , KY Srinivasan , Sasha Levin Subject: [PATCH 4.19 191/306] irq/matrix: Fix memory overallocation Date: Wed, 27 Nov 2019 21:30:41 +0100 Message-Id: <20191127203129.186296434@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Kelley [ Upstream commit 57f01796f14fecf00d330fe39c8d2477ced9cd79 ] IRQ_MATRIX_SIZE is the number of longs needed for a bitmap, multiplied by the size of a long, yielding a byte count. But it is used to size an array of longs, which is way more memory than is needed. Change IRQ_MATRIX_SIZE so it is just the number of longs needed and the arrays come out the correct size. Fixes: 2f75d9e1c905 ("genirq: Implement bitmap matrix allocator") Signed-off-by: Michael Kelley Signed-off-by: Thomas Gleixner Cc: KY Srinivasan Link: https://lkml.kernel.org/r/1541032428-10392-1-git-send-email-mikelley@microsoft.com Signed-off-by: Sasha Levin --- kernel/irq/matrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c index 92337703ca9fd..30cc217b86318 100644 --- a/kernel/irq/matrix.c +++ b/kernel/irq/matrix.c @@ -8,7 +8,7 @@ #include #include -#define IRQ_MATRIX_SIZE (BITS_TO_LONGS(IRQ_MATRIX_BITS) * sizeof(unsigned long)) +#define IRQ_MATRIX_SIZE (BITS_TO_LONGS(IRQ_MATRIX_BITS)) struct cpumap { unsigned int available; -- 2.20.1