From patchwork Sun Feb 9 22:48:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 11372317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA5CF921 for ; Sun, 9 Feb 2020 22:48:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9A20D20838 for ; Sun, 9 Feb 2020 22:48:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EkGmaN7H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A20D20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AC6CA6B0005; Sun, 9 Feb 2020 17:48:19 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A50936B000C; Sun, 9 Feb 2020 17:48:19 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93EC96B000D; Sun, 9 Feb 2020 17:48:19 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 7962D6B0005 for ; Sun, 9 Feb 2020 17:48:19 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 32A5A824805A for ; Sun, 9 Feb 2020 22:48:19 +0000 (UTC) X-FDA: 76472078718.28.vein62_4897dbd4fab23 X-Spam-Summary: 2,0,0,0fabccf77ffd4192,d41d8cd98f00b204,jbi.octave@gmail.com,:boqun.feng@gmail.com:linux-kernel@vger.kernel.org::kasan-dev@googlegroups.com:akpm@linux-foundation.org:dvyukov@google.com:glider@google.com:aryabinin@virtuozzo.com:jbi.octave@gmail.com,RULES_HIT:41:355:379:541:800:960:973:982:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1540:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3351:3865:3870:3871:4321:5007:6261:6653:7514:7875:9413:10004:11026:11658:11914:12043:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13311:13357:13894:14096:14181:14384:14394:14687:14721:21080:21433:21444:21451:21627:21666:30054:30075,0,RBL:209.85.221.67:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:22,LUA_SUMMARY:none X-HE-Tag: vein62_4897dbd4fab23 X-Filterd-Recvd-Size: 3923 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Sun, 9 Feb 2020 22:48:18 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id r11so2005523wrq.10 for ; Sun, 09 Feb 2020 14:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H5h8f3WgoxP68Q6jLjqnQAtMRjQkjB73Uemeu2QcLQ8=; b=EkGmaN7Hdx2AlLEaPXhlhQGpfOEm+tHRBC/MIcGo5vf6FsWUktGo0FD0AviDcjdToY MbxjHvGKJSALR8264JXx5D9gmG8VvRL5LvPbc1wQKxK4TUE+lKnqXgaMCC1CoE0DF9v9 +guEHtFifFdPN9cRUFrwzo1IyNhnejLmnBCD5yDEKWcnhPOwjtgdbl9h/h+KIzDwXtwV Q3DSNJCoblTbQA4WGLzSthx6bhNzdpYNVCenOwUTwGOuX8t3wcLEsDKp26RzjZlcJmLH iVIePJDgrWXk3IeRfB0ZvskyL3Pmfcli/ZUAGXBRvkmhrkG/q7EOO4VE8YSkTrTQ6aku t+Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H5h8f3WgoxP68Q6jLjqnQAtMRjQkjB73Uemeu2QcLQ8=; b=bJlE888OsTLMuCURwDhbIPNmuyoyNvoeaLef3GtJgRBJXoQsgcyK2eHQ6yaRVi7js4 89kyU//X5eW1PHkSU+2ESrQLyYRSTpEQ2xRjZEJ4nd8/5IVjbcY9cvPNVpUBUxIDj+LN lczIu+kILiENnM3kJ90Wn9AVArWWgEujDk7oLR6l52BFTIYkd5OX24Pe6pBeP9BSXDX3 TsfHLKDUUtmqDo2+ZrW/VrgFtZKbwGYHmxJC3oHepR5SLyYRrHoxzZNvtBGzXnjrOqFt oijO+RhhHbSqsuPb4LEFqKBodXtgSi+fUBdBwek5JgMquZ+fS20ERFSBiHjJGmk9nAgf FABg== X-Gm-Message-State: APjAAAVhu8NzEBxmKkGs4VHAj6rgB16z0gANfBRsiJB+57AciQOylB3e dITTkipQCTPYPfN+TA16lpZqd5RydhXo X-Google-Smtp-Source: APXvYqzPnz2CPIG4fKhNxRmelMYzQbiLmYpx3/e93ZBy+WFI67OYTVo119MdAJS3TtEK6WC/eYc89w== X-Received: by 2002:a5d:494f:: with SMTP id r15mr13257456wrs.143.1581288497124; Sun, 09 Feb 2020 14:48:17 -0800 (PST) Received: from ninjahost.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id p15sm12708938wma.40.2020.02.09.14.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Feb 2020 14:48:16 -0800 (PST) From: Jules Irenge To: boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, akpm@linux-foundation.org, dvyukov@google.com, glider@google.com, aryabinin@virtuozzo.com, Jules Irenge Subject: [PATCH 09/11] kasan: add missing annotation for start_report() Date: Sun, 9 Feb 2020 22:48:07 +0000 Message-Id: <1eca01a2537e0500f4f31c335edfecf0a10bd294.1581282103.git.jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: <0/11> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.018903, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Sparse reports a warning at start_report() warning: context imbalance in start_report() - wrong count at exit The root cause is a missing annotation at start_report() Add the missing annotation __acquires(&report_lock) Signed-off-by: Jules Irenge Acked-by: Dmitry Vyukov --- mm/kasan/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 5ef9f24f566b..5451624c4e09 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -77,7 +77,7 @@ static void print_error_description(struct kasan_access_info *info) static DEFINE_SPINLOCK(report_lock); -static void start_report(unsigned long *flags) +static void start_report(unsigned long *flags) __acquires(&report_lock) { /* * Make sure we don't end up in loop. From patchwork Sun Feb 9 22:49:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 11372319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1459921 for ; Sun, 9 Feb 2020 22:49:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 83A0620838 for ; Sun, 9 Feb 2020 22:49:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dkdMkDwP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83A0620838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CC37B6B0010; Sun, 9 Feb 2020 17:49:15 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C99906B0032; Sun, 9 Feb 2020 17:49:15 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB0286B0036; Sun, 9 Feb 2020 17:49:15 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 9F41A6B0010 for ; Sun, 9 Feb 2020 17:49:15 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 55C60181AC9BF for ; Sun, 9 Feb 2020 22:49:15 +0000 (UTC) X-FDA: 76472081070.04.base94_50c232712204c X-Spam-Summary: 2,0,0,2f4c6c0c27ca675f,d41d8cd98f00b204,jbi.octave@gmail.com,:boqun.feng@gmail.com:linux-kernel@vger.kernel.org::kasan-dev@googlegroups.com:akpm@linux-foundation.org:dvyukov@google.com:glider@google.com:aryabinin@virtuozzo.com:jbi.octave@gmail.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1540:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3350:3865:3870:3871:4321:5007:6261:6653:7514:7875:9413:10004:11026:11473:11658:11914:12043:12291:12297:12438:12517:12519:12555:12679:12683:12895:13069:13161:13229:13311:13357:13894:14181:14384:14394:14687:14721:21080:21433:21444:21451:21627:21666:21987:30054,0,RBL:209.85.221.65:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:27,LUA_SUMMARY:none X-HE-Tag: base94_50c232712204c X-Filterd-Recvd-Size: 4038 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Sun, 9 Feb 2020 22:49:14 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id g3so4173198wrs.12 for ; Sun, 09 Feb 2020 14:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U5nFVCPFUZVGZ9tjWv0oFjWi+FTaJwKQRZfFYGfUUUg=; b=dkdMkDwPHQZKdjKUazNR6GkUXsK9lmR3gMf4pkpx2kZKucImYBGi9cfyx1VVT174f0 GAE9ssVObVEdRk5VfcljHgo3DYEn9E1Plcc5EHDO5CmcTVqoRiRO8pcu/aD+rmvHdj5H egDBesNa+cdTpBYdXCdmRunwscECV5h+ycph1QwFPoFwcnVWY4MDvuGprlHGQCbBHjzT WqaznMG2Vq0soLlnJXEagGCnGy6GbBVlAI1yKsT/RGZkD8sPkv44TUFRXHj+Vh3xZ8Y4 rEa7YRysRY1WvzPX2pLXe8dsl0Il7jIO+Vry9A9+4Fcs8Auc/ztpcyGj/kle2Nt1bQ2V 1ieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U5nFVCPFUZVGZ9tjWv0oFjWi+FTaJwKQRZfFYGfUUUg=; b=e3sgCsw3/Z4stNmYIefFgOEmIANRiTp7DzgSttYxOtTEtEd+YanKs36sh4DDjz5yKi 7MWdLiovbfeuGLMlleZPvaeVsxvNUmGEdzJ/OXtBSjm4sR/e6YKBoc5hxjgicjR4gzn5 loATAC9ZEc+Z2abQIOhjcQBnxLqA3/wpZ1oI0RddDuBbT2EPliGZxKyCdSf8jRzGUtz8 rTCeNGQdHfjjiqltdXy6US0Eb4/k5XvOdON9EHUOn/wPdir8gnHvzlkzm+UPfzopSZhb Gas7otYo99PYsAUmkdubszmMYvVopD/e712xSbONdsnBg6H2k2zlHM6xRr3djQTx7fE0 Wclg== X-Gm-Message-State: APjAAAUtYNuSwe7xdsxq4teszmoucgO8m+BKQq05FbRcCJC7JpfD1oVc aD+KiRqO0Rvt57mFCx71mw== X-Google-Smtp-Source: APXvYqzO+y20pyXml6UJKB8Yw0sld+pLD9TNTWs0/S2aD2ieM13bT5qAjumg6QWgRYsGwyKeaA/qGA== X-Received: by 2002:a5d:448c:: with SMTP id j12mr12604749wrq.125.1581288553707; Sun, 09 Feb 2020 14:49:13 -0800 (PST) Received: from ninjahost.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id k10sm13694884wrd.68.2020.02.09.14.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Feb 2020 14:49:13 -0800 (PST) From: Jules Irenge To: boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, akpm@linux-foundation.org, dvyukov@google.com, glider@google.com, aryabinin@virtuozzo.com, Jules Irenge Subject: [PATCH 10/11] kasan: add missing annotation for end_report() Date: Sun, 9 Feb 2020 22:49:04 +0000 Message-Id: <38efa7c3a66dd686be64d149e198f2fddc3e7383.1581282103.git.jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: <0/11> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Sparse reports a warning at end_report() warning: context imbalance in end_report() - unexpected lock The root cause is a missing annotation at end_report() Add the missing annotation __releases(&report_lock) Signed-off-by: Jules Irenge Acked-by: Dmitry Vyukov --- mm/kasan/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 5451624c4e09..8adaa4eaee31 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -87,7 +87,7 @@ static void start_report(unsigned long *flags) __acquires(&report_lock) pr_err("==================================================================\n"); } -static void end_report(unsigned long *flags) +static void end_report(unsigned long *flags) __releases(&report_lock) { pr_err("==================================================================\n"); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);