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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 24 Nov 2006 12:50:52 +0300
From:	Evgeniy Polyakov <johnpol@....mipt.ru>
To:	Ulrich Drepper <drepper@...hat.com>
Cc:	David Miller <davem@...emloft.net>, Andrew Morton <akpm@...l.org>,
	netdev <netdev@...r.kernel.org>,
	Zach Brown <zach.brown@...cle.com>,
	Christoph Hellwig <hch@...radead.org>,
	Chase Venters <chase.venters@...entec.com>,
	Johann Borck <johann.borck@...sedata.com>,
	linux-kernel@...r.kernel.org, Jeff Garzik <jeff@...zik.org>,
	Alexander Viro <aviro@...hat.com>
Subject: Re: Kevent POSIX timers support.

On Thu, Nov 23, 2006 at 12:26:15PM -0800, Ulrich Drepper (drepper@...hat.com) wrote:
> Evgeniy Polyakov wrote:
> >+static int posix_kevent_init(void)
> >+{
> >+	struct kevent_callbacks tc = {
> >+		.callback = &posix_kevent_callback,
> >+		.enqueue = &posix_kevent_enqueue,
> >+		.dequeue = &posix_kevent_dequeue};
> 
> How do we prevent that somebody tries to register a POSIX timer event 
> source with kevent_ctl(KEVENT_CTL_ADD)?  This should only be possible 
> from sys_timer_create and nowhere else.
> 
> Can you add a parameter to kevent_enqueue indicating this is a call from 
> inside the kernel and then ignore certain enqueue callbacks?

I think we need some set of flags for callbacks - where they can be
called, maybe even from which context and so on. So userspace will not
be allowed to create such timers through kevent API.
Will do it for release.
 
> >@@ -343,23 +439,27 @@ static int posix_timer_fn(struct hrtimer
> > 
> > 	timr = container_of(timer, struct k_itimer, it.real.timer);
> > 	spin_lock_irqsave(&timr->it_lock, flags);
> >+	
> >+	if (timr->it_sigev_notify & SIGEV_KEVENT) {
> >+		kevent_storage_ready(&timr->st, NULL, KEVENT_MASK_ALL);
> >+	} else {
> 
> We need to pass the data in the sigev_value meember of the struct 
> sigevent structure passed to timer_create to the caller.  I don't see it 
> being done here nor when the timer is created.  Do I miss something? 
> The sigev_value value should be stored in the user/ptr member of struct 
> ukevent.

sigev_value was stored in k_itimer structure, I just do not know where
to put it in the ukevent provided to userspace - it can be placed in
pointer value if you like.

> >+		if (event.sigev_notify & SIGEV_KEVENT) {
> 
> Don't use a bit.  It makes no sense to combine SIGEV_SIGNAL with 
> SIGEV_KEVENT etc.  Only SIGEV_THREAD_ID is a special case.
> 
> Just define SIGEV_KEVENT to 3 and replace the tests like the one cited 
> above with
> 
>   if (timr->it_sigev_notify == SIGEV_KEVENT)

Ok.

> -- 
> ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, 
> CA ❖

-- 
	Evgeniy Polyakov
-
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