Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3828057imm; Tue, 17 Jul 2018 10:58:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcYjuwD2kF+x7nc5YAF82apSVZVU8PMiAFCo+tuaxinNEpj34Q4/TSn3dgoGfglyoOonBiD X-Received: by 2002:a62:9683:: with SMTP id s3-v6mr1655699pfk.191.1531850302874; Tue, 17 Jul 2018 10:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531850302; cv=none; d=google.com; s=arc-20160816; b=INVuTLpgUJSrGSp15KbG8tKj4S/igt6l6BY+OZLOILPN2p5Q5rjNovIHQ07DOu5ZNo a9woEANSlaxNqsvXWy6RmenhZQz972EeTZ6CnvofivR365E7Vov2HyT63a7/cC+dmohU BczhUotx5tvuRNLmMPiMcUnuGijk5tDtA6h3raPQCPhcWFTVQcv1B2yEYqp1GY6d90jI pxY4eRWa+RMrkKxtiEmzmLoCMBVcbQFLVKc2aszqFk+IJCVETlnEf2jIRcZD0D3d1U7E FDXyMzttCQ1nRI3a3j4185Pt7YBSyxjxTWqzE/Ijaxq92QRN+cX5otE9h4xiNAcABUa1 Ifgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=bmAyHcDD/Xc2tb4UqnQcDKH5J0/3De7sxMrzFlHQ2p4=; b=VAWTQ7TJHJs628YgQ8GBVXDknhyni4eTkY5E1/spi4xWx0GZBYL0JYQwcH/Z+7EeLx qLxuGdXoUZ1rGP9sYB613aKSRUEtr+4FgMqZWdbgRRLuUMMu1ycLDv/7AellkWZ8GuIc h0Jtn2UXXIrfspceIhX/+wc5joBTAFri+jPvmTXU+Uxdjwc9+xfZ0uPS1Uo1wp4asoKb 6ou4dMyTZByBJ7cIWZlkz1pWqqFZDEJVDU/sQo0PM2BSrMd7c4j9/5ZSjHxHuWa+8oCW nrJK4i62Tyj5Ly5tQnQO0A0rq11xQ8d7iVDquhfYsBtO7KC8m5I44KAPy0JVAkgoaWJG blow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=dC4eICP3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si1390294plc.173.2018.07.17.10.58.06; Tue, 17 Jul 2018 10:58:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=dC4eICP3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729738AbeGQSbQ (ORCPT + 99 others); Tue, 17 Jul 2018 14:31:16 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:41403 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729708AbeGQSbQ (ORCPT ); Tue, 17 Jul 2018 14:31:16 -0400 Received: by mail-qt0-f196.google.com with SMTP id e19-v6so1669633qtp.8 for ; Tue, 17 Jul 2018 10:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=bmAyHcDD/Xc2tb4UqnQcDKH5J0/3De7sxMrzFlHQ2p4=; b=dC4eICP3eGZ+c5d22OChe8UTqQVXW5tJk0YYdB335OTslm4f/VEz5RZfSozX+gaava 7wVFqeedHKJ5GB0YtYiIaBpzEtu4QsoMTNqoHXqMX/lM5vBE1CyIV48lhaC3iytcl4BB dlcOm5jX6c6qy+Ne/KIznOclHevgcYX/I59gDfiFDRyQIkpoUBvhks+2BIHTHGlf6P0M kKVpNb9Y2qmItJtezrQkM/QxABb1Zm0nXGNa87ce6y5YHcRQVx+1kG5fxj17PCkDQRXG Uet+4aPdpMvyvFrXz19QuAFJ8+7tg0+UgIpY3UeIHu/OPMDhV/sDllbDXxis39xzLW4k /oHw== 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:organization:mime-version:content-transfer-encoding; bh=bmAyHcDD/Xc2tb4UqnQcDKH5J0/3De7sxMrzFlHQ2p4=; b=DNlgsJDCE9MZKLSkaVVhxbGO+jiv9lVJWiazy0jliNDc7zEU1XNxi/CvCDu1dA4/tS qyW4Oaf9/PJjLUffPF3yBXwjchTz70JMuvCIHo5CU3vQKo8oEEhAp2+cMQyJmqIXmnVF SAnx4U6jzIH6EiI9v7WrexMK2fkoZix7nKnOZX2xmf/XoJKczxE/gUGbB9KFhV91NQ15 zWKJiExvp2fn7eAsyOUfvpXFu/d/U1hlqO0/Qh4lrf3k3sheUnhAJz3zpXKuSUQoBoAb SU1MCToA+A/EreJpXqYqT7gVwGyFyusXHq7WH4RDNgcmK12s47T4TKZqhKCzsDAvMaEn xFyw== X-Gm-Message-State: AOUpUlHGAzAhYBh0YcOaMDm7PWIf+zGRbZRD5BRKpgtw4XuaupboVteY Ol+cwzmm/utIfbj2Lg/oVJdX+A== X-Received: by 2002:ac8:234f:: with SMTP id b15-v6mr2634886qtb.336.1531850249641; Tue, 17 Jul 2018 10:57:29 -0700 (PDT) Received: from cakuba.lan ([75.53.12.129]) by smtp.gmail.com with ESMTPSA id m12-v6sm1411170qkl.54.2018.07.17.10.57.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Jul 2018 10:57:29 -0700 (PDT) Date: Tue, 17 Jul 2018 10:57:25 -0700 From: Jakub Kicinski To: "Gustavo A. R. Silva" Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtnetlink: fix uninitialized variable Message-ID: <20180717105725.5cb8a405@cakuba.lan> In-Reply-To: <20180717134314.GA31127@embeddedor.com> References: <20180717134314.GA31127@embeddedor.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Jul 2018 08:43:14 -0500, Gustavo A. R. Silva wrote: > Currently, there are execution paths in which variable err is > returned without being properly initialized previously: > > 1417 if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_SKB, > 1418 IFLA_XDP_SKB_PROG_ID, rtnl_xdp_prog_skb)) > 1419 goto err_cancel; > 1420 if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_DRV, > 1421 IFLA_XDP_DRV_PROG_ID, rtnl_xdp_prog_drv)) > 1422 goto err_cancel; > 1423 if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_HW, > 1424 IFLA_XDP_HW_PROG_ID, rtnl_xdp_prog_hw)) > 1425 goto err_cancel; > > Fix this by initializing variable err to -EMSGSIZE. > > Addresses-Coverity-ID: 1471831 ("Uninitialized scalar variable") > Fixes: a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment") > Signed-off-by: Gustavo A. R. Silva Looks like duplicate of: http://patchwork.ozlabs.org/patch/944662/ Strage GCC doesn't catch this even with W=1, the code is fairly straightforward :S