Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4000715ybp; Mon, 7 Oct 2019 01:19:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhxaMvgY9UJ2GcguhihJ313fUKFDXG7zrzAhu1tJieKYzvPpXG7ojZSjUwF/5GEdT/gX+F X-Received: by 2002:a17:906:3443:: with SMTP id d3mr22673645ejb.156.1570436368436; Mon, 07 Oct 2019 01:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570436368; cv=none; d=google.com; s=arc-20160816; b=z2qhn1Jlysanj3IsAGvMbgNLvGfElpoQESDogz8LUntCYMTZNrHO0Ew/kFS9m5yTph bgRX2KLhFMsCSxGN+NMoNiwlekfEmKFimYPN60egrJJeop5nbHqz3xLrreeCQKeVksaJ VnkrKDOFcLVgJRfXJ7hAdGleQivnk26HwgGWA27a6gQ/n0SWpHo8wWRsgCHtdi5v/7aK WrXEvZvlgrgD/Mibijg+NWBd4Iir1LWNzdJh5MkgaGjrMEeDqIsObwRMPkW+5nDVRasV 06bhRh9AvFr4Br4OYeBdeSd6N8NXDm5FYmdkOXArPI+zlnQk9EBAmKmL5V0pOs7tUbYO qY4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xCBqTDOm/u6ygABnkq7/veDPB4ndcHU8DVEbV8Kdlbw=; b=b37mpE0Ov6SjooqfctrN9BfgIlJgH+ZmQvNNImOrfn9qtA2Zs8hzq5CgtmRazh0VHI 7dhTdIhZSn6Z4IS5faQJatKlBKGjY95JZjjkOfy22jgtCi1etHxnj2t7D4QmVl6M48PF e3HAlOrRj2ImoSn1WPs3yPA1LKo5u51hdixxqGeRddTL6ICLDU9LPZz2755gp3llLWZn 25oGqNKRPVyDuz6En0xyFk1NJAw4o9Q0n1J9N+Ma3yTjne4keAyQRU2knfydumN7KDsO 2w1KqS1zJj1kCIm0XuDlvN1Ix6CcSE7Aml0qNRtDLx4y4suWQk7bRarYM/wWpiYfcww5 dt+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n23si1392692ejr.376.2019.10.07.01.19.05; Mon, 07 Oct 2019 01:19:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbfJGIRV (ORCPT + 99 others); Mon, 7 Oct 2019 04:17:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:56290 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727448AbfJGIRU (ORCPT ); Mon, 7 Oct 2019 04:17:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 82668AE8D; Mon, 7 Oct 2019 08:17:18 +0000 (UTC) From: Miroslav Benes To: rostedt@goodmis.org, mingo@redhat.com, jpoimboe@redhat.com, jikos@kernel.org, pmladek@suse.com, joe.lawrence@redhat.com Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Miroslav Benes Subject: [PATCH 3/3] livepatch: Use FTRACE_OPS_FL_PERMANENT Date: Mon, 7 Oct 2019 10:17:14 +0200 Message-Id: <20191007081714.20259-4-mbenes@suse.cz> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191007081714.20259-1-mbenes@suse.cz> References: <20191007081714.20259-1-mbenes@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use FTRACE_OPS_FL_PERMANENT flag to be immune to toggling the 'ftrace_enabled' sysctl knob. Signed-off-by: Miroslav Benes --- kernel/livepatch/patch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c index bd43537702bd..b552cf2d85f8 100644 --- a/kernel/livepatch/patch.c +++ b/kernel/livepatch/patch.c @@ -196,7 +196,8 @@ static int klp_patch_func(struct klp_func *func) ops->fops.func = klp_ftrace_handler; ops->fops.flags = FTRACE_OPS_FL_SAVE_REGS | FTRACE_OPS_FL_DYNAMIC | - FTRACE_OPS_FL_IPMODIFY; + FTRACE_OPS_FL_IPMODIFY | + FTRACE_OPS_FL_PERMANENT; list_add(&ops->node, &klp_ops); -- 2.23.0