From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:13690 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245738AbhIAPZI (ORCPT ); Wed, 1 Sep 2021 11:25:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=8EL5l8RSyufC07TCv0G5DV0+4A/4rrjMhh80bFit390=; b=IuUcTidmYDeUk+l/9Z5glzNisR8yK/l0N9gVtJvcYH/sJmREdl7GUfaI3u90JngAikS/ BSaSGrXwoTDPm3K42x/HVzvbcTfZRwU7nT1mE1C3Gc5uVCIud+C9O+OaaVMEBOiAv63n GcBoMNpV+XItnML8Q3Qvguj4IJnJcAMuS8+uutV8624eSqdmLF/fJMJg69Zs21Wz2RuZ vHb998bL70AW2Avut+XqyY9tmWq9cNt+r8CHOCoGEJBcfxpvL5RHrmXmM20L1N2x/t46 1I8ShMYpdLfDXonyD8xWMp5M5r1Ll0drJnvLMT8XmrqbnF4p3QgB0A05FhSxdai7AIsA fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2020-01-29; bh=8EL5l8RSyufC07TCv0G5DV0+4A/4rrjMhh80bFit390=; b=jwZOri8AmngvGGcLUzuDTToxmG5QeCreQoaAjGdGj+uh6HYHUviJY2l+V9y/nBztK6QE 3i469A47IoQZCO/nHPKiVPaFpag0gF8d7w/mTC9PjsiMn8ZN+O5TxvXtABCl4iqMymsu riMJiSBYsbXArpGX0ZZmE8y1nf04yu2sjklL+mp60UBDRnKMLQFs1fjVnjsqkpa6tAc6 nyA81mMgBkxF/4maR2kuP927/5CQRfnuaI6O1Mnz8XYgL3lD9X7BLn14BH1IsQ4xAWMM DN02aQmTQ7qp/3YRklpumy62Wxa6bhx4mFVh3g5392tT2S90LB73WcMdy9BNHzT4m5lx ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8EL5l8RSyufC07TCv0G5DV0+4A/4rrjMhh80bFit390=; b=Uoj4cAPZXZ8boH12LF/CYC/BjBrRnbcGjPBRk/ut/eDUuiionPnaGQB8vxyAdXx7DQ9Yeb2uk2yVFchpX3kJBpHo4LaleRAzzK28MAck5AIT1em3lOEcB7nwzzvXqtpAPfXc6wFsEn5SD2JXW4EwUsNYp7FF4rcEihXrZHAwyFs= Date: Wed, 1 Sep 2021 18:23:49 +0300 From: Dan Carpenter Subject: Smatch v1.72 released Message-ID: <20210901152349.GC2151@kadam> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline MIME-Version: 1.0 List-ID: To: smatch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pavel Skripkin , Harshvardhan Jha Smatch is a C static checker with a lot of kernel specific checks. You can download it from: http://repo.or.cz/w/smatch.git. Or if you prefer a github mirror, then you can download it from https://github.com/error27/smatch I'm trying to do more regular releases (two per year). Special shout out to Pavel Skripkin who wrote a check for use after frees releated to free_netdev() and to Harshvardhan Jha who wrote some new code and fixes for how Smatch handles bit tests. With this release, internally the param/key API has been fleshed out and improved. The check_unwind.c is an example of that where the return_param_release() is used by hard coded data in the func_table[] array and it is also used by the DB. It just removes a lot of boiler plate code and it makes working with the database easier. The other thing that's new is the SSA module which is also used in check_unwind.c. It's so that if you have: ret = alloc(); if (IS_ERR(ret)) return; p->foo = ret; Now if you "p->foo" that's the same as freeing "ret". The param/key API and the SSA module are going to be important going forward and I'll probably end up re-writing a lot of code to take advantage of them. The exciting new check in this release is the scheduling in atomic check. It requires the cross function DB to be useful. And the warnings that it prints require cross function analysis to understand. net/sctp/socket.c:480 sctp_send_asconf() warn: sleeping in atomic context The line 480 calls sctp_primitive_ASCONF() which uses a GFP_KERNEL flag so presumably it sleeps. Use the `smatch_data/db/smdb.py preempt` command to print the call tree and find out where the spin lock is held. $ smdb.py preempt sctp_send_asconf sctp_addr_wq_timeout_handler() <- disables preempt -> sctp_asconf_mgmt() -> sctp_send_asconf_add_ip() sctp_asconf_mgmt() -> sctp_send_asconf_del_ip() -> sctp_send_asconf() $ When the call tree is so long like this there is a lot of chance for false positives but really it's surprising how high quality these warnings are. Please test and let me know if you find any issues! regards, dan carpenter