Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1451369iob; Thu, 5 May 2022 01:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBXnQXzaFu1zJOKIqWT76jaqekNUl3XkcBSgXF8pyefh3abAzTFIjMytfk3OCLev0ZhBfO X-Received: by 2002:a63:90c3:0:b0:3ab:24df:fa19 with SMTP id a186-20020a6390c3000000b003ab24dffa19mr21097126pge.608.1651738609914; Thu, 05 May 2022 01:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651738609; cv=none; d=google.com; s=arc-20160816; b=EHwQ92WRxlzitkx0VOy53BqZLJlvJ8dJBy11qqvcQbDFhXg4wW46o5A5WyseSt2QnJ eeXaSwhdUHdHUwUZ/jSBfKkon598nI2YVjwZtfO/gTUeGfOWuF5kmu36MBqIehUfyCRt kcqADnnkF8wBnWIbRVx3UMAizyNrQT9icStdxu5Fmg+4z9qaGRmTVTDVfa+SUic4OB68 J1eT5zVOLHOHpvLeA5WbXvFIz2IaIiGGxi8N5KOnFba90yjNhLriBVv/lNpA/852g9Ll LA6hWoufYfSMuvVya28edy4ItawWQWvKemAZqh7mbzZJwOdP9ZertaHC3GHXW0FgboBk Mvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=m1/VxZhDQIDVJV9LQRE+rFB6N3QsuG7coPFVQ3e0ALY=; b=D89ZcVna7tyt+RuEb6+ptZdBWl4y5OxnW3R7YoxkwU337+t8Xvg6cTQ947+DSBLv7e +BYWf+vInH7miA6Z0SByZ3IPk/V2hzRwCyl9mn4qk4zkNZBjnDqnL7rxUHZVdQCoGDVx mopmwbfXXkyCKe/ou0sIjmRAYYwDBWar+f3RfH/RKkYxfAc5xNDwBx6JO8vvWUtmhaiM lei/+ucu4p4c39Y5aAaOBgu4BgTEydxTF27a6c/qmZzM4E445qSFB79Uy3ehkS257mNZ W8bKcRB/rxabRz5Lo23LeIG0+JeW1Y0bkp12sRvECTAzDoAInEQmTweASwgnWqKihPOr fSNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QHQvO5no; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020aa796e8000000b0050dc2c62201si888212pfq.65.2022.05.05.01.16.35; Thu, 05 May 2022 01:16:49 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=QHQvO5no; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355016AbiEDS1s (ORCPT + 99 others); Wed, 4 May 2022 14:27:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353866AbiEDS1i (ORCPT ); Wed, 4 May 2022 14:27:38 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2CA6AFAF1 for ; Wed, 4 May 2022 10:53:54 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-e9027efe6aso1925781fac.10 for ; Wed, 04 May 2022 10:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=m1/VxZhDQIDVJV9LQRE+rFB6N3QsuG7coPFVQ3e0ALY=; b=QHQvO5no9I7c6RBxmfD9Q9o4MEkwRV5xTn4HxEDgMT9zqCaJnhBPQS1APHVrZ6FALh 9fqFHSsqMJBSybivp7kp5ktdSRmARgdGsq/Oq68OmOpVgQuYZNpwtmI6CgoaEZkhRsjK fXNvg/na7Kq7JHX18k+wUC5F4qqusSR2aZ5CX/Q66JT4JDQRFPj4FDYMC9QupOzotFUz uZ0ipmyvb0/WinwODLl8d9LxvtkIqCLIo8qcmamWN2PjgwDP0r+i1Z5EzvZo08Ji1UzP atm+PgMq52G0FUfLq/djw8JO6eS8JYfSp446t01B6BIDwHzX+d/B6P09522aNRcGb7M7 f3FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=m1/VxZhDQIDVJV9LQRE+rFB6N3QsuG7coPFVQ3e0ALY=; b=ltkuuz7+PRi8KFQpvyPFyX5q2JPUVhNgNspMjZro2D2auXWnfNGLNoJPOygKMN+Yyp MneiNQctZXMwqJhcJ9bWtCO+W5zmr1gxvQMOjU74Iex3BgnjK4zb97c7lVfvIiWU35fg +4ugQ+W8EKWmvysKByJH1Q06nfEX1zkBN7snoaAJ3sfgqTZnroz7QL0iJmYBhdehEy72 wERl53bNJl+VM18dFSLlsbIhLwX/OMuTWl8o8mmSAQoMcTMQGVfI+opRq5sE4a6yoj/k CRZuTslBhEv7tuj9IrbLDYZJsB7EiTNQMvwHJM34pZS31mpMlUMTnRJ2FuyD7EDMFToc Nkeg== X-Gm-Message-State: AOAM530SC7nSuE658Srv9CZHpptU3nFTt2WjmmmaduNY1dixKUERc15I s4fRCmw54k2A3oYoVs0vIHEDb2eNNwrXsPQDnOg= X-Received: by 2002:a05:6870:f146:b0:db:c90:99bb with SMTP id l6-20020a056870f14600b000db0c9099bbmr319149oac.55.1651686834074; Wed, 04 May 2022 10:53:54 -0700 (PDT) MIME-Version: 1.0 References: <20220502184050.1792743-1-jcmvbkbc@gmail.com> <165163539094.74407.3838114721073251225.stgit@devnote2> In-Reply-To: <165163539094.74407.3838114721073251225.stgit@devnote2> From: Max Filippov Date: Wed, 4 May 2022 10:53:42 -0700 Message-ID: Subject: Re: [PATCH] kprobes: Fix build errors with CONFIG_KRETPROBES=n To: Masami Hiramatsu Cc: Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" , Peter Zijlstra , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 Tue, May 3, 2022 at 8:36 PM Masami Hiramatsu wrote= : > > Max Filippov reported: > > When building kernel with CONFIG_KRETPROBES=3Dn kernel/kprobes.c > compilation fails with the following messages: > > kernel/kprobes.c: In function =E2=80=98recycle_rp_inst=E2=80=99: > kernel/kprobes.c:1273:32: error: implicit declaration of function > =E2=80=98get_kretprobe=E2=80=99 > > kernel/kprobes.c: In function =E2=80=98kprobe_flush_task=E2=80=99: > kernel/kprobes.c:1299:35: error: =E2=80=98struct task_struct=E2=80=99 h= as no member > named =E2=80=98kretprobe_instances=E2= =80=99 > > This came from the commit d741bf41d7c7 ("kprobes: Remove > kretprobe hash") which introduced get_kretprobe() and > kretprobe_instances member in task_struct when CONFIG_KRETPROBES=3Dy, > but did not make recycle_rp_inst() and kprobe_flush_task() > depending on CONFIG_KRETPORBES. > > Since those functions are only used for kretprobe, move those > functions into #ifdef CONFIG_KRETPROBE area. > > Reported-by: Max Filippov > Fixes: d741bf41d7c7 ("kprobes: Remove kretprobe hash") > Cc: stable@vger.kernel.org > Signed-off-by: Masami Hiramatsu > --- > include/linux/kprobes.h | 2 - > kernel/kprobes.c | 144 +++++++++++++++++++++++------------------= ------ > 2 files changed, 72 insertions(+), 74 deletions(-) Tested-by: Max Filippov --=20 Thanks. -- Max