From patchwork Fri Aug 4 07:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 13124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp98729vqb; Fri, 4 Aug 2023 00:59:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2QQFzhftANOxrA9JwwqFVIdsaicLGldIHRTUtMltsrIgQ4jPMLESoBa0ncSrZLOP15d82 X-Received: by 2002:a17:906:20d0:b0:99b:efd3:3ddb with SMTP id c16-20020a17090620d000b0099befd33ddbmr889186ejc.43.1691135951226; Fri, 04 Aug 2023 00:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691135951; cv=none; d=google.com; s=arc-20160816; b=jE7I663p4ynhZzBHDiezpnKxPb/45DTLDmlA1JjerhGxNFV8IyTWOKpcLxp5rr/AM0 1k4a5nljHv4/cTQ9ugHlPyg9S8yIFFuEdirTP0Pyoyq+t9T8PWzEJCa6On9YmNaBxgTe HK77LIW2pc1f/A/lAKu+apZcQrQMdjpp0Wt0stKSIRERwcOd3jUqAfg+i4NoNcX0U6s2 IQjSSAE6GaGkPN3f4NzxFZOD6/fm6u6v1FXcAWRRuLHPnBsKpjs4ZLDViwk4gnxVg5gH By/PiNmsJYCNbguRonl4KGRab9u+iYzJ/IJKPtou1m8DWmGdmmk7c2Q6R2OedrlD60b6 +mHw== 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; bh=BZSM34J8GRqrZN4SguTosXh0ewBeqEnYb5y2LAl+MFI=; fh=YBikRTpR9zYoVYjuRUV1Fnixx8IEvJqVUBSmWl5mLFU=; b=Dhwaao8Uglyc6oMbaC493HQW4hWNLdIjRUttrb8X0eGoS7SNoqgz4vic8NhvQgdFAt sKignxd37PaK0nzDtpGH1lribZDRWl+W30z7FGvkrn7u2g3g/EyW5DJjUTcG/AAIzc1x KbJUQHYX5OGBIceOBD3E18F1m1R/kpDoffxEQ0Gtdb8IFB1NjgSqIBv0l2GORczP75r5 wQfVVxzyDEgbBLswZ/g+bUBAff+2QE19w8npvbx1TUspzozIlF/nLVSJxQ1AMDqGpRE7 H9GO98ZMJ+eI93T/9HTL9k5fAF5gOKzFpcDd8RAzgaM5cgFm2zfMTRZw5Zzm62a++Nkn XJbA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a1709063c1800b0099bd8fb8a96si374389ejg.686.2023.08.04.00.58.46; Fri, 04 Aug 2023 00:59:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234324AbjHDHdt (ORCPT + 99 others); Fri, 4 Aug 2023 03:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234363AbjHDHdc (ORCPT ); Fri, 4 Aug 2023 03:33:32 -0400 Received: from out199-5.us.a.mail.aliyun.com (out199-5.us.a.mail.aliyun.com [47.90.199.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FCCC59F8; Fri, 4 Aug 2023 00:32:32 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0Vp.c2HC_1691134188; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0Vp.c2HC_1691134188) by smtp.aliyun-inc.com; Fri, 04 Aug 2023 15:29:53 +0800 From: Shuai Xue To: alexander.shishkin@linux.intel.com, peterz@infradead.org, james.clark@arm.com, leo.yan@linaro.org Cc: mingo@redhat.com, baolin.wang@linux.alibaba.com, acme@kernel.org, mark.rutland@arm.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, nathan@kernel.org, bpf@vger.kernel.org Subject: [PATCH v4 0/2] perf/core: Bail out early if the request AUX area is out of bound Date: Fri, 4 Aug 2023 15:29:43 +0800 Message-Id: <20230804072945.85731-1-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773284571030849977 X-GMAIL-MSGID: 1773284571030849977 changes since v3 (per James): - change to return with existing value -ENOMEM - split doc part to a separate patch since they are going to be merged through separate trees. changes since v2: - remove unnecessary overflow check (per Peter) changes since v1: - drop out patch2 because it has been fixed on upstream (Thanks James for reminding) - move sanity check into rb_alloc_aux (per Leo) - add overflow check (per James) Shuai Xue (2): perf/core: Bail out early if the request AUX area is out of bound perf record: Update docs regarding the maximum limitation of AUX area kernel/events/ring_buffer.c | 3 +++ tools/perf/Documentation/perf-record.txt | 3 +++ 2 files changed, 6 insertions(+)