Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3440710imu; Sun, 11 Nov 2018 15:09:23 -0800 (PST) X-Google-Smtp-Source: AJdET5dIzbRNlby9K1DfIBja3U/60xsijDuQyEVTIJEwktqQrYhUF8q5ePoRI5mEtF7IEECYoQ/1 X-Received: by 2002:a63:4926:: with SMTP id w38mr14886941pga.353.1541977763746; Sun, 11 Nov 2018 15:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977763; cv=none; d=google.com; s=arc-20160816; b=Ew6Og0xtoA6O9IDbvpBNty7QUTLqrNz7wxni+yT2y6jOtHFaLZ/ksIe47SyJ3UpfCF BP16qPaVMlUFDcwzL2CJ2Jq16yMXnXdgckep/uLKj7FY6RF/I0oRW5Xm77MSPI5pvbvX OGvbzHjhu8dFYjmYrNgvtD9B55xHG0ep8YtU/ZceaxEXPGhVB04Hxazr8QV2cX4zpp5L LsL2+rcHCmPmuqoWV3dCu/a5D4JxV00ke7KqnaFCgF+ba/ztW5F6Ie8+tJ33V5SiP/7U 9kXWD7/bLtXJyDEmMVFzHbm+8H+wtGUDP5KfPNLz4f2vbyPesnKGlhSEWMR6W5m7b1sc WQ7w== 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=moPdbIe9f/gld5CcH3M6+9CGHzoIdaOc0LK05bVpnyk=; b=z5vY/8eOVI0uRr5ticwbcNWhNdaXvRKzIFASJnDbQNn1tArcp9LZBOyeRavi1+9mZ0 og0KpYfvwkLHYGyCc6aFwcT5nyOSNEIWdHOpOr0MEsD2S1GWaub2NrQ5lYvXaYee3Heh AcgdtAB69q1Nse2lYDkE+LOUBP9gjOSMycYrr3HTmqsy6ZRxM4G+Nq/prdk7KnOGEbuJ BD8qk3d3KSDYDKTyvN/ooqhElXTFNW1/LUk7biKcPJ9kN+zYCHcsEJ34u9IGtEi7Syn0 4yVNXus6rGQijoigMVUZ8pvHTByhMaa1NLXOfilfMZL6rW1ifxS+9O4cX7NHXmlLBgwu 1uiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BGzqVr/z"; 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 q8si14789707pgk.40.2018.11.11.15.09.08; Sun, 11 Nov 2018 15:09:23 -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="BGzqVr/z"; 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 S2390622AbeKLI6Y (ORCPT + 99 others); Mon, 12 Nov 2018 03:58:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:51332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390258AbeKLIWG (ORCPT ); Mon, 12 Nov 2018 03:22:06 -0500 Received: from localhost (unknown [206.108.79.134]) (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 4A3E12243E; Sun, 11 Nov 2018 22:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975529; bh=kQ21qQYPHwgyx9UA2qdNzEm74zl58M+ZKdVAWtCF/as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BGzqVr/zI9Y8ukfJiuNgKaYqUnsJJfzo1dl86k/thwC6cfS6gMeb1e3JKcx7qEW9S p+axALErQQEADMiZWhUbB84LhYPi8afAikwjRF6axw5SeIb+ycuCIITXiqWHa3tG2P PTTq6B0gGUQkMcdd1E1bpwNtp1+KsWR0S40eopeA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David S. Miller" , Jiri Olsa , Kan Liang , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 034/222] perf cpu_map: Align cpu map synthesized events properly. Date: Sun, 11 Nov 2018 14:22:11 -0800 Message-Id: <20181111221651.269123717@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Miller [ Upstream commit 0ed149cf5239cc6e7e65bf00f769e8f1e91076c0 ] The size of the resulting cpu map can be smaller than a multiple of sizeof(u64), resulting in SIGBUS on cpus like Sparc as the next event will not be aligned properly. Signed-off-by: David S. Miller Cc: Jiri Olsa Cc: Kan Liang Fixes: 6c872901af07 ("perf cpu_map: Add cpu_map event synthesize function") Link: http://lkml.kernel.org/r/20181011.224655.716771175766946817.davem@davemloft.net Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/event.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -951,6 +951,7 @@ void *cpu_map_data__alloc(struct cpu_map } *size += sizeof(struct cpu_map_data); + *size = PERF_ALIGN(*size, sizeof(u64)); return zalloc(*size); }