Message ID | 20230517034510.15639-1-zegao@tencent.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp866153vqo; Tue, 16 May 2023 21:16:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7QimfuA7bgYhDEVoUjBZcOruUn8RM5KVn41R0KCPPl+wfg8jHWZ+fUw8UaNCQD/nVAgPLl X-Received: by 2002:aa7:888c:0:b0:63b:859f:f094 with SMTP id z12-20020aa7888c000000b0063b859ff094mr52786253pfe.20.1684297004071; Tue, 16 May 2023 21:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684297004; cv=none; d=google.com; s=arc-20160816; b=zD/dH3/6ikuUS74kNGvefDiU+4KZ4MW53NmY9BVxBdFAQBxo34ThXZzWtP7rA/PmpF d3nJXK9ixPVUkaS/Nsz2iHybLQDTTnaKw+DYlQa6u5H7R2eCxP/+r1bB86rkDKYQVwqt S19v84QlUGwkCaiXGz20kCPIOCwLUCvlhFHR2tqM1v0fRsUiVmJc1bALzaRtSNWA1wAd WFg6zp3td34IeXRnFfDUEPqLx6G4Lb+PHKPlANfDKFXGFzraEV9h8J6etsI51wWb1A8v 0/laoX+QZyjA4Hy4rFBJYn8RlpWwgrlztk+f/qp6PcLTddq01L48QTKFAb55SSWJ3kyM kybQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=n0fdPmeINo3M3GEcsjn+DqgIArQ+TF8t88l9Aksr7VQ=; b=YRM302VHaHp39PWAIJpmrdSZ2hJv/dvXv2htZ4QeL8lI7uqzdj2cahlxJ/8sLdZ0Z2 Hnmhj7qeZDV9BE02tgOeERPDtbwXgG+3ia6WePqxXH1TQk6PwKMi6jhsb3He10kZ4jjB eccxI8Jn5DkN2CfNP9pd/0xn/Qzhfvy80fzlHjcWQo0Wy5V7HSsvyDFM4mAa1oQCbdRz T+CHfvxXAC72PGmsnDBPc4ZGWuRZnrLMXJb1dMlzY0OqLDIGUOP8Q+hJhJ4A/v4cdv/M 7foKX3PBH9XGXJ6+9jml6AZEB5o3D3N9CPYXPwZ3YCbxGu6ptzxtGW0+wZwREAebd8hs HisA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Dy5EDllK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a628410000000b0063d2130eadasi21601099pfd.256.2023.05.16.21.16.30; Tue, 16 May 2023 21:16:44 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Dy5EDllK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231898AbjEQDpZ (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Tue, 16 May 2023 23:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbjEQDpV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 16 May 2023 23:45:21 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7750730E8; Tue, 16 May 2023 20:45:20 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-53202149ae2so134187a12.3; Tue, 16 May 2023 20:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684295120; x=1686887120; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=n0fdPmeINo3M3GEcsjn+DqgIArQ+TF8t88l9Aksr7VQ=; b=Dy5EDllK8uVJFjPdvz1RUbi2yk4rgd1PjqZJX+ibJORvvteuhARUVlChiDWi2GdYyj ornOQnlZWAccsQTsX9fLi2XGvQ4x2OgrV6l+T2ZMZvd75JIePFW+SoFmsNoYqlf4tmj6 mu8MFImYX/tmrIswvc9vSL7jdvTVtA3XMoOw2H5DMKVzaHKqWcXvCHVJhmLlIYe3M0zg DYvxBvbgYH6iW3+axk10pT1phM6PW493USZleI0YoHLDNsChz3x3uojs4ai7zGPrwo1S IyPBHmYqqM0fciz6V34Z9NRne8SpZebj4C4tOarrPY2uQ/ucSWcFEYkSxS9uD+fy6URe cVdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684295120; x=1686887120; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n0fdPmeINo3M3GEcsjn+DqgIArQ+TF8t88l9Aksr7VQ=; b=l0ksyFCRoVbMcBPmlWi6PK9EeCg7RZBTX08SVqJn2wRD7oqD0FqHMRv+13bREZ6NJO 8KI7e2gbgWLm02wYBaMd389o/UcMDzSci6yEdk0M9BFnWNMEydtVdWWoR3EgFo92bZNC /gtZtydupaC0Vk/2oLLAd/yWgv0l19zC+4xWwR0DWQcDmknLPzNU/B3UMTAh1xgalzYa ri9b7rjawpMozv/CEIa/mewKQ2fC4CtwyroQ1bSMu0p2fbe+wTpsPLY3PAi0pAuGWCea BIHEQqdZ+LbabjQFDhsEm4dmkrCE6N5eA3MjEYp/dvPWNi4nPOPyVLTCcH/WV4XmAA70 EEFg== X-Gm-Message-State: AC+VfDxvMh/x76YgZmG+c7gIxnNWJP8uuR6L2adgGKyMMz7p99FkhQrw vLExXrQc46eykkQMW9Rg6z8= X-Received: by 2002:a17:903:110f:b0:1a2:8c7e:f310 with SMTP id n15-20020a170903110f00b001a28c7ef310mr48043595plh.35.1684295119892; Tue, 16 May 2023 20:45:19 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.83]) by smtp.googlemail.com with ESMTPSA id t2-20020a170902e84200b001a19196af48sm16336746plg.64.2023.05.16.20.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 20:45:19 -0700 (PDT) From: Ze Gao <zegao2021@gmail.com> X-Google-Original-From: Ze Gao <zegao@tencent.com> To: Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu <mhiramat@kernel.org> Cc: Albert Ou <aou@eecs.berkeley.edu>, Alexander Gordeev <agordeev@linux.ibm.com>, Alexei Starovoitov <ast@kernel.org>, Borislav Petkov <bp@alien8.de>, Christian Borntraeger <borntraeger@linux.ibm.com>, Dave Hansen <dave.hansen@linux.intel.com>, Heiko Carstens <hca@linux.ibm.com>, "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Sven Schnelle <svens@linux.ibm.com>, Thomas Gleixner <tglx@linutronix.de>, Vasily Gorbik <gor@linux.ibm.com>, x86@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Conor Dooley <conor@kernel.org>, Jiri Olsa <jolsa@kernel.org>, Yonghong Song <yhs@fb.com>, Ze Gao <zegao@tencent.com> Subject: [PATCH v3 0/3] Make fprobe + rethook immune to recursion Date: Wed, 17 May 2023 11:45:05 +0800 Message-Id: <20230517034510.15639-1-zegao@tencent.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766113415495697195?= X-GMAIL-MSGID: =?utf-8?q?1766113415495697195?= |
Series |
Make fprobe + rethook immune to recursion
|
|
Message
Ze Gao
May 17, 2023, 3:45 a.m. UTC
Hi all, This is the 3rd version of patch series that fix the ftrace rethook recursion problem. Changes since v2: - refine commit message of [PATCH v2 2/4] fprobe: make fprobe_kprobe_handler recursion free v1: https://lore.kernel.org/linux-trace-kernel/cover.1684120990.git.zegao@tencent.com/T/ v2: https://lore.kernel.org/linux-trace-kernel/ZGP4ypidaxQGdp7Y@krava/T/#mb9e74fe74d5800ee424234b26c6def9d5135237b The original discussions of this bug can be checked out here: https://lore.kernel.org/bpf/CAD8CoPCfPmqZH6BJCk3Y1-02BLVVsbQ6OeaNOhcfGWmdF0oX8A@mail.gmail.com/T/#t Ze Gao (4): rethook: use preempt_{disable, enable}_notrace in rethook_trampoline_handler fprobe: make fprobe_kprobe_handler recursion free fprobe: add recursion detection in fprobe_exit_handler rethook, fprobe: do not trace rethook related functions arch/riscv/kernel/probes/Makefile | 2 + arch/s390/kernel/Makefile | 1 + arch/x86/kernel/Makefile | 1 + kernel/trace/fprobe.c | 73 ++++++++++++++++++++++++------- kernel/trace/rethook.c | 4 +- 5 files changed, 64 insertions(+), 17 deletions(-)