From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 5BD88A69 for ; Mon, 23 Mar 2015 13:53:32 +0100 (CET) Received: by wgra20 with SMTP id a20so145121501wgr.3 for ; Mon, 23 Mar 2015 05:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com; s=google; h=from:to:subject:date:message-id; bh=DWB075lg4dVWtgH8njsAQH7HWVOJx4y2IfjBPh6BLC0=; b=YaFL5EGIm2C8yJWKxsRmaZ6hWJXUMVsd7WvlBFIiVagpNxkjPvHWceO/0aHuvWS4VI IiUYxoA1PT5pF3zW+Pk0Q9kyIJgPfUoC1aU7R7pLc0plJ+ii3TP10UnNltqLIyhUMtDO RFpPfAZa4nbH13lpbDHmi2Mka+8JEyc8MifEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=DWB075lg4dVWtgH8njsAQH7HWVOJx4y2IfjBPh6BLC0=; b=N9mtEEa8Q31CNGy4Ca7lptYj3xjw0qmOb3QUXTxLuHS8swKfk3orqQw55NCnCWxhkO 1FECQsrR/GSs80HfdeLsdkguuUX5sagqfJZoqNP6cE0tb23bKM3jn5bRkDbrdU/3+jUD 8dF8lJ5IDqXCAcOVrr/TeZVbeFa/XptDsZxqV9zJRtqLZpcJbfSrJh9hNB6ld1dF/LvZ 6Y5naT5SL2xsAn1CZaAZerXVLgxOt3MC6RBxz4pjIwHxBFsiLyL+55wOzgYzYsfUPy0u CwYc0efsmx9ei7QqQQXf6Bw0FYwYBCnC078iZ9YNx7Zn8heAVvVzxMEg/CErHEUjz+wA KYvA== X-Gm-Message-State: ALoCoQnur/eBJT62T7RznDOUlDcoq5+qWctBV4c6qh/W+Ip4yEkCfEycpiTtD4Jn5MjjcsfhzUVS X-Received: by 10.180.219.107 with SMTP id pn11mr14978624wic.6.1427115212184; Mon, 23 Mar 2015 05:53:32 -0700 (PDT) Received: from pboldin-pc.kha.mirantis.net ([194.213.110.67]) by mx.google.com with ESMTPSA id hs8sm1091196wib.11.2015.03.23.05.53.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2015 05:53:31 -0700 (PDT) From: Pavel Boldin To: dev@dpdk.org Date: Mon, 23 Mar 2015 14:53:45 +0200 Message-Id: <1427115225-14489-1-git-send-email-pboldin@mirantis.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link' X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 12:53:32 -0000 Due to increased `struct file's reference counter subsequent call to `filp_close' does not free the `struct file'. Prepend `fput' call to decrease the reference counter. Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_link.c index 7755dd6..62c45c8 100644 --- a/lib/librte_vhost/eventfd_link/eventfd_link.c +++ b/lib/librte_vhost/eventfd_link/eventfd_link.c @@ -117,6 +117,7 @@ eventfd_link_ioctl(struct file *f, unsigned int ioctl, unsigned long arg) * Release the existing eventfd in the source process */ spin_lock(&files->file_lock); + fput(file); filp_close(file, files); fdt = files_fdtable(files); fdt->fd[eventfd_copy.source_fd] = NULL; -- 1.9.1