Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp732443ybc; Sat, 16 Nov 2019 07:44:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxq4VZku+TvZbARqhRwTh52ZKeBZ/QUK9SdsryTuoPUPFbvCQHJrVnB3knfKM7fyE5EI4i6 X-Received: by 2002:a17:906:594a:: with SMTP id g10mr10784221ejr.164.1573919087635; Sat, 16 Nov 2019 07:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919087; cv=none; d=google.com; s=arc-20160816; b=yefCEWIZEvBBfc05sxcBiBmfvjbqNMXs7m7/CF381E8yionUMffk2QqolU1mYYCXKz kYk4vYCI71rCIKOa82Fd3F98WwePoMAsoQPLTm0Ek0SdcCjim5lEYGYjtR3SFAfaVpXh zraGxDggVzr3IiytYHak10dynhCpUezUUaMqnVpsTuIR7w1ifw6VQF+t14ar8NP2MAZa rvuyEeLCkmZzVOXgIGdl7SqeN9jbb6y5y+5ZXW6EtCT8sll9QIxlxwEjj1VDO72xI4/P d7jXs5kZ2cR6tu0MKGmAcHGQKIYSRWwVCs+cVf6ancLC4KGq1Dq2Iue+zXk1VdHAeUd7 eWvA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TcG6yXwyDXprVeeP4L24WF6SF7cIxbqmnvkCN80wJbA=; b=LTfqcVc0Raho1RT0OYkXd8p+5PxTQ98U3KeAIXzNT+OS01tHTqx45dr8ncytkH56/u 6iE1Hfhh59jla+zk+Q7rkF8XLJ7gyfUgOh+y8FC7SOZSdSfAQZuNVuF+qDXTlv4O2ErA OV/9x5jDZYEo7vREXl/G89H5JrdL5MobxDGcwW9ju+Vk8TLy+fqtQd6WYADjSwsQ3BZE 5flc+XWcy2A5Y1GdTMdwxXJ52umbtfeSrhGFAdir6IiKiO1B/4+XdRcF1lywkZ6blX5B GHos9yDBb5K5AazRvSTU1woGBWHI3yuFfLkHEZx4t3zcG/R5V17fBTZQ1cD1a8oTuFAZ 6tlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qCZgFQ+X; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si8078628edc.451.2019.11.16.07.44.22; Sat, 16 Nov 2019 07:44:47 -0800 (PST) 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=@kernel.org header.s=default header.b=qCZgFQ+X; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728361AbfKPPmg (ORCPT + 99 others); Sat, 16 Nov 2019 10:42:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:46034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbfKPPm1 (ORCPT ); Sat, 16 Nov 2019 10:42:27 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC40420855; Sat, 16 Nov 2019 15:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918946; bh=kAqtKWCDZXsE9YhDOOmXD4HFJ72pPiA6mcNcJzI0bfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qCZgFQ+XKbEMYZHrNdoAFqrrMi5cFtFN7KdOz5TmckBXIpAQxi8pYoqizCrGxe7Ja phBFGNOCQFFsJdkqR/qU4JUC3aaxGrLA39EvB7V0KrSRmZ8ax3DLe6q6jI06u3Xwar ECqh6QRCmLLQFBr7zIgU9Nu2ZXntf6OkzItKvSaw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kyeongdon Kim , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 067/237] net: fix warning in af_unix Date: Sat, 16 Nov 2019 10:38:22 -0500 Message-Id: <20191116154113.7417-67-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kyeongdon Kim [ Upstream commit 33c4368ee2589c165aebd8d388cbd91e9adb9688 ] This fixes the "'hash' may be used uninitialized in this function" net/unix/af_unix.c:1041:20: warning: 'hash' may be used uninitialized in this function [-Wmaybe-uninitialized] addr->hash = hash ^ sk->sk_type; Signed-off-by: Kyeongdon Kim Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/unix/af_unix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 231b6c032d2c3..d2d6ff0c6265d 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -225,6 +225,8 @@ static inline void unix_release_addr(struct unix_address *addr) static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned int *hashp) { + *hashp = 0; + if (len <= sizeof(short) || len > sizeof(*sunaddr)) return -EINVAL; if (!sunaddr || sunaddr->sun_family != AF_UNIX) -- 2.20.1