Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3645454pxb; Mon, 24 Jan 2022 14:18:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZzNDCOatScTWCWkZSm+iTbxuSm2+Q98Ktea+AmqsbYO5GoH/Nc6AVEms97BiLWvNewhDO X-Received: by 2002:a17:903:2311:b0:14b:63d5:3b69 with SMTP id d17-20020a170903231100b0014b63d53b69mr3292729plh.31.1643062682587; Mon, 24 Jan 2022 14:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062682; cv=none; d=google.com; s=arc-20160816; b=F7LVB7St8w0Jfp5QwPukl11lkTyhLdJay7Um+P+ct2HEG8lquGyhM39VG5D4CHEM2B PDR+1WscUxTwQkDKLRSYRTENt2PhX7ZJ1yHcHYwmyMLmPUjS93Z/Vlcnt/hFh732Op+J pjJCQ0Qkml4/XcJONt4uBcD1+mietktv110PNxuqWNaBGqD8ywtSDkPXE3mBl2N5IjrY 6/CC0SDecMyBsWRc0sUZBXIH3FRHbLMk3ioItY63P1mD7Bf+uD5IvsFnABdleQIQsRpD 4cduDo2bemaj1X4Xr6lCEnneQR3hOtn5bcpgBRmal6ZXJ9UDsjTs5QcUn3Qhgo+rlVbR To6Q== 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=owsgnbJD0cJJ/NeLOIGRi7R4b+plHtBf2ruy1zzAUifxWVRDo0jnYfYS0nsemgSeeu FOilor32b8xZMEoe0xE9P9WfhIiIZc5yZyPP+72HAEEE6dwQfFMK7ZXqbE8E0VE1sAkv lTfB28KLq8dfny64uNElwmG7Y1pY7GvVY1obMWcPbTqzW5rZfEqlksTGXNFgVn9hbLSW VwUWKlpaUNregs6/+l2XbS/EQ+2ewOwubPTMi8orQP9Tyal4pCQuSaLPAl1l1iJgtfuk 5qE9+HlkmXc737nrSltmEK+8YCpLfU4IU37WW2WJRG2XXAyvKnuG10k4+wktZ++ZjOIT xTrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yIA8l46U; 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 g68si14421683pgc.215.2022.01.24.14.17.44; Mon, 24 Jan 2022 14:18:02 -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=yIA8l46U; 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 S1379902AbiAXWHu (ORCPT + 99 others); Mon, 24 Jan 2022 17:07:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1449134AbiAXVO5 (ORCPT ); Mon, 24 Jan 2022 16:14:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B72C06E01F; Mon, 24 Jan 2022 12:11:24 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BD92D612FC; Mon, 24 Jan 2022 20:11:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F3FCC340E5; Mon, 24 Jan 2022 20:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055083; bh=l5GlaMQWhaM9tQ49nzfGO/tk9HkHi8Ff5Xjw5ttxKI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yIA8l46UaBzHaBr/1pa11keJhtRnoLzAbJ7OluIZclsVfBlHGulwV2k8DTCqCSdec dUND3KHFp6C0KMyeMnW+E01VqYZTRcR3api5SLPP058FnuokxnblZU3sRC4PtnAHqc TPaUexmNs88HIjXvwS1bj2KQ+uSuRgWXhSrTJ+Ik= 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.15 034/846] ksmbd: uninitialized variable in create_socket() Date: Mon, 24 Jan 2022 19:32:31 +0100 Message-Id: <20220124184102.124037410@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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; }