From patchwork Wed Jul 4 17:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paulo Alcantara (SUSE)" X-Patchwork-Id: 10507399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 029696028F for ; Wed, 4 Jul 2018 17:17:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1546C2894C for ; Wed, 4 Jul 2018 17:17:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0892B28ABA; Wed, 4 Jul 2018 17:17:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88D502894C for ; Wed, 4 Jul 2018 17:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbeGDRRD (ORCPT ); Wed, 4 Jul 2018 13:17:03 -0400 Received: from mail.paulo.ac ([34.238.86.106]:43092 "EHLO mail.paulo.ac" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbeGDRRD (ORCPT ); Wed, 4 Jul 2018 13:17:03 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.paulo.ac (Postfix) with ESMTP id 9BAD6C78F25; Wed, 4 Jul 2018 17:17:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at paulo.ac Authentication-Results: mail.paulo.ac (amavisd-new); dkim=pass (1024-bit key) header.d=paulo.ac Received: from mail.paulo.ac ([127.0.0.1]) by localhost (mail.paulo.ac [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jpEttskIkqz9; Wed, 4 Jul 2018 17:16:59 +0000 (UTC) Received: from localhost.localdomain (unknown [177.18.142.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.paulo.ac (Postfix) with ESMTPSA id CE5B5C78F24; Wed, 4 Jul 2018 17:16:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.paulo.ac CE5B5C78F24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=paulo.ac; s=default; t=1530724619; bh=4mHynUjllej/P9+bFQDw78VpDdVFqDWL+8QMriS4mcE=; h=From:To:Cc:Subject:Date:From; b=UdzMSs2GMpj4rWgDab0DfBH/vBPdn909TMoqIAVwm/AgWhjfgSEzjr4bkuvo2q9FR 62HMcSv+DiGS54OJjslL4WtHcL0oukKQUAkMlqjIyShNKB+zKW2sB5t+cLHmhRbIdL pMhk+SyxicNpZTQbiZIoF1+YEA/a7diktEjIsfjo= From: Paulo Alcantara To: linux-cifs@vger.kernel.org Cc: smfrench@gmail.com, Paulo Alcantara , Paulo Alcantara , stable@vger.kernel.org Subject: [PATCH] cifs: Fix memory leak in smb2_set_ea() Date: Wed, 4 Jul 2018 14:16:16 -0300 Message-Id: <20180704171616.17359-1-paulo@paulo.ac> X-Mailer: git-send-email 2.18.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes a memory leak when doing a setxattr(2) in SMB2+. Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org --- fs/cifs/smb2ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 0356b5559c71..957ea2a5cf1d 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -855,6 +855,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, rc = SMB2_set_ea(xid, tcon, fid.persistent_fid, fid.volatile_fid, ea, len); + kfree(ea); + SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); return rc;