Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4395098pxb; Mon, 21 Feb 2022 20:10:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqV7YtCuGExfK0xkN0hlFkaoAxJ0fnO5odRNGrGQlalzmRjCde38VVrMAg01owlqK5Agjq X-Received: by 2002:a17:902:d2d1:b0:14f:e2ce:cca6 with SMTP id n17-20020a170902d2d100b0014fe2cecca6mr585188plc.83.1645503025503; Mon, 21 Feb 2022 20:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645503025; cv=none; d=google.com; s=arc-20160816; b=cBA28qIuFt3SVW9SaZOt4/eQNKP7lSIkziROZnkVJSM/5mKbZj8c3xMYxuqrUERgD6 kx9hYURv65NGmztadPtWFkg6t0fARtaM8zLoYLFTPR4QgHSFIobIvgunZWcSqBYjpR96 oyaDMfQVT4PliMbmcW7yqSPBc5rTwyH2l5vgd1kgtTbm/gS8wdM9v1qyWa7tfF3wnmrE orucKy9Xz+VKqJV7ZFZnxSDNGxY/mDQKbqtAbgV7ohXHTWO03JyqjPA0pD8NyNEdSS2L Cn+KB/LDJvdUEHaK4mgwx4AKcw87BIUaARYdayYC+PPn6Son1A5LjkgFJWgKNhQ9gCDO M82A== 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=9zecPfJl8KPqQvHJm44eFqM2SAOw8Uc7bbwrNP8KJrA=; b=qo2CuUgQ26pDTRI0xfolvNxJyyqAILJxbTP/IZz1cip5X4sBk06L34d12047BTNxPq 8zfX9H2uhbA2nBzRTbSDUuAWti6ZNrxwoUYXo/LCUaW2Ciazn2lx3QOZheZ21yGEap0s 7Q5FWFSW4zPjRPfGegQX5XsBZ6Tg/Sf4Nk4TkrPCS6bCSKS7dej07zAEA7D6b4VbFCNz DUDTXl2KxTiZTnz4tbhkkG5VjevNqk/v2zWOvD14wuaxGJ62w9widgp9+K8EtHKAwm87 B7HG/+mwuXXA+i2BfUH+r9yMNA5DoiStueyH76rBxmWrKQNyxRlwXOAyLIFKRnMFdh8d Kj6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Z4ixo2oc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f26si1773203pgb.120.2022.02.21.20.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:10:25 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Z4ixo2oc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4DF11710EF; Mon, 21 Feb 2022 20:10:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377391AbiBUON5 (ORCPT + 99 others); Mon, 21 Feb 2022 09:13:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377387AbiBUONu (ORCPT ); Mon, 21 Feb 2022 09:13:50 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD0F522535; Mon, 21 Feb 2022 06:13:23 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 5EF0D2111A; Mon, 21 Feb 2022 14:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1645452802; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9zecPfJl8KPqQvHJm44eFqM2SAOw8Uc7bbwrNP8KJrA=; b=Z4ixo2ocVgFfq/pJW/luzYkrlt51Tgllgp054eFYOkvRGL24W9IvZJPIxqFJ631pjaPuL0 /wa8nhxwD5mBxKrOxJMY/y21MxPyRCkjSfrYlygZFV66tN5To3v0mBKo1JE3UZQ3iydEtI TUL7WFRJOP0T/FPKpL7DHFQzl4xqirk= Received: from suse.cz (unknown [10.100.224.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0FF55A3C05; Mon, 21 Feb 2022 14:13:22 +0000 (UTC) Date: Mon, 21 Feb 2022 15:13:18 +0100 From: Petr Mladek To: David Vernet Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, jikos@kernel.org, mbenes@suse.cz, joe.lawrence@redhat.com, corbet@lwn.net, kernel-team@fb.com Subject: Re: [PATCH v3] livepatch: Skip livepatch tests if ftrace cannot be configured Message-ID: References: <20220216161100.3243100-1-void@manifault.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220216161100.3243100-1-void@manifault.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 On Wed 2022-02-16 08:11:01, David Vernet wrote: > livepatch has a set of selftests that are used to validate the behavior of > the livepatching subsystem. One of the testcases in the livepatch > testsuite is test-ftrace.sh, which among other things, validates that > livepatching gracefully fails when ftrace is disabled. In the event that > ftrace cannot be disabled using 'sysctl kernel.ftrace_enabled=0', the test > will fail later due to it unexpectedly successfully loading the > test_klp_livepatch module. > > While the livepatch selftests are careful to remove any of the livepatch > test modules between testcases to avoid this situation, ftrace may still > fail to be disabled if another trace is active on the system that was > enabled with FTRACE_OPS_FL_PERMANENT. For example, any active BPF programs > that use trampolines will cause this test to fail due to the trampoline > being implemented with register_ftrace_direct(). The following is an > example of such a trace: > > tcp_drop (1) R I D tramp: ftrace_regs_caller+0x0/0x58 > (call_direct_funcs+0x0/0x30) > direct-->bpf_trampoline_6442550536_0+0x0/0x1000 > > In order to make the test more resilient to system state that is out of its > control, this patch updates set_ftrace_enabled() to detect sysctl failures, > and skip the testrun when appropriate. > > Suggested-by: Petr Mladek > Signed-off-by: David Vernet Reviewed-by: Petr Mladek Tested-by: Petr Mladek I am going to push it after two days or so unless anyone is against. Best Regards, Petr