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: 939477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=paulo.ac Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=paulo.ac header.i=@paulo.ac header.b="UdzMSs2G"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41LSN07083z9s1B for ; Thu, 5 Jul 2018 03:17:04 +1000 (AEST) 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 X-Spam-Flag: NO X-Spam-Score: -1.099 X-Spam-Level: X-Spam-Status: No, score=-1.099 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no 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 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;