tech-kern archive

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

Re: spl question



   Date: Wed, 29 Jul 2015 19:27:58 +0200
   From: Maxime Villard <max%m00nbsd.net@localhost>

   Le 29/07/2015 17:22, Taylor R Campbell a écrit :
   >    Date: Wed, 29 Jul 2015 07:59:46 +0200
   >    From: Maxime Villard <max%m00nbsd.net@localhost>
   > 
   >    What happens if the kernel calls splx(s) twice? And what happens if it
   >    forgets to call splx(s)? Like:
   > 
   > This is a bug of pretty much the same class as missing mutex_exit.

   Ok, thanks. That's what I suspected. So sys/dev/ic/gem.c::gem_init()
   is buggy, right? (found by Brainy)

Looks like it.  There are three bugs, I think:

- missing splx in one error branch,
- wrong return value in the same error branch (1, not EWHATEVER), and
- incorrectly returns zero in another error branch (rc set, not used).

Not 100% confident about the second two -- I just took a cursory
glance.


Home | Main Index | Thread Index | Old Index