Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp996658yba; Thu, 4 Apr 2019 02:03:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwITh3qzstO+LEA9SW659HJkU0YhL5+ak0vuuNmwj+xMv+acJny64y+uz3EvvcS9KWE1cll X-Received: by 2002:a17:902:7c94:: with SMTP id y20mr5171505pll.263.1554368582444; Thu, 04 Apr 2019 02:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368582; cv=none; d=google.com; s=arc-20160816; b=zfeS2lck3yav7VMxwAiARi6W4WkpkDKaVtmXT++oAgfR4BGPy9HvKQZBIdy/uPJnUw QAS2v9QbDnn8Ps2CBH3ZKCmOyLuvva6RJkN/vs55+ImtdFbLfxbVL+rdvEBhsaehC90W 4cLyp8fyKC9HB7HsyzsGcFlL9wSfHjDyQLR76qNPrENNAlk01Z0BK9QhmcXBYRxtuVa0 2yYrWizaohvBXIwCDkXSTFFXVcLWqO69DZX4ATh4RBRZuprXIJp0yKUCWLC1WiibUqST DSO139u/8DbOm6ZB/PUAfjbtUQemhXGTykv5gz/Gn+1KgZZAqrttc6afS4qt70u32uog GjYQ== 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=V67UBzmWh/Se0hKWBe6G9iPa9FQGOYIcDloz2ynKC4A=; b=bH+H8IM+21Gaqoz0q5KrMGixDDNORg6HO4iBFsZW6ompY7fM5mybQWlPuA1aVmfy4A K2jl84RSj/QQUqdDIRiOMoL9gJA0a/KX2wUDuKMCY3pEsyU5/2PPgKW43eI/8RdxOml2 0TKakBClS7n7rH5jImcnkwKBw4WzypuYhQcIzI1P8PiOkeQ1HOfXXO+EbjACPAyt98Kd rDwNQ0txkQwFHfk534C8fkC3op7ouVG7C0oGp8XIwT7pCGdCB4hEOtxXKFVTJj6n7dYd JNGhkIP49yuVdA2fmUR7WX7lEbmb4YUVjpoeqUGbQdcIXVUX5AJVkfFcJE6KjZcwLtv1 Ht5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FkcBrKTI; 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 k131si16544130pga.267.2019.04.04.02.02.47; Thu, 04 Apr 2019 02:03:02 -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; dkim=pass header.i=@kernel.org header.s=default header.b=FkcBrKTI; 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 S1731338AbfDDJA5 (ORCPT + 99 others); Thu, 4 Apr 2019 05:00:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730796AbfDDJA4 (ORCPT ); Thu, 4 Apr 2019 05:00:56 -0400 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 EE2992147C; Thu, 4 Apr 2019 09:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368455; bh=CZNO1lL9H7pbJ1hSwgb/8om7g63B+27EBD3SWXODV3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FkcBrKTIq3JOmuZ7hJapvQX30tI8WE3xiMbhHfHmHTsVSVIIB3WOI+fPUwwNELBXT gXiQi4ZJ6uNH6EytcjYazbpa6W8ZctdnFo+hGjUXR39ioQ1PMLZ/hQ/8s503zE3ZdW n0ecFyZm+BHuLzFArGb9oybmiKp8qHzGpu9a1FXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Sartain , Mathias Krause , Tony Jones , "Steven Rostedt (VMware)" , Frederic Weisbecker , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.19 046/187] tools lib traceevent: Fix buffer overflow in arg_eval Date: Thu, 4 Apr 2019 10:46:23 +0200 Message-Id: <20190404084605.242178977@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 7c5b019e3a638a5a290b0ec020f6ca83d2ec2aaa ] Fix buffer overflow observed when running perf test. The overflow is when trying to evaluate "1ULL << (64 - 1)" which is resulting in -9223372036854775808 which overflows the 20 character buffer. If is possible this bug has been reported before but I still don't see any fix checked in: See: https://www.spinics.net/lists/linux-perf-users/msg07714.html Reported-by: Michael Sartain Reported-by: Mathias Krause Signed-off-by: Tony Jones Acked-by: Steven Rostedt (VMware) Cc: Frederic Weisbecker Fixes: f7d82350e597 ("tools/events: Add files to create libtraceevent.a") Link: http://lkml.kernel.org/r/20190228015532.8941-1-tonyj@suse.de Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/lib/traceevent/event-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 75de355a63d6..10985d991ed2 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -2416,7 +2416,7 @@ static int arg_num_eval(struct print_arg *arg, long long *val) static char *arg_eval (struct print_arg *arg) { long long val; - static char buf[20]; + static char buf[24]; switch (arg->type) { case PRINT_ATOM: -- 2.19.1