Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3431692pxv; Mon, 26 Jul 2021 04:13:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR+5rXjBbAONYPDCDL3ynZ2tbAjiLgbFA3iY8LvLw/cFef42idU7aWKqkZcGaif/cfp0tt X-Received: by 2002:a17:906:5290:: with SMTP id c16mr4015962ejm.163.1627298017819; Mon, 26 Jul 2021 04:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627298017; cv=none; d=google.com; s=arc-20160816; b=KKDNC1n6jheZNrGINpKWixiXlfQiVnStLY52LI3KPq4YYm4q4xDPzWLiB2mdm75Tzs uJC1rJkc2N3n6cl8HoYeOdhCsIvJf0pKC0vQ55MAKWGrFgsQpmYgMobigmNw3WtvN6+N JJ6gCQ7nR/1OkRcCFGBZ64mGEP7KlJvgqWGM07CdqpoiNml5QqHry5IvYFO+/i62sxPX Fa+Dtkt0lopBfw4lRJDFybqAvkPqLMeQPZqSbmI2lp/IDqNjkbkWPGYMXdzdPYBzkSQJ p/phSL3ZmCe3SPoH083y4U6vul4/Q4UBmXz7nHnzuLuAjJ+Vyfyyy0l/v0RlzSfv1PMo okvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=n6bJSXqmcuKJfAgVqQXN6el/oURcZ0UU9SDbTUMNCAM=; b=ygt0nyVf9xe/l1urlWIneF3Mj4Q855czFHjxZHKONru23ieruH2nh5cM5ABvkXCuhK EV2xMviNSe2mKRHYxVcN+wxQRFzVl7nZlMtVuYAZhU7rthrQkGu7F/ZiQn23rxYneuhd APwUGgqT9Y6b+7MMZ1jhyUdEjGFJnVMT97BSCoUh8IYq7UELtKpAW5KVJxfoC8vFwVMW yFOKtgYyq/2HKYNhBsoTlNg5Gx4vyz+PU3OZ2mPzp1mBEbC2sqJ2EJjwtfx2iYlmB1qZ JrHux4oi4VDMVDXfEGI3ZmbCTjLk0Qqy2wKh8H1KaqDgPANMkSXGp7i2zgYWHPbZR+YS WDCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g0xMMZ/K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o20si36863ejm.682.2021.07.26.04.13.14; Mon, 26 Jul 2021 04:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g0xMMZ/K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233194AbhGZKbR (ORCPT + 99 others); Mon, 26 Jul 2021 06:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232375AbhGZKbR (ORCPT ); Mon, 26 Jul 2021 06:31:17 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0493C061757; Mon, 26 Jul 2021 04:11:45 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id r17so14750758lfe.2; Mon, 26 Jul 2021 04:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n6bJSXqmcuKJfAgVqQXN6el/oURcZ0UU9SDbTUMNCAM=; b=g0xMMZ/KPNpXWtAf3Vg1zFQ0eLd6TQvlY3jGoDtGSvZsBNagZf8KHfo3ktl6kgkENs OMCazNSxkroLdVQONm97uoPloWGucMNkqcQ3MUaNVv6oAO7JRsI8jx+IB7reM2R4e5+l 7OxQsX4wUVvpU5ndlams6jhHu+YyMtRCFEn7qWupmUz9IleoQvxRtALdr9Z++fiaxGEd Uz1b+INwfoyN9B6y2vbuAVma+AYt0kyk91IaprJIRS7qokct3U15VuNL/dxP3Eeftixg Av8hLhGU66i8wMkQg3NamgOLeCcTgVNdZGlBdfWI5CgnQnS1eeVnwfEEIy7X5VRouUDF eAaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n6bJSXqmcuKJfAgVqQXN6el/oURcZ0UU9SDbTUMNCAM=; b=COQt/Il8QFhDmtzVJQ4tx09ICdujUMCyZLI/OiCqunRfbJ/cSrMguImwKuxrZRSz+P 6nwS5Wcs8q+Ritmns+lvnbj7jeXrzjKaYr4YcCW9bS3pL/vWV0WO9cHsHXgwadGr+wYe LKCZ5i2P+/4CKuC1OFd86x0+GngZ6LaDBvqPm6qha7VvV0dm/gbOkYKl0xX+boAlqZcq gixpwUxp5cKUNWwOFYxHyvWEri/HG4bv1ptOr466E0OsWpfnVzTiDc/f4ZjKzE4s88aY YBB59CbwbmA8J6JdWDOIVGqRg7yP0CXq56NaG2SDFBN9CN6KkgkYbhnsOxGYY7cG8SDE nKRQ== X-Gm-Message-State: AOAM532pRju4p17zOz8U5qSEIABcFfzrbR1vAssOED9UCzV9LwMsErfm z1LgAN9K9CchUdDx9hD6UOk= X-Received: by 2002:ac2:52b4:: with SMTP id r20mr13193991lfm.104.1627297903256; Mon, 26 Jul 2021 04:11:43 -0700 (PDT) Received: from localhost.localdomain ([46.61.204.59]) by smtp.gmail.com with ESMTPSA id bt12sm2450642lfb.14.2021.07.26.04.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 04:11:43 -0700 (PDT) Date: Mon, 26 Jul 2021 14:11:40 +0300 From: Pavel Skripkin To: paul@paul-moore.com, davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+cdd51ee2e6b0b2e18c0d@syzkaller.appspotmail.com Subject: Re: [PATCH 1/2] net: cipso: fix warnings in netlbl_cipsov4_add_std Message-ID: <20210726141140.24e8db78@gmail.com> In-Reply-To: <53de0ccd1aa3fffa6bce2a2ae7a5ca07e0af6d3a.1625900431.git.paskripkin@gmail.com> References: <53de0ccd1aa3fffa6bce2a2ae7a5ca07e0af6d3a.1625900431.git.paskripkin@gmail.com> X-Mailer: Claws Mail 3.17.8git77 (GTK+ 2.24.33; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Jul 2021 10:03:13 +0300 Pavel Skripkin wrote: > Syzbot reported warning in netlbl_cipsov4_add(). The > problem was in too big doi_def->map.std->lvl.local_size > passed to kcalloc(). Since this value comes from userpace there is > no need to warn if value is not correct. > > The same problem may occur with other kcalloc() calls in > this function, so, I've added __GFP_NOWARN flag to all > kcalloc() calls there. > > Reported-and-tested-by: > syzbot+cdd51ee2e6b0b2e18c0d@syzkaller.appspotmail.com Fixes: > 96cb8e3313c7 ("[NetLabel]: CIPSOv4 and Unlabeled packet integration") > Signed-off-by: Pavel Skripkin --- > net/netlabel/netlabel_cipso_v4.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/net/netlabel/netlabel_cipso_v4.c > b/net/netlabel/netlabel_cipso_v4.c index 4f50a64315cf..50f40943c815 > 100644 --- a/net/netlabel/netlabel_cipso_v4.c > +++ b/net/netlabel/netlabel_cipso_v4.c > @@ -187,14 +187,14 @@ static int netlbl_cipsov4_add_std(struct > genl_info *info, } > doi_def->map.std->lvl.local = > kcalloc(doi_def->map.std->lvl.local_size, sizeof(u32), > - GFP_KERNEL); > + GFP_KERNEL | > __GFP_NOWARN); if (doi_def->map.std->lvl.local == NULL) { > ret_val = -ENOMEM; > goto add_std_failure; > } > doi_def->map.std->lvl.cipso = > kcalloc(doi_def->map.std->lvl.cipso_size, sizeof(u32), > - GFP_KERNEL); > + GFP_KERNEL | > __GFP_NOWARN); if (doi_def->map.std->lvl.cipso == NULL) { > ret_val = -ENOMEM; > goto add_std_failure; > @@ -263,7 +263,7 @@ static int netlbl_cipsov4_add_std(struct > genl_info *info, doi_def->map.std->cat.local = kcalloc( > doi_def->map.std->cat.local_size, > sizeof(u32), > - GFP_KERNEL); > + GFP_KERNEL | > __GFP_NOWARN); if (doi_def->map.std->cat.local == NULL) { > ret_val = -ENOMEM; > goto add_std_failure; > @@ -271,7 +271,7 @@ static int netlbl_cipsov4_add_std(struct > genl_info *info, doi_def->map.std->cat.cipso = kcalloc( > doi_def->map.std->cat.cipso_size, > sizeof(u32), > - GFP_KERNEL); > + GFP_KERNEL | > __GFP_NOWARN); if (doi_def->map.std->cat.cipso == NULL) { > ret_val = -ENOMEM; > goto add_std_failure; Hi, net developers! Is this patch merged somewhere? I've checked net tree and Paul Moore tree on https://git.kernel.org/, but didn't find it. Did I miss it somewhere? If not, it's just a gentle ping :) Btw: maybe I should send it as separete patch, since 2/2 in this series is invalid as already in-tree? With regards, Pavel Skripkin