Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp466407imu; Tue, 27 Nov 2018 01:13:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/UttlPK0Zb7EsCcEaGEHOwwcLnlDOTYoBH4vHqBD7W8C4ynWipwB2MFSqUXljJtlG3d/k55 X-Received: by 2002:a63:9c1a:: with SMTP id f26mr28750856pge.381.1543310014688; Tue, 27 Nov 2018 01:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543310014; cv=none; d=google.com; s=arc-20160816; b=APigSHlFbrzg+wthirBe0HKU0wRLj8BdVC7JMZkZ7lfHFhJWsZsUXWnUvGzi4R40yq 96XJPLYb+E4271H9izbrW0S4f+FUeyg1dYY3qB8yaivJWP0xtfSzBbLFpTLanhCJ4eVs P1d6xcOOb0rhi+RSsUxb0R5qg6cQ8qi/kZoKy8s/+jxAAs2CbWc3DoyVeH8A1l3WcnRZ ABHFDiWXZTHI/S1nSpmHSFfJQAUKslRVv/d+ZUgQhut9od9JuUCrgHD0Zb5FekL3NzV+ /AhUCRwtLcgpt7mnndGAT7jchN+4xqAmmZHeRUfWgj1TFvGPBS+qOKqE0XGrmIQvG/Pu 71ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=e+SgaRuchEamvc2B0Ens4lpXjRc1+x4osTlly3rXMa8=; b=BILJIFFW1j6XTtpO2DbF2oBjQXEnSyYHVZD+HgskDfAmL+ka33QiZWgBo6DPTUOHZe cX31i7vAaIe70+NuEO3doNHWq0RyXPTSbZ8NCEN48ikXMX34a5S5CG8S2blyzooaoza1 e8wYMKgpudnf7gkU5c1jQFQ8VA7dxijC8jBTsq+7oNFGix0h3FDxOhmwRM1PAM9VOAdL fzLs2bbVxUOh7lvyCDe0o4LGzzKHIaGlz5VE12uPh7IygeDIXSGHBGuUxIQpzy6M6rdS FvMegN9BI8z7Exw2Z0e27rGRWyIFIm8jceFLxMD35YhER+jJS/2dDt3H8p+w1im//ah/ QfUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=HuGOIGk4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si3262553pgg.301.2018.11.27.01.13.18; Tue, 27 Nov 2018 01:13:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=HuGOIGk4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730038AbeK0UHP (ORCPT + 99 others); Tue, 27 Nov 2018 15:07:15 -0500 Received: from m12-17.163.com ([220.181.12.17]:47411 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729710AbeK0UHO (ORCPT ); Tue, 27 Nov 2018 15:07:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=e+Sga RuchEamvc2B0Ens4lpXjRc1+x4osTlly3rXMa8=; b=HuGOIGk4rWNCjrFgQfbBu t9/CtIjq+TXlsMWihthz6xKM730NUKD2CQEnxgU01s25CfRPMo6z2+NTgiGWlmJo X75YpuzfBW6t40drqXDioFyu/rYA4BghIDmzg8KcFK9CWPXw+s/AYgHAmQIJjJtu ZYFUIqbZg9XIigbJf3CKHI= Received: from bp (unknown [106.120.213.96]) by smtp13 (Coremail) with SMTP id EcCowAA3kWzeCf1biNVEBw--.39431S2; Tue, 27 Nov 2018 17:09:50 +0800 (CST) Date: Tue, 27 Nov 2018 17:09:52 +0800 From: PanBian To: Sergei Shtylyov Cc: Ilya Dryomov , "Yan, Zheng" , Sage Weil , DavidS.Miller@bp, ceph-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] libceph: fix use after free Message-ID: <20181127090952.GA23643@bp> Reply-To: PanBian References: <1543302127-14435-1-git-send-email-bianpan2016@163.com> <54c1bcc5-6df5-ba24-2774-98f6333c57b3@cogentembedded.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54c1bcc5-6df5-ba24-2774-98f6333c57b3@cogentembedded.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CM-TRANSID: EcCowAA3kWzeCf1biNVEBw--.39431S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw4xXr4UXw15Kry8Kw47XFb_yoW3JFg_ua yvyrn2kw4I9a13A3W7GrZxZrs7Wa4xuF13KrykGrZ3Z34rXFZ8uwnF9w1rZ34fGFsrZrsx uF4Ygay5JryIvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUeqYLDUUUUU== X-Originating-IP: [106.120.213.96] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiVAoMclUMGLSKQwAAsc Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 11:47:56AM +0300, Sergei Shtylyov wrote: > Hello! > > On 27.11.2018 10:02, Pan Bian wrote: > > >The function ceph_monc_handle_map calls kfree(old) to free the old > >monitor map, old points to monc->monmap. However, after that, it reads > >monc->monmap->epoch and passes it to __ceph_monc_got_map. This result in > >a use-after-free bug. The patch moves the free operation after the call > >to __ceph_monc_got_map. > > > >Fixes: 82dcabad750("libceph: revamp subs code, switch to SUBSCRIBE2 > > Space needed before (. > > >protocol") > > Never break up the commit summary in this tag. Thanks for the guidance, I will correct it. > > >Signed-off-by: Pan Bian > [...] > > MBR, Sergei