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:	Tue, 09 Dec 2014 10:30:37 +0000
From:	"Jon Medhurst (Tixy)" <tixy@...aro.org>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc:	Wang Nan <wangnan0@...wei.com>, lizefan@...wei.com,
	linux@....linux.org.uk, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: Re: [PATCH v14 7/7] ARM: kprobes: enable OPTPROBES for ARM 32

On Tue, 2014-12-09 at 19:14 +0900, Masami Hiramatsu wrote:
> (2014/12/08 20:50), Jon Medhurst (Tixy) wrote:> arch_optimize_kprobes is calling __arch_optimize_kprobes, which is
> > iterating over a list of probes and removing each one in turn, if this
> > is happening on multiple cpu's simultaneously, it's not clear to me that
> > such an operation is safe. list_del_init calls __list_del which does
> >
> > 	next->prev = prev;
> > 	prev->next = next;
> >
> > so what happens if another cpu is at the same time updating any of those
> > list entries? Without even fully analysing the code I can see that with
> > the fact that the list handling helpers have no memory barriers, that
> > the above two lines could be seen to execute in the reverse order, e.g.
> >
> > 	prev->next = next;
> > 	next->prev = prev;
> >
> > so another CPU could find and delete next before this one has finished
> > doing so. Would the list end up in a consistent state where no loops
> > develop and no probes are missed? I don't know the answer and a full
> > analysis would be complicated, but my gut feeling is that if a cpu can
> > observe the links in the list in an inconsistent state then only bad
> > things can result.
> 
> Just a comment, arch_optimize_kprobes() are only called under
> kprobe_mutex held. No concurrent update happens :)

Except in the case of the code I was commenting on which was using
stop_machine to make all cpu's simultaneously do the work of
arch_optimize_kprobes :-)

-- 
Tixy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ