From patchwork Wed Mar 25 16:12:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11458275 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 951A8913 for ; Wed, 25 Mar 2020 16:14:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 62EA820740 for ; Wed, 25 Mar 2020 16:14:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CuNjJkr2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62EA820740 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3383A6B009A; Wed, 25 Mar 2020 12:14:07 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 272B36B009B; Wed, 25 Mar 2020 12:14:07 -0400 (EDT) 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 1B0096B009C; Wed, 25 Mar 2020 12:14:07 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id E5DD96B009A for ; Wed, 25 Mar 2020 12:14:06 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BDD5A1819B39A for ; Wed, 25 Mar 2020 16:14:06 +0000 (UTC) X-FDA: 76634381292.21.talk18_7b2a4a9dd9159 X-Spam-Summary: 13,1.2,0,41572e7ed7db1bb0,d41d8cd98f00b204,3tyn7xgykcdwejgbcpemmejc.amkjglsv-kkityai.mpe@flex--glider.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1535:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:3138:3139:3140:3141:3142:3152:3352:3698:3865:3867:4250:4321:5007:6120:6261:6653:6742:6743:7875:7901:8660:9707:9969:10008:10400:11026:11232:11658:11914:12043:12048:12296:12297:12438:12555:12895:13069:13148:13230:13255:13311:13357:13846:14096:14097:14181:14394:14659:14721:21080:21365:21444:21451:21627:21740:21990:30054:30064:30070,0,RBL:209.85.221.201:@flex--glider.bounces.google.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:1:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: talk18_7b2a4a9dd9159 X-Filterd-Recvd-Size: 5128 Received: from mail-vk1-f201.google.com (mail-vk1-f201.google.com [209.85.221.201]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 16:14:06 +0000 (UTC) Received: by mail-vk1-f201.google.com with SMTP id v203so965036vkd.13 for ; Wed, 25 Mar 2020 09:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=U5cjGukdLuhYwS9bq9faqk2UFsQ/bmDivVgoQTLdZqI=; b=CuNjJkr2f1aTmEfzCyEKnsBRbsikVTED73pIwYa9DkVfhfoNSDA2t9b52mTfjI+rwH 3m/wjZHvh9cgdZ3omyzPh6C/eZeLfM9yGAAHjyUyw0FKLvskNV0sNPCRh0FRg7IxsCEj eSI5NAEMz8momLDr2vP9H8RdGzq7XxECvA1A9jgiaa1E0E18stkVp7l3ctjtIGQJU2N+ N4BmMsL87L+Tsfty/z8q7eJlMUH9uaoOOWqO83WDyGFAJGMKJFt7Gi1kg3Io4pF0mOUr W4DMiTl7+KjAAv+1CorDrAnG/OCtOLW2XWYOjrwsT66mkbrE8Rfua/aAPw+ZKgbHVF+9 nx/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=U5cjGukdLuhYwS9bq9faqk2UFsQ/bmDivVgoQTLdZqI=; b=fK/NBMx6Crpd32KxkPOfsA8jWnclmSdklmVAzIsckfW++26jxzXYr+RAHnfmEXJ+K3 EL4iaSTsANNyY7LiHyVIUqcjSybH9tui1zvAsVJLuEalHGiZoWJ+O0cND3N+KWjiCZXQ f21YI7nBorXalQ89Mr5ya8srOliVe0iOuCPb45Dq+iMpnXLd250ImzqQLWZHBLxQlees ZHX53w5JwheMuNkudvfVW/c8cBobeHn4qG9v2O/zXG21i8ie97ZaL7L7VcIQ3BWpF3fR GsELlxhT3+ijsGmMfOdWa8LL2CTd3B903JjSlWohIka53pbP/GiqCjM3HOH13XyzKz1l hNfA== X-Gm-Message-State: ANhLgQ2AOmDZzng0UXduR2mFwxprkLmbQyUaSkLG/doKUkO7y/Yu7GPI jV98hfm5bqFPaHLbaGa7wgBqvtVBYxM= X-Google-Smtp-Source: ADFU+vvaimTYaR4nw4BaEX/6j1MKfUBOBp6jI6ParG4it9YusLacbdmIkauoz+NcvtmvWlFSyLEgqLLfAo4= X-Received: by 2002:a1f:d084:: with SMTP id h126mr2842641vkg.25.1585152845554; Wed, 25 Mar 2020 09:14:05 -0700 (PDT) Date: Wed, 25 Mar 2020 17:12:33 +0100 In-Reply-To: <20200325161249.55095-1-glider@google.com> Message-Id: <20200325161249.55095-23-glider@google.com> Mime-Version: 1.0 References: <20200325161249.55095-1-glider@google.com> X-Mailer: git-send-email 2.25.1.696.g5e7596f4ac-goog Subject: [PATCH v5 22/38] kmsan: net: check the value of skb before sending it to the network From: glider@google.com To: Andrew Morton , Greg Kroah-Hartman , Eric Dumazet , Wolfram Sang , Petr Mladek , Vegard Nossum , Dmitry Vyukov , Marco Elver , Andrey Konovalov , linux-mm@kvack.org Cc: glider@google.com, viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, aryabinin@virtuozzo.com, luto@kernel.org, ard.biesheuvel@linaro.org, arnd@arndb.de, hch@infradead.org, hch@lst.de, darrick.wong@oracle.com, davem@davemloft.net, dmitry.torokhov@gmail.com, ebiggers@google.com, ericvh@gmail.com, harry.wentland@amd.com, herbert@gondor.apana.org.au, iii@linux.ibm.com, mingo@elte.hu, jasowang@redhat.com, axboe@kernel.dk, m.szyprowski@samsung.com, mark.rutland@arm.com, martin.petersen@oracle.com, schwidefsky@de.ibm.com, willy@infradead.org, mst@redhat.com, mhocko@suse.com, monstr@monstr.eu, cai@lca.pw, rdunlap@infradead.org, robin.murphy@arm.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, tiwai@suse.com, tytso@mit.edu, tglx@linutronix.de, gor@linux.ibm.com X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Calling kmsan_check_skb() lets KMSAN check the bytes to be transferred over the network for being initialized. Signed-off-by: Alexander Potapenko To: Alexander Potapenko Cc: Andrew Morton Cc: Greg Kroah-Hartman Cc: Eric Dumazet Cc: Wolfram Sang Cc: Petr Mladek Cc: Vegard Nossum Cc: Dmitry Vyukov Cc: Marco Elver Cc: Andrey Konovalov Cc: linux-mm@kvack.org --- This patch was previously called "kmsan: call KMSAN hooks where needed" v4: - split this patch away Change-Id: Iff48409dc50341d59e355ce3ec11d4722f0799e2 --- net/sched/sch_generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 2efd5b61acef1..4b2cc309bb1e3 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -654,6 +655,7 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) } else { WRITE_ONCE(qdisc->empty, true); } + kmsan_check_skb(skb); return skb; }