Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp578993imu; Tue, 27 Nov 2018 03:15:38 -0800 (PST) X-Google-Smtp-Source: AJdET5cHZx8uvXxYiSTL91q6aDxyS5qxXV4MVO8dKAdqhpkPTJb0W0OJoZhH+8jCrgn7mR0aUGgI X-Received: by 2002:a62:ca9c:: with SMTP id y28mr32231733pfk.236.1543317338816; Tue, 27 Nov 2018 03:15:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543317338; cv=none; d=google.com; s=arc-20160816; b=KkTtdqrWMr9E1xjp1EcpysNsh19MXAwYKxcIscnhTve5uFOhE1nW0bEfbefLggSbjx oJhetn+581uvz2D4BP3n0WfT/YnKrpyxtJXICtiHoSm9wq+XTCQNTKikcnRJ2FB/g2qC jDUGey8nJlqkQIKV1Sjfmdi29Py6DI2tnPBajSnjzxft1uh/Bw7hH0/JlKhZGkn6JDeL BLXSeCYa+QuB4q7kUUbz5UK4rlCJwczZRfkRkhtXgW55lFveZL4aNiQfXF3GAykCkiBW Jlc8haBnI2xEtpGa9mYLYVR5scQVaNyY82ectNSGI5GM0NJo8TOQxlA0kn2SSQeqnu4j MmPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=UGetyeGloFdXMAyPCmZTYPSFP+5M1fESfeEH0CNG9Sk=; b=jYDjHxwZ9Anwx19OWCekkcsKQx8/xX408DvGp1lkGqn71Jdx69ULLQpfWEQ3qY+7wk Qw4grJw1tLmKfmGGduf933wedOZSbbbQPxtCyywnfLKlT4kpT5OhAv/evjdf79mouo+D Pig1741NScy+h75hCNPQXt9/aS+3MdTgG04GyYonhE+CwjvVAGW4zIhzZvtQtivgReKI huYdcmP1YjumTfJpfPJh9NQ8AMM27Afe2eF39vv9XaAVF/U0iZ2e4SVUR6TBwmCT8r2l 9wa7oOUCoGJpkN6EMpVFIURMvdESsr0u7itNp1KdEy8FACwD1FxPb/gJGXf4oFAMhvyC BjbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=s49tnqEc; 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 h1-v6si3558593pld.332.2018.11.27.03.15.23; Tue, 27 Nov 2018 03:15:38 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=s49tnqEc; 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 S1729680AbeK0TpP (ORCPT + 99 others); Tue, 27 Nov 2018 14:45:15 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:35735 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729580AbeK0TpP (ORCPT ); Tue, 27 Nov 2018 14:45:15 -0500 Received: by mail-lf1-f66.google.com with SMTP id e26so15779271lfc.2 for ; Tue, 27 Nov 2018 00:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UGetyeGloFdXMAyPCmZTYPSFP+5M1fESfeEH0CNG9Sk=; b=s49tnqEcQPZggH4VwmdZ9ltcZFkHAr8c+8wqwGGv7RSkgX+3F/zyjYVd+yE0EysY5p 0VPpksHSTb7FWomuN36okAI3gWMlurcgczpYoYNUvdx7/EAntTVawBSC+kb2NJkK3sTR PduWUJEwd4LVGMMvokVyY6wi0OYI7HL9nDbqD6xIvicj/CSTwMLLQIqV5p7uI+HKB1Hb +qyJkhemA9mDDlq8g1KRPkYSMr1NqruUfg6j70X/7maogE+xehAoEdkbLZ4tNwRnwL4p 6PFgGYqIJI4u5FGaDG9pfl/1PUy1Vh0FH4aobmA90aNdHwrB6+8ziIFqOYYMw8JG32QE 6s6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UGetyeGloFdXMAyPCmZTYPSFP+5M1fESfeEH0CNG9Sk=; b=XcUi8Sfu2Xi65/uE8ouGk6XM15fL8oeKYEWehPeXpj4ZS9BkCpcf6xrk5NIOaPgDAG jypR41ut+ID3USaYq5ZWWQXQQA8PqNY+p0nFF6/lSo1w6M2+i0qxwD0j/gOXICxAHDwO FS34K6vDKJZo3moY23RVCOfUl4Z7NysUlYJkknRNL3BJJZPMmVS1Zb3mw250vPBBSy3J 8xgv5jrHjCAl41/U2DU/fGRla7DHGOMO+AI9HHsivmcW4fonMvz2a+W5/KGoR/lWoH4a wUXCoKEbH3zwHTJcQKxkdXyZciao8LxPnDfSyBGO5M/DnIv8v1hwwgdMjH+4y/IghLMR XaCA== X-Gm-Message-State: AGRZ1gJSKtgvbSfICe8X6oSHRrSLjDkc2deDMe/N8WDmd6pvO3+5YQQx k+cAObe8YnOtTV4ac9Z3JVNsBaNbLRQ= X-Received: by 2002:a19:702:: with SMTP id 2mr17782101lfh.144.1543308484059; Tue, 27 Nov 2018 00:48:04 -0800 (PST) Received: from [192.168.0.200] ([31.173.86.208]) by smtp.gmail.com with ESMTPSA id x16sm466816lff.26.2018.11.27.00.48.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 00:48:02 -0800 (PST) Subject: Re: [PATCH] libceph: fix use after free To: Pan Bian , Ilya Dryomov , "Yan, Zheng" , Sage Weil , "David S. Miller" Cc: ceph-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1543302127-14435-1-git-send-email-bianpan2016@163.com> From: Sergei Shtylyov Message-ID: <54c1bcc5-6df5-ba24-2774-98f6333c57b3@cogentembedded.com> Date: Tue, 27 Nov 2018 11:47:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1543302127-14435-1-git-send-email-bianpan2016@163.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > Signed-off-by: Pan Bian [...] MBR, Sergei