Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp859541ybi; Sun, 30 Jun 2019 02:04:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrGQj9V5UA78q3mu4JK6/wAXu5hpWHuHy47mA4+TvlmCp7r2DZB+oe7NNnB2q1xUGaSGU3 X-Received: by 2002:a17:90a:bb8b:: with SMTP id v11mr23610764pjr.64.1561885465420; Sun, 30 Jun 2019 02:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561885465; cv=none; d=google.com; s=arc-20160816; b=fX8r8+CiFIh3oA87Q0RoJHgZs1yKE4uJjriF/8k/NtEeOOoIuXtoEhg1Day1GVl8dO /9VzgzZo0iQofzCkhEJPOV32N8OOXiLcI0trOPJw7WhyRFz2wh/R1o94y10wiOyIrpYP rlRQQzZoqoDldN5s0ErAtvrS4fMuzzSN5ioXvRPlc1WudX1n/NcPwZDvzb4Adv6K2w/Y 21w+OIv+oDoWbbaJmITC95sk790CFYf46+YMLvsZznmfg1bcPXMogaTu5AHVbDYwE/lB PWWRLPDO67z8m+/T8bkNq1W5yzLFSL12r226LR7krVl88jJh0w9u1Mybn74GIZ8SoGdb zbHQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=rW6hBoo1Zrh9QrQY/e74REo8uL+nhi2gj6+w+fB33Bg=; b=LitoA20Dzl2fWwjxiJRC8Mohc0TAg05yRJvHKfEmMJDpAMfzjU3BVisLpSV/RLVlVT akZcd7ZoipxnwBkjVeEkDG2R7nw340zLZyeCNVUJumCaWRcf8LOoDvZsrHuxICm7OaSO eSuIwOyadUgUWQzXXxxiT5vl5wECbCvQwIoXst1vb8k73FCmxvv1oGmHAfT7DA6BTaEw 63aSuVToBSD+YExc+XLRQELF7QADOWQE19OkdNz2N9DJ668ORu5e2lyGJOPqXK/f7X+P Xdebpe+28xdM6G7jHQOJZ5WFAiGkCjLOzROU9Jm7HcXyCIBCF+qbWC3lCj/IfMa0EtSQ vQgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@etsukata-com.20150623.gappssmtp.com header.s=20150623 header.b=yAo4Uvsx; 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 v25si7944781pff.274.2019.06.30.02.04.07; Sun, 30 Jun 2019 02:04:25 -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=@etsukata-com.20150623.gappssmtp.com header.s=20150623 header.b=yAo4Uvsx; 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 S1726604AbfF3JEE (ORCPT + 99 others); Sun, 30 Jun 2019 05:04:04 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36099 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbfF3JEE (ORCPT ); Sun, 30 Jun 2019 05:04:04 -0400 Received: by mail-pg1-f196.google.com with SMTP id c13so4554025pgg.3 for ; Sun, 30 Jun 2019 02:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsukata-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rW6hBoo1Zrh9QrQY/e74REo8uL+nhi2gj6+w+fB33Bg=; b=yAo4Uvsxq4AeieBQzZsAcQDV++mSH8dBBYo1ydhltlW9Zf4CnM+JPs7VQeEGafVXJT TFlKZS0WO278SbIYkv/JXgtoe2rH8Ou2Tp4B7YkqtYLJa8vgPbrwL3nToh4GlS6SuesO L7E2x7LXDYcjMIsx+3aupOst+nYVwwSrTw91yA4O49MTVcncMB42W5ZvIVn9ZKzuacwQ xoBmB03xsSFswfzbGHuHXGPLgOKjd3KgaShKsTTnZu7EccA1mqi7D8GlnnzzS5BgoWyB PqtChj2ubfgdANjUZEsKwhMXnDLHwgo2zTdJ1HPu6uD5htbkVLU5h6DZobfzaWsIjKb1 6Kyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=rW6hBoo1Zrh9QrQY/e74REo8uL+nhi2gj6+w+fB33Bg=; b=p3FQxLDi7vWPjRRegvRj+aD+CaGCxpJL+OAJbL5gv8kIXpOzML+IKvV2mwvRw8ZtN2 X/gXKeCzmcgHP9/ngOKkY/wl0HOHTYvQkolmOf0OtrHRY9ebIRccbuB1NB5rw2YQmEIY dsUrKCzI8n4EVVAmPtRv9DIFXo1AssNz4I2yxmauNK/k5L38WfSsmJGHhDZZuHG/yl1w FG8ZZx4THFhZm02vVBNzaQQ+hEOxDDwts8LOGVQcv9BBj+QdgF0XbQhaGSDg76KG970V WK4kXGLA/iYBlfH3AzyM95YzOSSH3ryBBmZXX64aiE1teFdgUFQ2SUiqCnciKItrZ/Ao lBhA== X-Gm-Message-State: APjAAAWDxbTOciPkMgci9Y5YFNvfWft7f2SK0ckEU5q1f+hb9Jeyjq0w W/d3NRSVDxNl5NDKHOY/1YPkMUeBNvE= X-Received: by 2002:a17:90a:be0a:: with SMTP id a10mr22700668pjs.112.1561885443036; Sun, 30 Jun 2019 02:04:03 -0700 (PDT) Received: from Etsukata.local (p2517222-ipngn21701marunouchi.tokyo.ocn.ne.jp. [118.7.246.222]) by smtp.gmail.com with ESMTPSA id bg3sm214692pjb.9.2019.06.30.02.04.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Jun 2019 02:04:02 -0700 (PDT) Subject: Re: [PATCH] tracing: Fix out-of-range read in trace_stack_print() To: Steven Rostedt Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Thomas Gleixner References: <20190610040016.5598-1-devel@etsukata.com> <20190614163136.25115131@gandalf.local.home> From: Eiichi Tsukata Openpgp: preference=signencrypt Autocrypt: addr=devel@etsukata.com; keydata= mQINBFydxe0BEAC2IUPqvxwzh0TS8DvqmjU+pycCq4xToLnCTy9gfmHd/mJWGykQJ7SXXFg2 bTAp8XcITVEDvhMUc0G4l+RBYkArwkaMHO5iM4a7+Gnn6beV1CL/dk9Wu5gkThgL11bhyKmQ Ub1duuVkX3fN2cRW2DrHsTp+Bxd/pq5rrKAbA/LIFmF4Oipapgr69I5wUeYywpzPFuaVkoZc oLdAscwEvPImSOAAJN0sesBW9sBAH34P+xaW2/Mug5aNUm/K6whApeFV/qz2UuOGjzY4fbYw AjK1ALIK8rdeAPxvp2e1dXrj29YrIZ2DkzdR0Y9O8Lfz1Pp5aQ+pwUQzn2vWA3R45IItVtV5 8v04N/F7rc/1OHFpgFtzgAO2M51XiIPdbSmF/WuWPsdEHWgpVW3H/I8amstfH519Xb/AOKYQ 7a14/3EESVuqXyyfCdTVnBNRRY0qXJ7mA0oParMD8XKMOVLj6Nlvs2Zh2LjNJhUDsssKNBg+ sMKiaeSV8dtcbH2XCc2GDKsYbrIKG3cu5nZl8xjlM3WdtdvqWpuHj6KTYBQgsXngBA7TDZWT /ccYyEQpUdtCqPwV0BPho6pr8Ug6J99b1KyZKd/z3iQNHYYh3Iy08wIfUHEXoFiYhMtbfKtW 21B/27EABXMHYnvekhJkVA9E4sfGlDZypU7hWEoiGnAZLCkr2QARAQABtCNFaWljaG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Fatvx4aUntR+1N 2aCDuAIID8CNIhx40fGfdxVa4Rf7vfZ1e7/mK5lDZVnWwTOJFNouvlILKLcDPNO51R5XKsc1 zxZwI+P1sTpSBI/KtFfphfaN93H3dLiy26D1P8ShFz6IEfTgK4OVWhqCaOe9oTXTwwNzBQ4= Message-ID: <398c816d-e80e-9277-569a-2a6b5632e812@etsukata.com> Date: Sun, 30 Jun 2019 18:03:59 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190614163136.25115131@gandalf.local.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/06/15 5:31, Steven Rostedt wrote: ... > >> >> Fixes: 4a9bd3f134dec ("tracing: Have dynamic size event stack traces") > > Actually it fixes: > > 4285f2fcef80 ("tracing: Remove the ULONG_MAX stack trace hackery") > > Because before that, a ULONG_MAX was inserted into the buffer. > > -- Steve Thank you for the advice. Now there is no ULONG_MAX marker, so I should have fixed it by just removing `*p != ULONG_MAX` check, right? Thanks Eiichi > >> Signed-off-by: Eiichi Tsukata >> --- >> kernel/trace/trace_output.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c >> index 54373d93e251..ba751f993c3b 100644 >> --- a/kernel/trace/trace_output.c >> +++ b/kernel/trace/trace_output.c >> @@ -1057,7 +1057,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter, >> >> trace_seq_puts(s, "\n"); >> >> - for (p = field->caller; p && *p != ULONG_MAX && p < end; p++) { >> + for (p = field->caller; p && p < end && *p != ULONG_MAX; p++) { >> >> if (trace_seq_has_overflowed(s)) >> break; >