From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E54B9C19F2D for ; Tue, 9 Aug 2022 15:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244387AbiHIPia (ORCPT ); Tue, 9 Aug 2022 11:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244686AbiHIPiO (ORCPT ); Tue, 9 Aug 2022 11:38:14 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C217F1CB1A for ; Tue, 9 Aug 2022 08:38:11 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id l22so14758306wrz.7 for ; Tue, 09 Aug 2022 08:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=VPZpeIaD9GCj1+EcsItqLp19LBrb3woyTCT9WSQsJ0w=; b=bzhWg+clYNYRnSV0BR3ohJ3k2WXRsbp71AIXs7BOKVyaCfLx5YDYxRt5/iy0y80Lb5 zZv1L4BPVP17RCIkXkU0dWbOhyRVLnBdkse/3me465IHLKKjW1u0kCOX4AmM4Q0ARAI3 5mmyEQijYOVMb/XSZYig6E7YdtSH9bCQDDhrPGpYlPb88sLzqtPY+lefX86FEC2G2+O1 aKsHjTd203a6di2GdQ1qe7Go2LZhUveIDhMQHyce5xVi7xR40HvS8UHlAhXp1xQefard LX9hSa+/brmeIZT57jCY6WVuZ7xS8W9ScF4TMycEpuyXyy+f2YlBALWVZ72ZLED3TZuR x/Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=VPZpeIaD9GCj1+EcsItqLp19LBrb3woyTCT9WSQsJ0w=; b=GgrM3Gi9brFMc5kJ0yYAMZgbJA7qi2pJFxOQ8Qb3QFLr7nvKWGWY4maRdqQ0jr4Pb1 7npk4PYCA+/vDb1hn9SubuEyynSltnJ3LoyPnDp6RAJpSM5M2/FHxQmMUWDTQ7dQlRku 2SBGQK2IW4RGILh+BFXg0JBLnUpt1zI7APlgx1rnsgZayhwyoCMZZTdCQpxJtphTrlWt AXd1oVBwZGNDOuV5gDwhmFHxYQ7di82iCCsUFcs0UtqVsl4xxRq5eUHltT5+DF/BG/13 3anugFJ6ElWuC0iHqGJZFnPCcFXeu2OcY2FzwxjcxhtY8bd8P1jCSey1Zuk604Fuanuu gh+w== X-Gm-Message-State: ACgBeo0yiacIpLZ+RZjNL1s7N9DcuMQFAmqU60f6mW8ZU2OIJixXOejR XBvj1SGJA+WKneIRGtO1PN2nTA== X-Google-Smtp-Source: AA6agR5rJJQy6elpnvBdtFmt1M5yi5AmqAc9hCSd6ZetaToUgv+oPGHryWxVeYa8LI3Q1TqACYVbgg== X-Received: by 2002:a5d:64ca:0:b0:220:6247:42c1 with SMTP id f10-20020a5d64ca000000b00220624742c1mr14674640wri.478.1660059490136; Tue, 09 Aug 2022 08:38:10 -0700 (PDT) Received: from google.com (cpc155339-bagu17-2-0-cust87.1-3.cable.virginm.net. [86.27.177.88]) by smtp.gmail.com with ESMTPSA id h10-20020a05600c414a00b003a32167b8d4sm23056165wmm.13.2022.08.09.08.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 08:38:09 -0700 (PDT) Date: Tue, 9 Aug 2022 16:38:07 +0100 From: Lee Jones To: Eric Biggers Cc: Haimin Zhang , Alexander Viro , David Howells , "Fabio M. De Francesco" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Haimin Zhang , TCS Robot , Lee Jones Subject: Re: [PATCH v2] fs/pipe: Deinitialize the watch_queue when pipe is freed Message-ID: References: <20220509131726.59664-1-tcs.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 02 Aug 2022, Eric Biggers wrote: > On Tue, Jul 19, 2022 at 03:04:41PM +0100, Lee Jones wrote: > > On Wed, 06 Jul 2022, Lee Jones wrote: > > > > > On Mon, 09 May 2022, Eric Biggers wrote: > > > > > > > On Mon, May 09, 2022 at 09:17:26PM +0800, Haimin Zhang wrote: > > > > > From: Haimin Zhang > > > > > > > > > > Add a new function call to deinitialize the watch_queue of a freed pipe. > > > > > When a pipe node is freed, it doesn't make pipe->watch_queue->pipe null. > > > > > Later when function post_one_notification is called, it will use this > > > > > field, but it has been freed and watch_queue->pipe is a dangling pointer. > > > > > It makes a uaf issue. > > > > > Check wqueu->defunct before pipe check since pipe becomes invalid once all > > > > > watch queues were cleared. > > > > > > > > > > Reported-by: TCS Robot > > > > > Signed-off-by: Haimin Zhang > > > > > > > > Is this fixing something? If so it should have a "Fixes" tag. > > > > > > It sure is. > > > > > > Haimin, are you planning a v3? > > > > This patch is set to fix a pretty public / important bug. > > > > Has there been any more activity that I may have missed? > > > > Perhaps it's been superseded? > > I think this was already fixed (correctly, unlike the above patch which is very > broken) by the following commit: > > commit 353f7988dd8413c47718f7ca79c030b6fb62cfe5 > Author: Linus Torvalds > Date: Tue Jul 19 11:09:01 2022 -0700 > > watchqueue: make sure to serialize 'wqueue->defunct' properly Thanks Eric, I'll back-port this one instead. -- DEPRECATED: Please use lee@kernel.org