Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2010 11:58:04 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/kern kern_sig.c src/sys/sys signalvar.h
Message-ID:  <201001201158.o0KBwwMf037137@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
kib         2010-01-20 11:58:04 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             kern_sig.c 
    sys/sys              signalvar.h 
  Log:
  SVN rev 202692 on 2010-01-20 11:58:04Z by kib
  
  When traced process is about to receive the signal, the process is
  stopped and debugger may modify or drop the signal. After the changes to
  keep process-targeted signals on the process sigqueue, another thread
  may note the old signal on the queue and act before the thread removes
  changed or dropped signal from the process queue. Since process is
  traced, it usually gets stopped. Or, if the same signal is delivered
  while process was stopped, the thread may erronously remove it,
  intending to remove the original signal.
  
  Remove the signal from the queue before notifying the debugger. Restore
  the siginfo to the head of sigqueue when signal is allowed to be
  delivered to the debugee, using newly introduced KSI_HEAD ksiginfo_t
  flag. This preserves required order of delivery. Always restore the
  unchanged signal on the curthread sigqueue, not to the process queue,
  since the thread is about to get it anyway, because sigmask cannot be
  changed.
  
  Handle failure of reinserting the siginfo into the queue by falling
  back to sq_kill method, calling sigqueue_add with NULL ksi.
  
  If debugger changed the signal to be delivered, use sigqueue_add()
  with NULL ksi instead of only setting sq_signals bit.
  
  Reported by:    Gardner Bell <gbell72 rogers com>
  Analyzed and first version of fix by:   Tijl Coosemans <tijl coosemans org>
  PR:     142757
  Reviewed by:    davidxu
  MFC after:      2 weeks
  
  Revision  Changes    Path
  1.385     +30 -15    src/sys/kern/kern_sig.c
  1.86      +1 -0      src/sys/sys/signalvar.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001201158.o0KBwwMf037137>