Project

General

Profile

Actions

Feature #7909

open

Add model for macro IDR_INIT (rule specification linux:lib:idr)

Added by Evgeny Novikov almost 8 years ago. Updated almost 8 years ago.

Status:
Open
Priority:
High
Assignee:
-
Category:
Requirement specifications
Target version:
-
Start date:
01/25/2017
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

This looks like there are many false alarms due to lack of this model on many various versions of the Linux kernel including 3.14. In addition corresponding test cases should be added (at least safe shouldn't be detected in case of absence of the model).

Actions #1

Updated by Vitaly Mordan almost 8 years ago

For kernels ~2.6.33 fixed in branch fix_153_2.6.33.

Actions #2

Updated by Evgeny Novikov almost 8 years ago

I still don't observe a test case so the issue wasn't fixed.

Actions #3

Updated by Vitaly Mordan almost 8 years ago

Tests are executed in 3.14, this problem can not be found there. Test will be pointless.

Actions #4

Updated by Evgeny Novikov almost 8 years ago

Tests can be executed on any version of the Linux kernel but I expect you will add a test case for Linux 3.14 where this issue does exist. You should inspect a list of potential false alarms here (the concrete example).

Actions #5

Updated by Evgeny Novikov almost 8 years ago

The model implemented is incorrect, since usually DEFINE_IDR is used in the global scope, while you modeled it as a function call. The test case is incorrect because of you mixed declarations (DEFINE_IDR) and expressions. Most likely you didn't even try your model on real Linux kernel modules with false alarms.

Actions #6

Updated by Vitaly Mordan almost 8 years ago

The real problem is that klever does not support static initialization by such macros, as old LDV Tools did:


[% FOREACH sign = static_inits; PROCESS make_human_sign %]

One more degradation of klever.

Actions #7

Updated by Vitaly Mordan almost 8 years ago

I changed rule linux:idr by allowing multiple inits.
Now there is another false positive (module drivers/scsi/sg.ko), it looks like because of EMG.

Actions #8

Updated by Evgeny Novikov almost 8 years ago

I don't see any changes in this branch in the repository. Also I hope that you fix and try the developed test case.

Actions #10

Updated by Evgeny Novikov almost 8 years ago

Vitaly Mordan wrote:

508d6280

Likely you pushed your changes into an incorrect repository.

Actions #11

Updated by Vitaly Mordan almost 8 years ago

Commited again.
Rule linux:idr and its tests are adjusted.

Actions #12

Updated by Evgeny Novikov almost 8 years ago

  • Status changed from New to Resolved
  • Assignee changed from Vitaly Mordan to Evgeny Novikov

I made everything required in branch fix-linux-lib-idr. Correct tests are passed. The false alarm for Linux 2.6.33 has gone. But instead 4 new interesting unsafes were reported. Ilja Zakharov will review and print statistics here. After that we will decide what to do further.

Actions #13

Updated by Vitaly Mordan almost 8 years ago

Of course, you made it incorrect.
If you initialize each idr with

ldv_idr_sg_index_idr = LDV_INITIALIZED

you need to check this value in ldv_check_final_state as well instead of LDV_NOT_INITIALIZED.

Actions #14

Updated by Vitaly Mordan almost 8 years ago

Evgeny Novikov wrote:

I made everything required in branch fix-linux-lib-idr. Correct tests are passed. The false alarm for Linux 2.6.33 has gone. But instead 4 new interesting unsafes were reported. Ilja Zakharov will review and print statistics here. After that we will decide what to do further.

All those unsafes are false alarms.

Actions #15

Updated by Alexey Khoroshilov almost 8 years ago

  • Status changed from Resolved to Open
Actions #16

Updated by Evgeny Novikov almost 8 years ago

  • Assignee deleted (Evgeny Novikov)
  • Priority changed from Immediate to High

One day one will eventually spend much time to fix this rule specification.

Actions

Also available in: Atom PDF