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]
Date:   Fri, 28 Aug 2020 19:32:11 +0000
From:   "Eddy_Wu@...ndmicro.com" <Eddy_Wu@...ndmicro.com>
To:     Masami Hiramatsu <mhiramat@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: RE: [PATCH v4 19/23] kprobes: Remove kretprobe hash


> -----Original Message-----
> From: Masami Hiramatsu <mhiramat@...nel.org>
>
> @@ -1311,24 +1257,23 @@ void kprobe_busy_end(void)
>  void kprobe_flush_task(struct task_struct *tk)
>  {
>         struct kretprobe_instance *ri;
> -       struct hlist_head *head;
> -       struct hlist_node *tmp;
> -       unsigned long hash, flags = 0;
> +       struct llist_node *node;
>
> +       /* Early boot, not yet initialized. */
>         if (unlikely(!kprobes_initialized))
> -               /* Early boot.  kretprobe_table_locks not yet initialized. */
>                 return;
>
>         kprobe_busy_begin();
>
> -       hash = hash_ptr(tk, KPROBE_HASH_BITS);
> -       head = &kretprobe_inst_table[hash];
> -       kretprobe_table_lock(hash, &flags);
> -       hlist_for_each_entry_safe(ri, tmp, head, hlist) {
> -               if (ri->task == tk)
> -                       recycle_rp_inst(ri);
> +       node = current->kretprobe_instances.first;
> +       current->kretprobe_instances.first = NULL;

I think we are flushing tk instead of current here.
After fixing this to tk, the NULL pointer deference is gone!

> +
> +       while (node) {
> +               ri = container_of(node, struct kretprobe_instance, llist);
> +               node = node->next;
> +
> +               recycle_rp_inst(ri);
>         }
> -       kretprobe_table_unlock(hash, &flags);
>
>         kprobe_busy_end();
>  }

TREND MICRO EMAIL NOTICE

The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.

For details about what personal information we collect and why, please see our Privacy Notice on our website at: Read privacy policy<http://www.trendmicro.com/privacy>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ