From patchwork Wed Nov 16 14:10:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anastasia Belova X-Patchwork-Id: 21081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp170088wru; Wed, 16 Nov 2022 06:28:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf6pe8T3A4ZgiGujem0NnUfPQEEXGMR9yR/VOaaO8+a2DZOaMbfCUU7c3lRRp2llNHjenC1r X-Received: by 2002:a17:90b:154e:b0:216:bd62:8e69 with SMTP id ig14-20020a17090b154e00b00216bd628e69mr3840298pjb.205.1668608933067; Wed, 16 Nov 2022 06:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668608933; cv=none; d=google.com; s=arc-20160816; b=0vCNEG6C4i4mzy0nXOf6WwtPPAIoZOxUU9Kub8k8n4H6zKNZ/v5N00elYOOSGkJXbg 2sUkvMryz4HeXX4lcek8kEx767jPY08Vc5rSkLsp7Mb+wELjb8cSyfRADUfj3fEvwD2q e89NryTvL6aiqM/7VbtfDhIq49tkaF92nAZfjhiPY+ZxhIksO8Hm4JLMHu28Dw3g5NT1 I8X/TrdsEgtbhmbl5VDny8AuyQU+aX+gzafSi0Z+09AwmcqP0ZPYraJTRbZEkP8Y5Ptp s6axIezVoko4jIU0DIWgRxY5U3tmIOUVnUAbO8HUf8Wb0Io3jMUhr9L/HjZG/h+B8sg9 UfFg== 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 :message-id:date:subject:cc:to:from; bh=hLFl38tf9l8KZrmWSLXHNW/Vhx3bUOKJlSDs2qwuZ6g=; b=kng/GtkeVsTL839v5s0xm4Bd+QmlzzrTOa1GWMiFwIFRupylU65d2+1khGgoGtdlDp F7xfK7vWxUosqobq6HZd+ZL1r+E6ZVbRfkY6AX95455OH5YqwtknPRMyDYYo+UCzuNsN gHXb2KBJE7j+081cYEptvs4NuGQ4Kxwozc/3dIBzMReshrAMsOHOtFPS/hD7EC1MkuFR nwI/Hk4u/PF6gvUzTVMJFfeZDCEkQTo1pw76rzUEVhiLecid1mrUb+qCPrkkUOutRu8s c95ZkyHNJpLt2exWABftWkn0/esYW8SboiVaeIqsIWcar32+ZsowNnXzU/5EiNPd8dKT lfXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a63f114000000b00476bba7cbf7si4477557pgi.471.2022.11.16.06.28.35; Wed, 16 Nov 2022 06:28:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbiKPOLN (ORCPT + 99 others); Wed, 16 Nov 2022 09:11:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233763AbiKPOKn (ORCPT ); Wed, 16 Nov 2022 09:10:43 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8E910F7; Wed, 16 Nov 2022 06:10:39 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id ECF841863FE5; Wed, 16 Nov 2022 17:10:35 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Iq0guvWvdgAR; Wed, 16 Nov 2022 17:10:35 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id A05BC1863E3F; Wed, 16 Nov 2022 17:10:35 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ARbProRY4lWh; Wed, 16 Nov 2022 17:10:35 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.20]) by mail.astralinux.ru (Postfix) with ESMTPSA id 0C96C1863CD8; Wed, 16 Nov 2022 17:10:34 +0300 (MSK) From: Anastasia Belova To: Steve French Cc: Anastasia Belova , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] cifs: add check for returning value of SMB2_set_info_init Date: Wed, 16 Nov 2022 17:10:27 +0300 Message-Id: <20221116141027.10947-1-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749663280886030962?= X-GMAIL-MSGID: =?utf-8?q?1749663280886030962?= If the returning value of SMB2_set_info_init is an error-value, exit the function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 0967e5457954 ("cifs: use a compound for setting an xattr") Signed-off-by: Anastasia Belova Reviewed-by: Paulo Alcantara (SUSE) --- fs/cifs/smb2ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 880cd494afea..c77e49b3fcc6 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1116,6 +1116,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, COMPOUND_FID, current->tgid, FILE_FULL_EA_INFORMATION, SMB2_O_INFO_FILE, 0, data, size); + if (rc) + goto sea_exit; smb2_set_next_command(tcon, &rqst[1]); smb2_set_related(&rqst[1]);