Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1241235pxa; Thu, 20 Aug 2020 06:32:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF2q+7pv7AXxYMI5pmtj/+6PyjsNz4+VPQd5VgWBI0cj8/yIGAL1Pou+puaMBeRbfTTTA9 X-Received: by 2002:a05:6402:68b:: with SMTP id f11mr2960925edy.353.1597930346051; Thu, 20 Aug 2020 06:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930346; cv=none; d=google.com; s=arc-20160816; b=b6+nQ1iuo24i4jOMQxZaNzo7oXcwTekV7j4xOPyZ92VCkow8jXoZC9wZ1WJOxepDYD bngFVK8t6K9BfGmfhjSRK5ySEI7NN/s7Jgzrjl764b97xuo5EBSBvWUJMQTGgWhN8a/q HsjKF7qp6sd2M2LIDdkumKXWUsZsfOKByr/VuEaK+82PktoTvdZE2Y/Bj7pYBLFVCGKq PmVaYmuWws7nByO96Kp9GUTRJ2iPDdJ2b7knbvrJ0LXZ+Ry3O5BbSwLU8yFPJnhCNwmS W2Miz543mhpPfntSsK2E9t4DPGnal2Rp8ybAvspzkla+tyB2eX6pQBqaUqT6yAR9C75p gAjQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KklT3Ma9UPjUUnCL08wEtLGXnlTokpbTNCIrJY/mymI=; b=iiklsEhizzTl03tmoAnP9Ha7jdqJhXQUcu0YTs3outadx8R1seAJkiImpU8i1kbvYy SnACkrAGZHcqFVTN8wve84ixTATis/DmtCLxL2LoFNOFRaJkAeNw14+b5AmmfC0pRR34 8z0yeA7yHq74o3ez1UgP/LAShq5MA4VUXE4rUnzkiIocSmsJ4491tuV/+NWg2/vxCo47 l+PuratUiFc6ciJn1jpN/kZ6/V23/mVLy0vNXEdgAvausL58E9BAFEIwaX+eKEceReXe eZe+5EPA5p4IRe0U4dweMqsJVV3tZj8649X1Pyp5RNMSEsT/yZA5LD7GxQ1DMx1VDXOJ gYRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J+P2oz4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id va1si1247704ejb.558.2020.08.20.06.32.01; Thu, 20 Aug 2020 06:32:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J+P2oz4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728980AbgHTNbY (ORCPT + 99 others); Thu, 20 Aug 2020 09:31:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:45136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728344AbgHTJcn (ORCPT ); Thu, 20 Aug 2020 05:32:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C32C207DE; Thu, 20 Aug 2020 09:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915962; bh=qFl7Iy+52Gchs3UMwFRTr9Ko4Q5HlQTP0GJLrl82L6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J+P2oz4iSFwYoExS6xvJQEJ6M+Q7VMJvEMNtcDhNVRCfk/V3gXTBF3e/O/gUlTKX2 aidyQQN/mNHxEta2LxoeZ/co7U2iwXTzl+ighlkxTlJjGPWxoaw7RNJR7j1ZZ4EHeq Dq53YRLiHsemRMaJsjfx2aVYVkGSZotL1e+snkp0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Masami Hiramatsu , John Fastabend , Muchun Song , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.8 188/232] kprobes: Fix compiler warning for !CONFIG_KPROBES_ON_FTRACE Date: Thu, 20 Aug 2020 11:20:39 +0200 Message-Id: <20200820091621.901039914@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Muchun Song [ Upstream commit 10de795a5addd1962406796a6e13ba6cc0fc6bee ] Fix compiler warning(as show below) for !CONFIG_KPROBES_ON_FTRACE. kernel/kprobes.c: In function 'kill_kprobe': kernel/kprobes.c:1116:33: warning: statement with no effect [-Wunused-value] 1116 | #define disarm_kprobe_ftrace(p) (-ENODEV) | ^ kernel/kprobes.c:2154:3: note: in expansion of macro 'disarm_kprobe_ftrace' 2154 | disarm_kprobe_ftrace(p); Link: https://lore.kernel.org/r/20200805142136.0331f7ea@canb.auug.org.au Link: https://lkml.kernel.org/r/20200805172046.19066-1-songmuchun@bytedance.com Reported-by: Stephen Rothwell Fixes: 0cb2f1372baa ("kprobes: Fix NULL pointer dereference at kprobe_ftrace_handler") Acked-by: Masami Hiramatsu Acked-by: John Fastabend Signed-off-by: Muchun Song Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- kernel/kprobes.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index f54d4a29fc26e..72af5d37e9ff1 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1079,9 +1079,20 @@ static int disarm_kprobe_ftrace(struct kprobe *p) ipmodify ? &kprobe_ipmodify_enabled : &kprobe_ftrace_enabled); } #else /* !CONFIG_KPROBES_ON_FTRACE */ -#define prepare_kprobe(p) arch_prepare_kprobe(p) -#define arm_kprobe_ftrace(p) (-ENODEV) -#define disarm_kprobe_ftrace(p) (-ENODEV) +static inline int prepare_kprobe(struct kprobe *p) +{ + return arch_prepare_kprobe(p); +} + +static inline int arm_kprobe_ftrace(struct kprobe *p) +{ + return -ENODEV; +} + +static inline int disarm_kprobe_ftrace(struct kprobe *p) +{ + return -ENODEV; +} #endif /* Arm a kprobe with text_mutex */ -- 2.25.1