lkml.org 
[lkml]   [2004]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix sigqueue accounting for posix-timers broken by new RLIMIT_SIGPENDING tracking code
* Chris Wright (chrisw@osdl.org) wrote:
> * Roland McGrath (roland@redhat.com) wrote:
> >
> > The introduction of RLIMIT_SIGPENDING and the associated tracking code was
> > broken for the case of preallocated sigqueue elements, i.e. posix-timers.
> > It wrongly includes the timer's preallocated sigqueue structs in the count
> > towards the per-user when allocating them, but (rightly) does not decrement
> > the count when they are freed.
>
> Are you sure? IOW, are you seeing a leak of the count? The sigqueue
> structure has a lifetime the same as the timer, IIRC. So each time the
> signal is sent/received there's no accounting, because it's reused.
> But timer create/delete does sigqueue_alloc -> __sigqueue_alloc which
> does the inc. and sigqueue_free -> __sigqueue_free which does the dec.
> I'm fairly sure I had tested this.

Yeah, I re-read the code and re-ran my tests just now to verify. Current
code is correct. In fact, this patch is wrong. It unbalances the inc/dec
such that sigqueue_alloc() won't inc, yet final sigqueue_free (at timer
destruction) will still dec. Please don't apply this patch.

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans