From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 910F6C433FE for ; Tue, 18 Oct 2022 16:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbiJRQFW (ORCPT ); Tue, 18 Oct 2022 12:05:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiJRQFR (ORCPT ); Tue, 18 Oct 2022 12:05:17 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAD2051A21 for ; Tue, 18 Oct 2022 09:05:14 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7c1329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7c1: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 36ED11EC04DA; Tue, 18 Oct 2022 18:05:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666109109; 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=BZpUJTJl+WAmPhcKXxfbAwcaW4yauzcoyPsuiUOSTKo=; b=Pv7amGoa/8DpJnjglyhcH7W6aLK2seD8G8NNSwENwbDpXOFYDnDKAryytlD4yUG2VJ6lHh xAOPcl4FR4JOxQZ3PZXCP0Sykb5teNqaZ98UmqcQeg8Bmw0UmTPpBps+ioFxpew83GjINV 3K1pFLYBnY/Qtpu8OCtypk9/pIbfioA= Date: Tue, 18 Oct 2022 18:05:04 +0200 From: Borislav Petkov To: Tony Luck Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] RAS: Fix the trace_show() function to output trace_count Message-ID: References: <20221005194644.311204-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2022 at 07:36:53AM -0700, Tony Luck wrote: > Sadly, we need to have a trace_show() function. If trace_open() just > does: > > return single_open(file, NULL, NULL); > > then we get a deref NULL OOPs if somebody does "cat daemon_active" :-( I guess but as you see yourself, cat-ting that file is done only by us when debugging stuff. So we shouldn't waste too much energy on "designing" an interface. As nothing'll use it. But sure, trace_show(), why not. I mean, if people go and open that file and confuse the system, they'll only have themselves to blame. Besides, it is debugfs and root-only and so on - if you wanna do damage, you already have root. So yeah, let's keep this effort minimal and only address valid use cases. IMO. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette