NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/41076: sigwaitinfo and sigtimedwait don't properly set siginfo



The following reply was made to PR kern/41076; it has been noted by GNATS.

From: Matteo Beccati <matteo%beccati.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Matthias Drochner <M.Drochner%fz-juelich.de@localhost>
Subject: Re: kern/41076: sigwaitinfo and sigtimedwait don't properly set 
 siginfo
Date: Thu, 26 Mar 2009 18:38:46 +0100

 This is a multi-part message in MIME format.
 --------------060008080904090108060605
 Content-Type: text/plain; charset=ISO-8859-15; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 > From: Matthias Drochner <M.Drochner%fz-juelich.de@localhost>
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc: kern-bug-people%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost,
 >      netbsd-bugs%NetBSD.org@localhost
 > Subject: Re: kern/41076: sigwaitinfo and sigtimedwait don't properly set 
 >      siginfo
 > Date: Thu, 26 Mar 2009 17:13:06 +0100
 > 
 >  This is a multipart MIME message.
 >  
 >  --==_Exmh_21140580013800
 >  Content-Type: text/plain; charset=us-ascii
 >  
 >  
 >  matteo%beccati.com@localhost said:
 >  >  si_pid and si_uid should be set when si_code == SI_USER (== 0)
 >  
 >  There is a bug in the kernel - the appended patch fixes it
 >  for -current. I'm assuming that the code looks similar
 >  in 4.0 - can you give it a try?
 
 The patch doesn't cleanly apply as the code is a bit different (the 
 check for (sa->sa_flags & SA_SIGINFO) == 0) is a few lines above and has 
 its how if/return.
 
 The fix is working, I'm attaching a diff for the netbsd-4 branch in case 
 you want to apply it.
 
 >  > si_sigval should be set when si_code == SI_TIMER (== -2)
 >  
 >  It says it is set to the value of timer_create. You didn't
 >  use timer_create... If you modify your test program to do:
 
 Right. The test code is working fine.
 
 
 Cheers
 
 -- 
 Matteo Beccati
 
 OpenX - http://www.openx.org
 
 --------------060008080904090108060605
 Content-Type: text/plain;
  name="kern_sig_netbsd_4.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="kern_sig_netbsd_4.diff"
 
 diff -u -r1.240.2.2 kern_sig.c
 --- sys/kern/kern_sig.c 7 Oct 2007 14:21:11 -0000       1.240.2.2
 +++ sys/kern/kern_sig.c 26 Mar 2009 17:12:51 -0000
 @@ -180,21 +180,17 @@
  }
 
  /*
 - * Append a new ksiginfo element to the list of pending ksiginfo's, if
 - * we need to (SA_SIGINFO was requested). We replace non RT signals if
 - * they already existed in the queue and we add new entries for RT signals,
 - * or for non RT signals with non-existing entries.
 + * Append a new ksiginfo element to the list of pending ksiginfo's.
 + * We replace non RT signals if they already existed in the queue
 + * and we add new entries for RT signals, or for non RT signals
 + * with non-existing entries.
   */
  static void
  ksiginfo_queue(struct proc *p, const ksiginfo_t *ksi, ksiginfo_t **newkp)
  {
         ksiginfo_t *kp;
 -       struct sigaction *sa = &SIGACTION_PS(p->p_sigacts, ksi->ksi_signo);
         int s;
 
 -       if ((sa->sa_flags & SA_SIGINFO) == 0)
 -               return;
 -
         /*
          * If there's no info, don't save it.
          */
 
 --------------060008080904090108060605--
 


Home | Main Index | Thread Index | Old Index