Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3691045pxb; Mon, 24 Jan 2022 15:29:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKQupGXyxmc0FU55oHr3wBfuBCHbh8LKf5vFeYDfAaBHr/zepFmmB/yT6WfycwNsZovnu6 X-Received: by 2002:a17:903:2403:b0:14a:70dc:1593 with SMTP id e3-20020a170903240300b0014a70dc1593mr16536229plo.145.1643066954735; Mon, 24 Jan 2022 15:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066954; cv=none; d=google.com; s=arc-20160816; b=swFYpYQ1rkfIWW01PMb6CJOf3eKbNYtGN2udCFadvkqnFjwk0FyeIl3fSEHVN3ApCB 1M3dkLgix6oodYxJ6kzkaLneOgBLsKO6IPar27Z2AoNIK5XOWOY6IVaZfa/ew0xXvOUQ //mmS0GyFZPbClDWk54hPHRB9XOz2NnaFu75NT5DiO0J6q2qbdoaiE5zcYY9D07CJ1Ic AmBwGE+AmXmp8TJWIxUUzEEuF6Er3tmyKimXD4kkcXt0KQHAbnuWyVZDl6O0CbcQL6bP XDngsC8mBDKWUmk9xVLw8YV0Y4HFR7Eb35W34Z+6X69/CiUQ/aw0DicZzhQ+QL7dYcL0 Doug== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jLdU/4I00QmkGswv4u8kRBSSRh1JGAT5K1zIAxJVey8=; b=Cd5w+YuTWYEPc2fSR9y6RPHMNYBUmkVTj+nh9+2RZD2rzNkuJtX1kYNX0reBLJgaL7 YimfB3NCRaoEQUUV6XRByw7KOJEgrW9WdOHZmy14Ql0/5clDmanxYtPGIn/cLKKNQDyE djD4kUE8Xm31LZQ+9POgbxnd9XDvJMBV8yVoaZyDNSyjSBLYrQ09hwuFoZjwuxkbJJwm iz7V3qU2wv+RkIkByWSqsUSI5qRCDTvuu4OfOv0Nb/LWUxCJ34/XF3o8lwBB1D+Adq0s O8+/B7zD0N/XUxC8ZWzPMSLVmGpp0keS/NLy2TtOgL9DZuFxOexOY53OdpjeW/lIYR8i Jcag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fJzvl0d0; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d63si9744268pgc.592.2022.01.24.15.29.01; Mon, 24 Jan 2022 15:29:14 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=fJzvl0d0; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1848160AbiAXXVx (ORCPT + 99 others); Mon, 24 Jan 2022 18:21:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1586030AbiAXWZd (ORCPT ); Mon, 24 Jan 2022 17:25:33 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38DF5C035454; Mon, 24 Jan 2022 12:54:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EA3E2B812A4; Mon, 24 Jan 2022 20:54:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DD6AC340E5; Mon, 24 Jan 2022 20:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057656; bh=l5GlaMQWhaM9tQ49nzfGO/tk9HkHi8Ff5Xjw5ttxKI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fJzvl0d08y0/dI07MyYmLjb44i7kFuQT52ieEtYkowwFppM+k6/hrsgqSjajaR72z xDJn0dgnWdX+Ww33QGm6EMxSW+0VN+ICCsf3oXkZO4sIXvYChOcx1DltJOLWoadTPQ Owv3/PMEPGe6Fhb3/BkZHohc09KKtXyJ8GVuK2Ts= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Namjae Jeon , Steve French Subject: [PATCH 5.16 0036/1039] ksmbd: uninitialized variable in create_socket() Date: Mon, 24 Jan 2022 19:30:25 +0100 Message-Id: <20220124184126.345329838@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit b207602fb04537cb21ac38fabd7577eca2fa05ae upstream. The "ksmbd_socket" variable is not initialized on this error path. Cc: stable@vger.kernel.org Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers") Signed-off-by: Dan Carpenter Acked-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/ksmbd/transport_tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ksmbd/transport_tcp.c +++ b/fs/ksmbd/transport_tcp.c @@ -404,7 +404,7 @@ static int create_socket(struct interfac &ksmbd_socket); if (ret) { pr_err("Can't create socket for ipv4: %d\n", ret); - goto out_error; + goto out_clear; } sin.sin_family = PF_INET; @@ -462,6 +462,7 @@ static int create_socket(struct interfac out_error: tcp_destroy_socket(ksmbd_socket); +out_clear: iface->ksmbd_socket = NULL; return ret; }