Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp198165pxm; Tue, 22 Feb 2022 08:51:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVS7tmhk349+Kg0M77tAm4F32yggXVTyxKXh+ixCpOemHcWA7Yw7wp0wCuddoQnTB3bG1b X-Received: by 2002:a17:907:3f95:b0:6d3:feb2:ef88 with SMTP id hr21-20020a1709073f9500b006d3feb2ef88mr1683707ejc.480.1645548694932; Tue, 22 Feb 2022 08:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645548694; cv=none; d=google.com; s=arc-20160816; b=WnlJhE6WKE10Usmx78L4LydX8JOFmc0Z5WrBpp+l3xWnjOUkz0cTHDqIWCpZEbcTon +texMn1r8bWJ3/IPImr65KG0iaAuOVJUk29XDfSMoJ8IVR2YdEXatm5/IVSkjpM2u+rt bqoPeKLFcb+U5pNw5pBVt+PVCNU0sV51uPJekuE9h0cVS3i+aWluhnLG4lFewxOEXI/P s3rw01lXgHki555HWOOEh0iEIxMBM+gczZIY5llds2sfccG2jGpzvG6hJbYPadtBKq6q s9axzUsklAnDZWjKWtHCnju+euPgDxKDCTn/Wpl8YbLgKg0xXm072w6FKgLdKJdKWUDI 7LQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=gzDriewqgRZ9io4uPq8+Th48FK+kOj3Iy64ttany+bU=; b=As3NloqWrCWlXrUiGbaGqeBHiMF30IiKd5z6O2CtFkhoPSj6fyoATKuETiUrgXn8PS wXeQS1sraosWOsS355/aVGZtENls4SoyxyekRB8/E66D6Zz6Wn6SrL8sb+pUcOx448Sa /TbXG4VUpCeShK9xzR4gmW9Yy37g2zR6jt2IIc4dLU99JgVKeZEIIW0Rq9KVXRIS2f0X sE60S8dGjXBOgRzbvKX9TKnYuC40yGXeWMmEjGLt9ANnnmLvVXXSFkMJyXEhQRRx720x WXiTIB7WWN4rh9dfianU0zyHUxJfhzdBpyPeJNBni0O713NmrEf4iZD8p3hikzBrJPjm 4bKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aXqe+FfJ; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji20si12893885ejc.147.2022.02.22.08.51.04; Tue, 22 Feb 2022 08:51:34 -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=@redhat.com header.s=mimecast20190719 header.b=aXqe+FfJ; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233250AbiBVPfe (ORCPT + 99 others); Tue, 22 Feb 2022 10:35:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233391AbiBVPfb (ORCPT ); Tue, 22 Feb 2022 10:35:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E6D216306C for ; Tue, 22 Feb 2022 07:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645544102; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gzDriewqgRZ9io4uPq8+Th48FK+kOj3Iy64ttany+bU=; b=aXqe+FfJrZ6+pOUG/CLkiWL1/xkEymV3PmKybJMTIm2URTiKOwR4X3+O7/S8f5x7aqq6OQ 8KBHWTyads1g0WiOY0TB8xBrajdoY0fZWepSqqqK1XDDZH3cvPLmBGAmG0WwHXgLaNjq8r 4UV6FsbCIGoVeSY5juhZbOwSYVmMS+o= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-379-sM93uXe1MOqEysCM7XJrZg-1; Tue, 22 Feb 2022 10:35:01 -0500 X-MC-Unique: sM93uXe1MOqEysCM7XJrZg-1 Received: by mail-qv1-f69.google.com with SMTP id kc30-20020a056214411e00b0042cb92fe8bbso21465803qvb.8 for ; Tue, 22 Feb 2022 07:35:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gzDriewqgRZ9io4uPq8+Th48FK+kOj3Iy64ttany+bU=; b=FCWQUQQtUy0moxOIzuv2WvoG1Ll8LjAjGo7cIwN76XmVpljJPz9laETlmxnMFrb7IG 40UKodUvmI5jo+XPVA4f+9i6T7LiTTFcJnMYPcFaOTF5qTIEubdt2d9edPNNNu71+4fQ weAiQSaJVWyqNgesX43XOYyrKmlcS2yt6KZENcxxeLVo8UjK49Fae/ROTgGNSlKb6RdG EqEVQkCrlhCO3oZy5xfU/ED7F2Hmy6Dk/gEsusf06w2u96f2jPds9LQ8omHjW1CLDWd9 PuyhR13c670jcu4kJ1XMw6gqZ1rNYMakgNG2jfWC+H4kbfIT612FBD59WxZOxQG5LgXc sG4g== X-Gm-Message-State: AOAM530nyEqFAXDSBMoEfJ/7zMEn9F+LF1EQvMuKs6AapnJXsvfrkzL1 9tpMG0530bvxKkp8y2sFwB4NW7gZrL8Znh2XakIJCcfAdj8Z5TRgbtfWR4Pv/fT0myNpTeT/xeK +amc0ZX2ucwOBpJrRdXcUJrjX X-Received: by 2002:a37:9744:0:b0:508:48cd:5f91 with SMTP id z65-20020a379744000000b0050848cd5f91mr15481955qkd.127.1645544100560; Tue, 22 Feb 2022 07:35:00 -0800 (PST) X-Received: by 2002:a37:9744:0:b0:508:48cd:5f91 with SMTP id z65-20020a379744000000b0050848cd5f91mr15481856qkd.127.1645544099190; Tue, 22 Feb 2022 07:34:59 -0800 (PST) Received: from [192.168.1.9] (pool-68-163-101-245.bstnma.fios.verizon.net. [68.163.101.245]) by smtp.gmail.com with ESMTPSA id e16sm33080419qty.47.2022.02.22.07.34.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Feb 2022 07:34:58 -0800 (PST) Subject: Re: [PATCH v3] livepatch: Skip livepatch tests if ftrace cannot be configured To: Petr Mladek , David Vernet Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, jikos@kernel.org, mbenes@suse.cz, corbet@lwn.net, kernel-team@fb.com References: <20220216161100.3243100-1-void@manifault.com> From: Joe Lawrence Message-ID: <42dfc6bf-cc18-138b-9e9d-cf460e5277da@redhat.com> Date: Tue, 22 Feb 2022 10:34:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 2/21/22 9:13 AM, Petr Mladek wrote: > 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. > Sorry for late replies as I'm just back from PTO, but v3 looks good to me. Thanks Petr and David. Acked-by: Joe Lawrence -- Joe