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, 29 Jan 2021 11:37:39 +0800
From:   "Wangshaobo (bobo)" <bobo.shaobowang@...wei.com>
To:     Masami Hiramatsu <mhiramat@...nel.org>
CC:     Steven Rostedt <rostedt@...dmis.org>, <naveen.n.rao@...ux.ibm.com>,
        <anil.s.keshavamurthy@...el.com>, <davem@...emloft.net>,
        <linux-kernel@...r.kernel.org>, <huawei.libin@...wei.com>,
        <cj.chengjian@...wei.com>
Subject: Re: [PATCH] kretprobe: avoid re-registration of the same kretprobe
 earlier

Dear Masami and Steve,

I have sent v2 but still have confusions:

> OK, I think it is simpler to check the rp->kp.addr && rp->kp.symbol_name
> because it is not allowed (it can lead inconsistent setting).
>
> How about this code? Is this work for you?
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 41fdbb7953c6..73500be564be 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -2103,6 +2103,14 @@ int register_kretprobe(struct kretprobe *rp)
>          int i;
>          void *addr;
>   
> +       /* It is not allowed to specify addr and symbol_name at the same time */
> +       if (rp->kp.addr && rp->kp.symbol_name)
> +               return -EINVAL;
> +

above sentence can be removed because of kprobe_on_func_entry() do it:

kprobe_on_func_entry()

      -=>_kprobe_addr() {if (rp->kp.addr && rp->kp.symbol_name) ...}

> +       /* If only rp->kp.addr is specified, check reregistering kprobes */
> +       if (rp->kp.addr && check_kprobe_rereg(&rp->kp))
> +               return -EINVAL;

for arch arm64,x86_64, above sentence can be moved behind following 
sentence.

kprobe_on_func_entry()

     -=>arch_kprobe_on_func_entry() {kp->offset can not be 0 ; ...}

So if offset of kprobe if not 0, do not waste time to excute above sentence.


But for Arch ppc64,  I still not figure out better one solution.


Thank you

-- Wang ShaoBo

>          if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
>                  return -EINVAL;
>   
>
> Thank you,
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ