Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5988620ybc; Wed, 27 Nov 2019 12:59:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwJwMfD2l2r9WK8JDzMleAOAqoiuQY+qcz+slZse16ga7G6lRA5qUukwSoU2OF9HVMpA5x/ X-Received: by 2002:a17:906:1f98:: with SMTP id t24mr49301269ejr.143.1574888394347; Wed, 27 Nov 2019 12:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888394; cv=none; d=google.com; s=arc-20160816; b=DHJMrsQZPPZ9tZkpkgL6cL8pszshImvDHsJbwUsMhs7cPNGQJ1XupyKMnRPdWLi794 rE0qsRz/ZOyCoiug0heq63eGNvPg6ZUTY4UrpocfNcL0TVTYpnnd7MCX+neC3BbmphsE 3/4i+qdgI6EzRSt93lyiPE4oCUZ4/6XnE1jYt98F2ciC7qTMEWT6iQDemXdCVYf/aTA/ sTARj2IffdpJUBGLpYw6PSMUDxxpuBfVU1i3RkM26DuSuAUMIbMpJOqrFIx1cb/7yMoB fYDN+OPv7FVSap2iBUSXsq81wW00orQZAqyUs0q/wHDmh7vLVVyESENJC1Uiblqq8VTj Xy5w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TcG6yXwyDXprVeeP4L24WF6SF7cIxbqmnvkCN80wJbA=; b=Dl6klB7U/WPcAIqlpBNFT/mU/Eef6i+71dPgFhWZKMJirzVmbLOBLVO1JXMTlbhSL8 VFgphTqsw49Ivq0+yMmbTanNwughbNFf3SGeDUnkA4OqOaDbpqPB+9gkwW9UzSbQma3A wJCOpNuGnwBYIQLP7FIsFqYC9bpHamfWAL2lbDZbybWZUDr0q4WCu6iJUeTRUwL2Ta5+ UAPrrBzjjnAc1QXLInRpi8VurOj55uQ6YeVjDc7kbVqK+/TUaAm6k58rbCnSFqmsSjD/ GlOCXBidijWDEMjpMwh8P31w7PPurji/G+E9NTn2J1GCrl5Cx+aOYOxC2d9ur20XQdhH +2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hOwlJ3wz; 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 t27si12035949edd.304.2019.11.27.12.59.30; Wed, 27 Nov 2019 12:59:54 -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=hOwlJ3wz; 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 S1731073AbfK0U6j (ORCPT + 99 others); Wed, 27 Nov 2019 15:58:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:49956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727423AbfK0U6g (ORCPT ); Wed, 27 Nov 2019 15:58:36 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A5C79215B2; Wed, 27 Nov 2019 20:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888316; bh=kAqtKWCDZXsE9YhDOOmXD4HFJ72pPiA6mcNcJzI0bfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hOwlJ3wzz8UJ++fmE886uAOT5krvZlvTfkvYykiWjjE28M+ZwNnFfAPeMi8a6MAzw QInT732MFL6PCEmyl63ZjTMR0IK5OSmbfCAhrnRHT92TEeOY2PavjImQ5W2zdVPNE5 ea2SIi9HaRsNxelE/7LrcXVjTwJEvSmeBVGWnv1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kyeongdon Kim , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 086/306] net: fix warning in af_unix Date: Wed, 27 Nov 2019 21:28:56 +0100 Message-Id: <20191127203121.210938544@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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