lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210729000531.7c4da1f1@oasis.local.home>
Date:   Thu, 29 Jul 2021 00:05:31 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Kefeng Wang <wangkefeng.wang@...wei.com>
Cc:     <arnd@...db.de>, <linux-arch@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linuxppc-dev@...ts.ozlabs.org>,
        <mingo@...hat.com>, <davem@...emloft.net>, <ast@...nel.org>,
        <ryabinin.a.a@...il.com>, <mpe@...erman.id.au>,
        <benh@...nel.crashing.org>, <paulus@...ba.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Nathan Chancellor <nathan@...nel.org>, <bpf@...r.kernel.org>
Subject: Re: [PATCH v2 5/7] kallsyms: Rename is_kernel() and
 is_kernel_text()

On Thu, 29 Jul 2021 10:00:51 +0800
Kefeng Wang <wangkefeng.wang@...wei.com> wrote:

> On 2021/7/28 23:28, Steven Rostedt wrote:
> > On Wed, 28 Jul 2021 16:13:18 +0800
> > Kefeng Wang <wangkefeng.wang@...wei.com> wrote:
> >  
> >> The is_kernel[_text]() function check the address whether or not
> >> in kernel[_text] ranges, also they will check the address whether
> >> or not in gate area, so use better name.  
> > Do you know what a gate area is?
> >
> > Because I believe gate area is kernel text, so the rename just makes it
> > redundant and more confusing.  
> 
> Yes, the gate area(eg, vectors part on ARM32, similar on x86/ia64) is 
> kernel text.
> 
> I want to keep the 'basic' section boundaries check, which only check 
> the start/end
> 
> of sections, all in section.h,  could we use 'generic' or 'basic' or 
> 'core' in the naming?
> 
>   * is_kernel_generic_data()	--- come from core_kernel_data() in kernel.h
>   * is_kernel_generic_text()
> 
> The old helper could remain unchanged, any suggestion, thanks.

Because it looks like the check of just being in the range of "_stext"
to "_end" is just an internal helper, why not do what we do all over
the kernel, and just prefix the function with a couple of underscores,
that denote that it's internal?

  __is_kernel_text()

Then you have:

 static inline int is_kernel_text(unsigned long addr)
 {
	if (__is_kernel_text(addr))
 		return 1;
 	return in_gate_area_no_mm(addr);
 }

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ