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:	Wed, 14 Oct 2015 10:57:04 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Dmitry Vyukov <dvyukov@...gle.com>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>,
	tip-bot for Andrey Ryabinin <tipbot@...or.com>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>,
	kasan-dev <kasan-dev@...glegroups.com>,
	Kostya Serebryany <kcc@...gle.com>,
	Borislav Petkov <bp@...en8.de>,
	Andrey Ryabinin <aryabinin@...tuozzo.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Sasha Levin <sasha.levin@...cle.com>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Wolfram Gloger <wmglo@...t.med.uni-muenchen.de>,
	Andrey Konovalov <andreyknvl@...gle.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Alexander Potapenko <glider@...gle.com>
Subject: Re: [tip:locking/urgent] compiler, atomics: Provide READ_ONCE_NOCHECK ()

On Wed, Oct 14, 2015 at 10:48 AM, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Peter Zijlstra <peterz@...radead.org> wrote:
>
>> > I'd still rather find a way to just delete get_wchan, but whatever.
>>
>> :-)
>
> AFAICS can only do that at the price of slowing down various scheduler functions
> by saving the caller address.
>

A quick check on my machine:

# for i in /proc/*/wchan; do cat $i && echo ''; done |sort |uniq

doesn't have very much of interest to say:

0
devtmpfsd
dmcrypt_write
do_sigtimedwait
do_wait
ep_poll
fsnotify_mark_destroy
futex_wait_queue_me
hrtimer_nanosleep
irq_thread
kauditd_thread
khugepaged
kjournald2
ksm_scan_thread
kswapd
kthreadd
pipe_wait
poll_schedule_timeout
rcu_gp_kthread
rcu_nocb_kthread
rescuer_thread
scsi_error_handler
sk_wait_data
smpboot_thread_fn
unix_stream_recvmsg
wait_woken
worker_thread
xfsaild

A bunch of those look like they're specific to kernel threads, for
which this whole mechanism is probably pointless -- just reading
/proc/PID/stack (with suitable privilege) is probably better.

For the rest, a few are useful, but I find myself wondering whether
this mechanism is really useful enough to be worth keeping.  We could
just return "asleep" in /proc/PID/wchan.

A more interesting thing to do might be to try to decode regs->orig_ax
to give a guess as to which syscall is asleep.  But this seems like a
lot of fiddling and a lot of worry about security issues for a
mechanism of dubious value.  Also:

$ cat /proc/1/wchan
ep_poll

Why do we allow unprivileged queries like that at all?

--Andy
--
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