From patchwork Sat Dec 25 18:11:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 432731 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBPIM5vN031677 for ; Sat, 25 Dec 2010 18:22:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751475Ab0LYSV1 (ORCPT ); Sat, 25 Dec 2010 13:21:27 -0500 Received: from swampdragon.chaosbits.net ([90.184.90.115]:14379 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977Ab0LYSV1 (ORCPT ); Sat, 25 Dec 2010 13:21:27 -0500 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id E42149403D; Sat, 25 Dec 2010 19:11:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id DD5259403B; Sat, 25 Dec 2010 19:11:41 +0100 (CET) Date: Sat, 25 Dec 2010 19:11:41 +0100 (CET) From: Jesper Juhl To: ceph-devel@vger.kernel.org cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Sage Weil Subject: [PATCH] Ceph: Fix use-after-free bug in ceph_messenger_destroy() Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 25 Dec 2010 18:22:11 +0000 (UTC) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index b6ff4a1..26514a7 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -2131,8 +2131,8 @@ void ceph_messenger_destroy(struct ceph_messenger *msgr) dout("destroy %p\n", msgr); kunmap(msgr->zero_page); __free_page(msgr->zero_page); - kfree(msgr); dout("destroyed messenger %p\n", msgr); + kfree(msgr); } EXPORT_SYMBOL(ceph_messenger_destroy);