Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7608256rwb; Wed, 23 Nov 2022 08:30:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CrWr7M3V0ALZtBkG7lzD5Hj14NgrU4EeSQcE2VR5kccq/dj/yXYRRrh2qXEOlcGt6/4Yq X-Received: by 2002:a05:6402:149:b0:458:cc1b:a273 with SMTP id s9-20020a056402014900b00458cc1ba273mr13192631edu.92.1669221049915; Wed, 23 Nov 2022 08:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669221049; cv=none; d=google.com; s=arc-20160816; b=mez7K2LcNmineC1y7sBash80pVVYPySmX33wm+saEWgzkGb9OwMcUlQsQ/UnXhkZRW di83+Z7HNQtZnO+4drJU/4a09y1QDQCsWanrAQ1oYOUxXm8yZH4FZwSB8VJks17+rGSO KbkjeFSoydO0gcY3+5S7J1yV2evGpxomKyeESBMv4H4+E/fzESqCZHn6YFTuHNKAmyZ9 ZP3UWtXMrvxsy0BVyig5SwcLUkbVnWiqXCcdxQ2+eGOrELve6lkkvUFJp31hiYNMOVDf i6ff2X6nGEOW6m6OICm3MJLGVm31sc3TnqSnxrAP5ODHSUlI6k6rF5A65Z602Wl89NKK m5Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=2Tkv/wUeovm+g785WU68pgukgNkdG4W+ZcAq+o65074=; b=bjVgLeBvN0IP33dgFgp1NATiJI36x5MoPqQIPW4Nh3BskbK+5RaUOtIX1ilvuDm3dD Oqmna3T+wR3GPhRqIWPdrKOs8TQJl5U0NK2fEHTQIT1+XowSw7H3NfSs01Y4rfCNUOZU dDFD116rkhAEgvImv0Tv/dVOx8/Iech+G0+ppjfUliuanCYI1k+o75kL1IcMIe0u29KE OV3RngulE+u0uJAaqgeT2cnzURCHiDMp6f/TnHP3+fYPitjhBDAExtoCiISkU3Q5YyxW 1eHVMH3WYwQQusYXvc5g4vins2w80S/eqa4Jo4I+HfCfg5/eY7T/hC/HaSG/GdJCyNOm mTIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dN3EJ5oO; dkim=neutral (no key) header.i=@suse.cz header.b=Gdysfd9j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id st7-20020a170907c08700b007877b1c7f27si60965ejc.829.2022.11.23.08.30.25; Wed, 23 Nov 2022 08:30:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dN3EJ5oO; dkim=neutral (no key) header.i=@suse.cz header.b=Gdysfd9j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237087AbiKWPlh (ORCPT + 88 others); Wed, 23 Nov 2022 10:41:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237748AbiKWPlQ (ORCPT ); Wed, 23 Nov 2022 10:41:16 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6696CC604E; Wed, 23 Nov 2022 07:41:03 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0FF5921CA3; Wed, 23 Nov 2022 15:41:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669218062; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2Tkv/wUeovm+g785WU68pgukgNkdG4W+ZcAq+o65074=; b=dN3EJ5oO1SiF3WT2Oh5BsZnhUv13vFKpqL4nZ0NYFIWwbiQWqsfX2ca5smn+mANuHCoykQ MGS0l7CoiQPYLPhSfqN75xdF4t6ir7HnL6SxSb7P0IA76g7+vAqnAjxzi27v+sU6Bh8/i2 u8Wyhhc0lKVaBqofPkkBWVTY53cOu8c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669218062; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2Tkv/wUeovm+g785WU68pgukgNkdG4W+ZcAq+o65074=; b=Gdysfd9jN51jI6epNGlV38lUKkYjOijSs0oWuGbzm45qDbx2bmJ2nDYL83RMApqBIPGZtb 8eU9J5t/eM85cgDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DE7AB13A37; Wed, 23 Nov 2022 15:41:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4hljNQ0/fmN/RQAAMHmgww (envelope-from ); Wed, 23 Nov 2022 15:41:01 +0000 Date: Wed, 23 Nov 2022 16:40:31 +0100 From: David Sterba To: void0red Cc: dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, eriri <1527030098@qq.com> Subject: Re: [PATCH] btrfs: avoid use-after-free when return the error code Message-ID: <20221123154031.GL5824@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <20221123143945.2666-1-void0red@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221123143945.2666-1-void0red@gmail.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 23, 2022 at 10:39:45PM +0800, void0red wrote: > free_extent_map(em) will free em->map_lookup, so it is > wrong to use it when return. > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216721 > Signed-off-by: void0red > Reported-by: eriri <1527030098@qq.com> Added to misc-next with updated changelog, thanks.