From patchwork Wed Jul 12 21:50:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1448165vqm; Wed, 12 Jul 2023 15:17:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqpWyM40HmFWO/huuGJ39qdnFmzvZPf2T1OB7AHw8mCmV21Ro0zEQgDetoUYrxnAww5sel X-Received: by 2002:a17:906:51cd:b0:993:d6e8:2381 with SMTP id v13-20020a17090651cd00b00993d6e82381mr17385576ejk.23.1689200232934; Wed, 12 Jul 2023 15:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689200232; cv=none; d=google.com; s=arc-20160816; b=DD7XEut8fj2QHOvlhp3UGing7QGGM0nWfJSapA7WWYsUOuS7qdYjbxjwdvWj7qGHU0 D/Qo+1ZWrhi+tbAcpWQ8mRZ0JSKEz8C51lgEr9y1NHqDqITCvtaCdMs/9PT78/aCNJe8 CMI9yunidc+uID7SSj43b4iUimsxUVkDv2Rc8n/+vAWN7REuQFoIEzGxzTIf5ntog9lW AKUCsp9whOgfXJnKuFqlV+ZfU1+yrRm65WQgwQUDyR2VJTq4xfXkkY/4XMdTP10kCWN9 2zvo9ScGmum7v7ouU/zaR9IcgL8ubEpbEX1yYHv6jk05eOflniV0WtZoSb6698Umyqwe RPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:user-agent:message-id; bh=np/w+cdqn5P8HzkiuN8Z6UOeVU785d4BpDQO5cU528E=; fh=kgng34H5que7URbu24ZWqKKtWQj+H7d5uaZL8F1DzaU=; b=pHuBXSx6SbStlfwnRi1Am/NerndU/zZB0ZWYP4sXeD8T+z57QH7Bgn7GdO5luIqbXG Bl+dUemg8U8Oo0PJZrc4twhfKdyRKneXFGCxbfC51UPXdiaUR2RAPJ7ymdGxPRqQ/dvD Oiw0lttXPRbMltNxvUV1o5yiD5qvpmYvMrNmuF4g6sSJphGdcqrEyoE33J8+7CUcuApn ZhIYcslwUYXomEWCj5WwI/rBNm7S1x+16NPhxZDwBxws0H4Wyi54WdTEm9veRw9owVRm wNBqz9g2o4XbgLxrYPRokaFnwj0Qijk1Hms4ge9tuddBJ3V+PSO4a0KgAQLXNsLcjqvp +iOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gg23-20020a170906e29700b0099334262e18si5897392ejb.49.2023.07.12.15.16.48; Wed, 12 Jul 2023 15:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbjGLWBB (ORCPT + 99 others); Wed, 12 Jul 2023 18:01:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjGLWBA (ORCPT ); Wed, 12 Jul 2023 18:01:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADCE1FD8 for ; Wed, 12 Jul 2023 15:00:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7050F61926 for ; Wed, 12 Jul 2023 22:00:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6FD3C433C8; Wed, 12 Jul 2023 22:00:58 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qJhtI-000Qhi-2n; Wed, 12 Jul 2023 18:00:56 -0400 Message-ID: <20230712215044.496021196@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 12 Jul 2023 17:50:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton Subject: [for-linus][PATCH 0/5] tracing: Some more fixes for 6.5 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771254823137213532 X-GMAIL-MSGID: 1771254823137213532 Tracing fixes for 6.5: - Update to fix of prototypes (my merge of Arnd's patch caused another warning). - Add selftest to struct sizes for user events - Quiet false positive of FORTIFY_SOURCE Due to backward compatibilty, the structure used to save stack traces in the kernel had a fixed size of 8. This structure is exported to user space via the tracing format file. A change was made to allow more than 8 functions to be recorded, and user space now uses the size field to know how many functions are actually in the stack. But the structure still has size of 8 (even though it points into the ring buffer that has the required amount allocated to hold a full stack. This was fine until the fortifier noticed that the memcpy(&entry->caller, stack, size) was greater than the 8 functions and would complain at runtime about it. Hide this by using a pointer to the stack location on the ring buffer instead of using the address of the entry structure caller field. - Fix a deadloop in reading trace_pipe that was caused by a mismatch between ring_buffer_empty() returning false which then asked to read the data, but the read code uses rb_num_of_entries() that returned zero, and causing a infinite "retry". - Fix a warning caused by not using all pages allocated to store ftrace functions, where this can happen if the linker inserts a bunch of "NULL" entries, causing the accounting of how many pages needed to be off. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace/urgent Head SHA1: bec3c25c247c4f88a33d79675a09e1644c9a3114 Arnd Bergmann (1): tracing: arm64: Avoid missing-prototype warnings Beau Belgrave (1): selftests/user_events: Test struct size match cases Steven Rostedt (Google) (1): tracing: Stop FORTIFY_SOURCE complaining about stack trace caller Zheng Yejian (2): ring-buffer: Fix deadloop issue on reading trace_pipe ftrace: Fix possible warning on checking all pages used in ftrace_process_locs() ---- arch/arm64/include/asm/ftrace.h | 4 +++ arch/arm64/include/asm/syscall.h | 3 ++ arch/arm64/kernel/syscall.c | 3 -- include/linux/ftrace.h | 9 ++++++ kernel/trace/fgraph.c | 1 + kernel/trace/ftrace.c | 45 ++++++++++++++++++-------- kernel/trace/ftrace_internal.h | 5 +-- kernel/trace/ring_buffer.c | 24 ++++++++------ kernel/trace/trace.c | 21 ++++++++++-- kernel/trace/trace_kprobe_selftest.c | 3 ++ tools/testing/selftests/user_events/dyn_test.c | 12 +++++++ 11 files changed, 100 insertions(+), 30 deletions(-)