Miscellaneous

Faults in Linux Kernel 3.x : Disable interrupts and not re-enable them

As part of my work, I need to annotate the reports generated using Coccinelle Scripts as bugs/FPs for recent Linux Kernels, recent as in versions > 3.0 till the current one 3.18.

This blog post is about the bugs and FPs I found for the report which checks here interrupts are turned off but not turned on again, using the functions local_irq_save or save_and_cli, where interrupts are turned off but not turned on again, using the functions cli, where a lock that is taken but not released. Interrupts are disabled at the same time and where a lock that is taken more than once. Interrupts are disabled at the same time. You can view the annotated report here and here.

 

I have discussed about local_irq_save, save_and_cli e.t.c, already in my previous posts.

In early versions of Linux, locks and interrupts were managed separately: typically interrupts were disabled and reenabled using cli and sti, respectively, while locks were managed using operations on spinlocks or semaphores.
In Linux 2.1.30, however, functions such as spin_lock_irq were introduced to combine locking and interrupt management.

 

What did I found?

There were many cases where it is done intentionally that it is needed. So it is tagged as intentional FP. There are very less bugs of this kind. So current Linux Kernel versions has less bugs as compared to previous versions. 🙂

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s