From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540AbdIVWkS (ORCPT ); Fri, 22 Sep 2017 18:40:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44824 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbdIVWkQ (ORCPT ); Fri, 22 Sep 2017 18:40:16 -0400 Date: Fri, 22 Sep 2017 15:40:14 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, ngo Molnar , Andrew Morton , stable@vger.kernel.org Subject: Re: [PATCH 2/4] extable: Consolidate *kernel_text_address() functions Reply-To: paulmck@linux.vnet.ibm.com References: <20170922221543.900812109@goodmis.org> <20170922221837.600560197@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170922221837.600560197@goodmis.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17092222-0052-0000-0000-00000265ED19 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007780; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000231; SDB=6.00920907; UDB=6.00462784; IPR=6.00701129; BA=6.00005601; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017252; XFM=3.00000015; UTC=2017-09-22 22:40:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092222-0053-0000-0000-000052182EFB Message-Id: <20170922224014.GY3521@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-22_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709220318 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 22, 2017 at 06:15:45PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > The functionality between kernel_text_address() and _kernel_text_address() > is the same except that _kernel_text_address() does a little more (that > function needs a rename, but that can be done another time). Instead of > having duplicate code in both, simply have _kernel_text_address() calls > kernel_text_address() instead. > > This is marked for stable because there's an RCU bug that can happen if > one of these functions gets called while RCU is not watching. That fix > depends on this fix to keep from having to write the fix twice. > > Cc: Paul E. McKenney > Cc: stable@vger.kernel.org > Fixes: 0be964be0 ("module: Sanitize RCU usage and locking") > Signed-off-by: Steven Rostedt (VMware) Not my area, but straightforward transformation and nice reduction in code size. Acked-by: Paul E. McKenney > --- > kernel/extable.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/kernel/extable.c b/kernel/extable.c > index 38c2412401a1..a7024a494faf 100644 > --- a/kernel/extable.c > +++ b/kernel/extable.c > @@ -102,15 +102,7 @@ int core_kernel_data(unsigned long addr) > > int __kernel_text_address(unsigned long addr) > { > - if (core_kernel_text(addr)) > - return 1; > - if (is_module_text_address(addr)) > - return 1; > - if (is_ftrace_trampoline(addr)) > - return 1; > - if (is_kprobe_optinsn_slot(addr) || is_kprobe_insn_slot(addr)) > - return 1; > - if (is_bpf_text_address(addr)) > + if (kernel_text_address(addr)) > return 1; > /* > * There might be init symbols in saved stacktraces. > -- > 2.13.2 > >