https://forge.ispras.ru/https://forge.ispras.ru/favicon.ico?16490126692012-08-03T08:32:46ZOpen-Source ProjectsLinux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=125742012-08-03T08:32:46ZIlya Shchepetkovshchepetkov@ispras.ru
<ul></ul><p>Night tests have shown:</p>
<pre>
-driver=test-0032-drivers-media-video-cafe_ccic.tar.bz2;origin=external;kernel=linux-2.6.32.15;model=32_1;module=drivers/test-032-drivers-media-video-cafe_ccic/cafe_ccic.ko;main=ldv_main0_sequence_infinite_withcheck_stateful;verdict=unsafe
+driver=test-0032-drivers-media-video-cafe_ccic.tar.bz2;origin=external;kernel=linux-2.6.32.15;model=32_1;module=drivers/test-032-drivers-media-video-cafe_ccic/cafe_ccic.ko;main=ldv_main0_sequence_infinite_withcheck_stateful;verdict=unknown;RCV_status=fail;problems=Out_of_memory
</pre>
<p>I removed this file from the test set for a while. Commit f9dd2f7 of master branch.</p> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=141932012-11-08T07:29:18ZEvgeny Novikovnovikov@ispras.ru
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Open</i></li><li><strong>Assignee</strong> set to <i>Evgeny Novikov</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li></ul><p>Aspect model 32_7a doesn't contain necessary model for <a href="http://lxr.linux.no/#linux+v3.6.6/include/linux/mutex.h#L134" class="external">mutex_lock_nested function</a>. Plain model uses a special configuration (it undefines CONFIG_DEBUG_LOCK_ALLOC) that allows to avoid this because of <a href="http://lxr.linux.no/#linux+v3.6.6/include/linux/mutex.h#L156" class="external">mutex_lock_nested is a macro</a> that is expanded as modeled mutex_lock function.</p> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=141952012-11-08T08:17:04ZEvgeny Novikovnovikov@ispras.ru
<ul></ul><p><a href="http://www.google.ru/#hl=ru&newwindow=1&sclient=psy-ab&q=mutex_lock_nested&oq=mutex_lock_nested&gs_l=hp.3..0i10j0i8i30j0i30j0i8i10i30.744.3952.0.4124.17.14.0.1.1.0.176.1283.10j4.14.0...0.0...1c.1.w_c_vH1n7jc&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=943eb23c62c2f3ed&bpcl=37643589&biw=1272&bih=775" class="external">Google</a> provides me an interesting related issue... from our bugzilla. It's <a class="issue tracker-1 status-1 priority-4 priority-default" title="Bug: Develop model 32_8 that takes into account mutex_lock_nested, etc. (New)" href="https://forge.ispras.ru/issues/785">#785</a>. So, actually it isn't so simple to model mutex_lock_nested properly. Simple treating it as mutex_lock leads to false positives (e.g. see error traces for <a href="http://joker:8999/stats/errortrace/profilename/default/name/ldv_db_7/user/joker/host/localhost/password/no/filter/TA.id%3E334+and+RU.name+like+%2732%25%27/page/Error+trace/value/168135/Task+id/335/Environment+version/linux-3.7-rc1/Rule+name/32_7a/Module/drivers%2Fscsi%2Flibfc%2Flibfc.ko/Entry+point/ldv_main5_sequence_infinite_withcheck_stateful" class="external">unmodeled mutex_lock_nested</a> and <a href="http://joker:8999/stats/errortrace/profilename/default/name/ldv_db_7/user/joker/host/localhost/password/no/filter/TA.id%3E334+and+RU.name+like+%2732%25%27/page/Error+trace/value/178439/Task+id/338/Environment+version/linux-3.7-rc1/Rule+name/32_7a/Module/drivers%2Fscsi%2Flibfc%2Flibfc.ko/Entry+point/ldv_main5_sequence_infinite_withcheck_stateful#linux-3_7-rc1_csd_deg_dscv_45_dscv_tempdir_dscv_ri_32_7a_drivers_scsi_libfc_fc_npiv_c_prepared:430" class="external">modeled mutex_lock_nested</a>). BTW, using COMPLEX_ID in rerouting won't help since two mutexes are the same field of the same structure fc_lport.</p> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=142172012-11-12T08:49:15ZEvgeny Novikovnovikov@ispras.ru
<ul></ul><p>Commit 1462ea9 has removed one more driver that demonstrated nondetermined behavior:<br /><pre><code class="diff syntaxhl" data-language="diff"><span class="gd">-driver=kbdrivers--0032-2.6.31.6--test-0032-2.6.31.6-verdict-unsafe-drivers--usb--class--cdc-acm.c.tar.bz2;origin=external;kernel=linux-2.6.31.6;model=32_1;module=drivers/kbdrivers/0032-2.6.31.6/test-0032-2.6.31.6-verdict-unsafe-drivers--usb--class--cdc-acm.c/cdc-acm.ko;main=ldv_main0_sequence_infinite_withcheck_stateful;verdict=unsafe
</span><span class="gi">+driver=kbdrivers--0032-2.6.31.6--test-0032-2.6.31.6-verdict-unsafe-drivers--usb--class--cdc-acm.c.tar.bz2;origin=external;kernel=linux-2.6.31.6;model=32_1;module=drivers/kbdrivers/0032-2.6.31.6/test-0032-2.6.31.6-verdict-unsafe-drivers--usb--class--cdc-acm.c/cdc-acm.ko;main=ldv_main0_sequence_infinite_withcheck_stateful;verdict=unknown;RCV_status=fail;problems=Exception
</span></code></pre></p> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=144002012-11-27T14:43:25ZIlya Shchepetkovshchepetkov@ispras.ru
<ul></ul><p>Commit 8339999 has removed one more driver that demonstrated nondetermined behavior:</p>
<pre>
-driver=kbdrivers--0032-2.6.31.6--test-0032-2.6.31.6-verdict-unsafe-drivers--media--video--cafe_ccic.c.tar.bz2;origin=external;kernel=linux-2.6.31.6;model=32_1;module=drivers/kbdrivers/0032-2.6.31.6/test-0032-2.6.31.6-verdict-unsafe-drivers--media--video--cafe_ccic.c/cafe_ccic.ko;main=ldv_main0_sequence_infinite_withcheck_stateful;verdict=unsafe
+driver=kbdrivers--0032-2.6.31.6--test-0032-2.6.31.6-verdict-unsafe-drivers--media--video--cafe_ccic.c.tar.bz2;origin=external;kernel=linux-2.6.31.6;model=32_1;module=drivers/kbdrivers/0032-2.6.31.6/test-0032-2.6.31.6-verdict-unsafe-drivers--media--video--cafe_ccic.c/cafe_ccic.ko;main=ldv_main0_sequence_infinite_withcheck_stateful;verdict=unknown;RCV_status=fail;problems=Out_of_memory
</pre> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=144562012-12-03T08:40:33ZIlya Shchepetkovshchepetkov@ispras.ru
<ul><li><strong>Subject</strong> changed from <i>32_1: Locking a mutex twice or unlocking without prior locking</i> to <i>32: Locking a mutex twice or unlocking without prior locking</i></li></ul><p>Commit a50a723 has added new model function kref_put_mutex in 32_7a.</p> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=144572012-12-03T10:37:41ZEvgeny Novikovnovikov@ispras.ru
<ul><li><strong>Priority</strong> changed from <i>High</i> to <i>Normal</i></li></ul> Linux Kernel Safety RuleDB - Feature #3324: 32: Locking a mutex twice or unlocking without prior lockinghttps://forge.ispras.ru/issues/3324?journal_id=154312013-03-08T16:16:06ZAlexey Khoroshilovkhoroshilov@ispras.ru
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>