Skip to contentSkip to conversation

Coccinelle rule for CVE-2019-18683

Cocci Markus Elfring 2 participants 3 messages Apr 9, 2020 – Apr 10, 2020 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

Do you have any idea how to improve it?

I see further software development possibilities of varying relevance also for this script of the semantic patch language.

* The SmPL variables “lock_p”, “unlock_p” and “stop_p” could be declared in a more succinct way just by listing them in the same statement.

* The source code search pattern can be too generic. How do you think about to consider additional constraints for safer data control flow analysis?

* Other operation modes might become helpful.

Regards,
Markus

#1 lore raw

Markus, thanks for your remarks!

Quoted 3 lines · Markus Elfring

* The source code search pattern can be too generic. How do you think about to consider additional constraints for safer data control flow analysis?

Could you please elaborate on that?

I used 'exists' keyword to find at least one branch that has mutex_unlock+kthread_stop+mutex_lock chain.

Quoted 1 line

* Other operation modes might become helpful.

Thanks! I added 'context' mode, it's very good for this purpose.

Best regards,
Alexander

#2 lore raw
Quoted 5 lines
Quoted 3 lines

* The source code search pattern can be too generic. How do you think about to consider additional constraints for safer data control flow analysis?

Could you please elaborate on that?

Julia Lawall chose to mention the design possibility “put when != mutex_lock(E) after the ...”.
https://systeme.lip6.fr/pipermail/cocci/2020-April/007107.html
https://lore.kernel.org/cocci/alpine.DEB.2.21.2004091248190.2403@hadrien/

Quoted 2 lines

I used 'exists' keyword to find at least one branch that has mutex_unlock+kthread_stop+mutex_lock chain.

Are you informed about development challenges for data flow analysis (or even escape analysis according to computer science)?

How many experiences can be reused from other known approaches?

Regards,
Markus