From patchwork Thu Sep 5 20:14:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 2854214 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BE2E8C0AB5 for ; Thu, 5 Sep 2013 20:15:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3E92202C3 for ; Thu, 5 Sep 2013 20:15:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7EFD202B3 for ; Thu, 5 Sep 2013 20:15:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755559Ab3IEUPQ (ORCPT ); Thu, 5 Sep 2013 16:15:16 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:34932 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754043Ab3IEUPP (ORCPT ); Thu, 5 Sep 2013 16:15:15 -0400 Received: by mail-la0-f48.google.com with SMTP id er20so1994964lab.7 for ; Thu, 05 Sep 2013 13:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JxWDuJ+F/pMJmXsVwaEkbfSs0E6BMWr985LasqnHi+I=; b=B6bcIYtgqJ0gFV/OT9Pk1anWE1R0TOspVKwUfNViqQKR9iXOa76zQRyaiW6nNsCG6+ EEYeMrXT9mT5+2oE3zlBhM3aYZP8Y9YOP9HSgSiARZgD5uaVA9V/Tk5ptTMLxI92nSs2 vZE5e+TdV1dXSUzvBgg9QNrsF2FtFkw0UKM9CVSjrVRU70v9oYlaMTlNFjha6bFW0eXu 8SbGuxCDbj1pFXVkRTdAWnXT2R3pnFJoi5x5gu5+zozh8/uhb9F58PEfINyIQ/dyjP9w K9ZVWxduq8QDdMMu3Aqjpc+3rUnzqlPya1ONR9k4aGsL0EqeFRiUcimNTnABEevkb5K3 SebQ== X-Received: by 10.152.37.103 with SMTP id x7mr8903511laj.28.1378412114026; Thu, 05 Sep 2013 13:15:14 -0700 (PDT) Received: from localhost.localdomain (PPPoE-78-29-73-111.san.ru. [78.29.73.111]) by mx.google.com with ESMTPSA id js17sm14943043lab.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Sep 2013 13:15:13 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Subject: [PATCH 1/8] CIFS: Fix memory leak when a lease break comes Date: Fri, 6 Sep 2013 00:14:56 +0400 Message-Id: <1378412103-29047-2-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378412103-29047-1-git-send-email-pshilovsky@samba.org> References: <1378412103-29047-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This happens when we receive a lease break from a server, then find an appropriate lease key in opened files and schedule the oplock_break slow work. lw pointer isn't freed in this case. Cc: Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2misc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index 6103359..38c93c3 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -477,6 +477,7 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server) queue_work(cifsiod_wq, &cfile->oplock_break); + kfree(lw); spin_unlock(&cifs_file_list_lock); spin_unlock(&cifs_tcp_ses_lock); return true;