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] [day] [month] [year] [list]
Date:   Fri, 28 Feb 2020 16:02:16 +0200
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Leo Yan <leo.yan@...aro.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 03/13] kprobes: Add symbols for kprobe insn pages

On 26/02/20 5:21 pm, Jiri Olsa wrote:
> On Wed, Feb 12, 2020 at 02:49:39PM +0200, Adrian Hunter wrote:
>> Symbols are needed for tools to describe instruction addresses. Pages
>> allocated for kprobe's purposes need symbols to be created for them.
>> Add such symbols to be visible via /proc/kallsyms.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> 
> SNIP
> 
>> @@ -272,6 +273,8 @@ static inline bool is_kprobe_##__name##_slot(unsigned long addr)	\
>>  {									\
>>  	return __is_insn_slot_addr(&kprobe_##__name##_slots, addr);	\
>>  }
>> +#define KPROBE_INSN_PAGE_SYM		"kprobe_insn_page"
>> +#define KPROBE_OPTINSN_PAGE_SYM		"kprobe_optinsn_page"
>>  #else /* __ARCH_WANT_KPROBES_INSN_SLOT */
>>  #define DEFINE_INSN_CACHE_OPS(__name)					\
>>  static inline bool is_kprobe_##__name##_slot(unsigned long addr)	\
>> @@ -373,6 +376,13 @@ void dump_kprobe(struct kprobe *kp);
>>  void *alloc_insn_page(void);
>>  void free_insn_page(void *page);
>>  
>> +int kprobe_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
>> +		       char *sym);
>> +int kprobe_cache_get_kallsym(struct kprobe_insn_cache *c, unsigned int *symnum,
>> +			     unsigned long *value, char *type, char *sym);
>> +
>> +int arch_kprobe_get_kallsym(unsigned int *symnum, unsigned long *value,
>> +			    char *type, char *sym);
>>  #else /* !CONFIG_KPROBES: */
>>  
>>  static inline int kprobes_built_in(void)
>> @@ -435,6 +445,24 @@ static inline bool within_kprobe_blacklist(unsigned long addr)
>>  {
>>  	return true;
>>  }
>> +static inline int kprobe_get_kallsym(unsigned int symnum, unsigned long *value,
>> +				     char *type, char *sym)
>> +{
>> +	return 0;
>> +}
>> +static inline int kprobe_cache_get_kallsym(struct kprobe_insn_cache *c,
>> +					   unsigned int *symnum,
>> +					   unsigned long *value, char *type,
>> +					   char *sym)
>> +{
>> +	return 0;
>> +}
>> +static inline int arch_kprobe_get_kallsym(unsigned int *symnum,
>> +					  unsigned long *value, char *type,
>> +					  char *sym)
>> +{
>> +	return 0;
>> +}
> 
> there's another arch_kprobe_get_kallsym marked as __weak,
> is above function superfluous?

Yes, it is removed in V3.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ