Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1937331rwb; Thu, 17 Nov 2022 04:26:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BHpgJunovJGXYrcumb+y5QAxLV4b2hjYFuJRXhf5SkJhnvN+oU2bAbUZu7zDBgXoTvnXh X-Received: by 2002:a05:6a00:27a3:b0:56d:6450:9e49 with SMTP id bd35-20020a056a0027a300b0056d64509e49mr2700011pfb.54.1668688012692; Thu, 17 Nov 2022 04:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668688012; cv=none; d=google.com; s=arc-20160816; b=k19vzbt7XgjfvhmZtj1iO1rDjqVNbbRcDuSdPv/XrHyvyR7n4gFG787D8HCAzQI+4O xej3TgFqkHBYuX7AnLirBXcVF6d3j02+Ofk2CmcScmzhnbjEhSJTGn66CDk5I83/lkj4 g8w/Q5jLrE7ty2XXs5daATMF/UKKOVH2Rvo7NFD/k62Wym4EFM//A5NWOw+DE91DoQq1 GFSCv7+CNh+Bt7iKO3D1IhLoVsOPZLuTGLcEbnsSyscweHQ3UwmRCEU+FeZwOhY4DKwk Enu9DFK9R1WvPHt584/mnJuKFDIhAYAFvDPbSxEG+etrokfdmMTTJpqylCzjr9CuHMGL 0EwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=awpbR7h4Pv1zHzHxS1pLlggYxafgPpDeFKa5pXmhjIQ=; b=SoU69K8pao5BPuUrNfVAvltNlSta1pR1vSbK2LB//BwQy0L+E5hRuUiyRx4puXBzjN +Szl4z3GhxRNKD/G6yLXC9NrEXhh+szDwl1g+wa/yhwMKdaMWOnXRn4f4VjMTBbzPEaV /sqZDnEUeXcfBpoNHSh2iEsCBjfsxeWX5g0VLRPdK7xwlYzfM9TD/FupFgFcZW3vKG+V KIN7hNO8zEYM5tko5VFLzYFldF1C2IA2L6jRIRO+lY7rUF6mTQ4cCBDZrqtfGyLexer7 S8AFLugL7nvZX2AOWxNJzkKvQ4YEsJR6mrqpeQPTnHUphbCmIszH0yutkFkiDORaPfRT Gtcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=dIs1gnsg; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q68-20020a17090a1b4a00b0021320088071si634632pjq.175.2022.11.17.04.26.41; Thu, 17 Nov 2022 04:26:52 -0800 (PST) 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=@alien8.de header.s=dkim header.b=dIs1gnsg; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239291AbiKQL73 (ORCPT + 92 others); Thu, 17 Nov 2022 06:59:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234837AbiKQL7P (ORCPT ); Thu, 17 Nov 2022 06:59:15 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D75113CC6 for ; Thu, 17 Nov 2022 03:59:12 -0800 (PST) Received: from zn.tnic (p200300ea9733e7de329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7de:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 494581EC064F; Thu, 17 Nov 2022 12:59:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1668686351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=awpbR7h4Pv1zHzHxS1pLlggYxafgPpDeFKa5pXmhjIQ=; b=dIs1gnsg/QpNHes9IXpkSqmws3L8073+Fi9QhZA1k2XgtmE99T/BWqv3VUNmjMDR2cNIf9 6L5keCCoBbggQvewax7laWieHeWgajtnwvnjj4OVh+bIoUUIbw+kaZbOHsSpZtWk5DWZBf 51HXCtQbiVbjXQieZP/xvMUmtNuvbTQ= Date: Thu, 17 Nov 2022 12:59:06 +0100 From: Borislav Petkov To: Ravi Bangoria Cc: Peter Zijlstra , nslusarek@gmx.net, Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: Fix sys_perf_event_open() race against self Message-ID: References: <20220520183806.GV2578@worktop.programming.kicks-ass.net> <700710fc-1ac1-1b39-0e63-eb86adb4b984@amd.com> <7bf54a3f-07f7-5471-f6c2-88d3d9bc7a5e@amd.com> <68df3063-3fa2-9332-1705-631716589450@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <68df3063-3fa2-9332-1705-631716589450@amd.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 On Thu, Nov 17, 2022 at 04:29:31PM +0530, Ravi Bangoria wrote: > I do agree that more tests are always better. Though, this simple program > was to test a _specific race condition_ which no longer exists in kernel. > So even if we add it, what would it test? It would make sure that race doesn't happen again. Or are you saying it will never ever happen so no need? Because we never ever rewrite the kernel? Lemme save us some time: this test is dirt cheap. It is good to have so that multithreaded sys_perf_event_open() is exercised. And once it is there, someone else might have a look at it and improve it more or reuse it for another test. And there are no downsides. If you're still not convinced, lemme know and I'll turn it into a proper patch and submit it. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette