Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932698AbbKLXak (ORCPT ); Thu, 12 Nov 2015 18:30:40 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:45556 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932646AbbKLXTu (ORCPT ); Thu, 12 Nov 2015 18:19:50 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Ilya Dryomov , Kamal Mostafa Subject: [PATCH 3.19.y-ckt 128/155] rbd: fix double free on rbd_dev->header_name Date: Thu, 12 Nov 2015 15:18:02 -0800 Message-Id: <1447370309-357-129-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447370309-357-1-git-send-email-kamal@canonical.com> References: <1447370309-357-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.19 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1379 Lines: 43 3.19.8-ckt10 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilya Dryomov commit 3ebe138ac642a195c7f2efdb918f464734421fd6 upstream. If rbd_dev_image_probe() in rbd_dev_probe_parent() fails, header_name is freed twice: once in rbd_dev_probe_parent() and then in its caller rbd_dev_image_probe() (rbd_dev_image_probe() is called recursively to handle parent images). rbd_dev_probe_parent() is responsible for probing the parent, so it shouldn't muck with clone's fields. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder Signed-off-by: Kamal Mostafa --- drivers/block/rbd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index f33ff6c..d7143de 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -5201,7 +5201,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev) out_err: if (parent) { rbd_dev_unparent(rbd_dev); - kfree(rbd_dev->header_name); rbd_dev_destroy(parent); } else { rbd_put_client(rbdc); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/