From nobody Thu Oct 30 16:32:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500921694249372.0742391446315; Mon, 24 Jul 2017 11:41:34 -0700 (PDT) Received: from localhost ([::1]:56380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZiIO-0002OX-IW for importer@patchew.org; Mon, 24 Jul 2017 14:41:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZi5x-00006e-DA for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:28:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZi5w-0004q7-Gd for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:28:41 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:34194) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZi5w-0004pz-Cy; Mon, 24 Jul 2017 14:28:40 -0400 Received: by mail-qt0-x244.google.com with SMTP id i19so2260718qte.1; Mon, 24 Jul 2017 11:28:40 -0700 (PDT) Received: from yoga.offpageads.com ([138.117.48.223]) by smtp.gmail.com with ESMTPSA id t57sm9033799qtt.18.2017.07.24.11.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 11:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HeLvrmgwsCLM/mAlPUrAzgq/PIseiLcehgwY5T3ei10=; b=KK12STfJDh+fBiPb1g3m6jlBPdFKv6Vs86cbGSzhi9toc1Pj+hAsE+F5igYxtEczkO eb7b9QQ4skcH5TH1jlCgenYdAuvz8BT2ejQ2qAsWOeyDK+MS57oIS/RdrJj/ChgtQHs5 9u697kY6OrhVnjlqaZtKLDvf6WU/XuNSAF1WvGsLiNwFf9jo/p024Ojjoqg1IFvWJ8lL tzzn1jKQcM8i/JGofROWj5ymRbcQ3Nd6iCDwPYltyVWUELBjgeQjCsxBeHLoY6Z4gFTv NDWrfz0nKKg6zprouebim7ddatGoicnanpu3nh0LBgge+DooLEcnKAEFseSrPX0Kf4cF pkQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HeLvrmgwsCLM/mAlPUrAzgq/PIseiLcehgwY5T3ei10=; b=ZDuZaDZtwqsShlbnKBoL8v8bXKqYvFv9PaKD5D4Xl3WLbAsuTzbkGu72/De0yRjhil L7V1WxlfTZo3dvLzPhB/Y0U/VYLTVv5LhA3XfJgObQ7z8NkYGhlN5y+TyCDYXO2uCLPN msT8Y7GWk5NiSWY4IhG8J5T8VePHYwsjhikxvNUhOYaC0zTALbNl69Lt/lhYYx8ZwjAZ nK5XyOCgCCGwTpjW1+1i5Eo/9Q0kuRPrsl01LFziM8ZvqQ821b6yo9ZC+Kk7lyNmOk17 pyo/+jxHoq85k5lhUl4Y64H1pP1nh79up9gL/wLSLoh+cdoodoG0FQWIiGZLvhguqnNV LRuQ== X-Gm-Message-State: AIVw112tf+QUAVjNoDaMYrvGZ4RQ39qLqJnNlolPpsWct/3I1ZzM2WeA asDBphDvIDLglQlVE5I= X-Received: by 10.237.53.44 with SMTP id a41mr11358227qte.231.1500920919969; Mon, 24 Jul 2017 11:28:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Dmitry Fleytman , Jason Wang Date: Mon, 24 Jul 2017 15:27:26 -0300 Message-Id: <20170724182751.18261-11-f4bug@amsat.org> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724182751.18261-1-f4bug@amsat.org> References: <20170724182751.18261-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH for 2.10 10/35] net/eth: fix incorrect check of iov_to_buf() return value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 So we have sizeof(struct in6_address) !=3D sizeof(uintptr_t) and Clang > Coverity on this, see 4555ca6816c :) net/eth.c:426:30: warning: The code calls sizeof() on a pointer type. This = can produce an unexpected result return bytes_read =3D=3D sizeof(dst_addr); ^ ~~~~~~~~~~ net/eth.c:475:34: warning: The code calls sizeof() on a pointer type. This = can produce an unexpected result return bytes_read =3D=3D sizeof(src_addr); ^ ~~~~~~~~~~ Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dmitry Fleytman --- net/eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/eth.c b/net/eth.c index 5b9ba26a56..ae5d881aae 100644 --- a/net/eth.c +++ b/net/eth.c @@ -423,7 +423,7 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int p= kt_frags, rthdr_offset + sizeof(*ext_hdr), dst_addr, sizeof(*dst_addr)); =20 - return bytes_read =3D=3D sizeof(dst_addr); + return bytes_read =3D=3D sizeof(*dst_addr); } =20 return false; @@ -472,7 +472,7 @@ _eth_get_rss_ex_src_addr(const struct iovec *pkt, int p= kt_frags, opt_offset + sizeof(opthdr), src_addr, sizeof(*src_addr)); =20 - return bytes_read =3D=3D sizeof(src_addr); + return bytes_read =3D=3D sizeof(*src_addr); } =20 opt_offset +=3D optlen; --=20 2.13.3