Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1205257rdh; Fri, 24 Nov 2023 07:19:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGa3RYvWlYaw3xsayMnTKGTgTVsZ/HcdBrWMlqla8yuPuLMK2R66MNpJ116Ey3BMKIhldEV X-Received: by 2002:a17:902:ec82:b0:1cf:5670:243e with SMTP id x2-20020a170902ec8200b001cf5670243emr3853968plg.13.1700839193151; Fri, 24 Nov 2023 07:19:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700839193; cv=none; d=google.com; s=arc-20160816; b=sLQJWZbxbL1t+gLcKY9nTcDrPXwdF+suCSHAZdfRH+v1bXJ7r+FSnFDvnB0crj9UVH xZ4TF1QWd6UCHhlMLHdvXNZRG9W6HapEasbxKt+Rw5arwzFEKBWrIQuPZyqiqrmeSOyI bOrLiIA0sg2NG/LXxcbqdn7WadyWTKg6jAfc9jg2gV4YuHbdcnvUcgsjoxn6HCBa/jJk XTWL+PslnnzJ+9nsT5UrujOB1SGtk4o6u3FQKoFEigPdRUGaL3EIWz1jqvStMH4k9fmp KUWnpkMik5hKHeFns84jEOUEnt92DlohEVMqRJKFe2E715wNG0fN67RV3lY4bd5zwDx6 pQTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QoeFy1fvtxYFqhOWAlUTuzjQtL+OnIM893s/hmWzV44=; fh=204vnJs7IGSLsJJhztkU6EH42OLfoaQ2dBRwdN548DQ=; b=Y+O2aX4puc4len8GtGWDnuJbpcCdUVs2XNLrc9akp4kg9cqioyyISRAesozTNU20G/ Yq+unNmSh7qld98RIx5WEBdxMb1WgVQv76E4b5gRIi4rWYats5o3MCVPaIfjJNCMkjrp 0K+AuUqhLnRqMoBtC3fNL1qozFGgdAOs4vUmC3wmXpJwitmR5GunCIz3+tY6Rciq7qDC 30xsUFUsMa2c//4y0JS6lzWiOSnAg2JHtgBRGX5+HvlNqDv52hCIMD/HdcdJ6/WvDtWF vKrepe04DAWMSMbj7766l7gNdWgrZTm7J7tlUUlzT4o7BoeVGDQ5S8o0nirGwcE+v4H7 dR/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WyqkkMlC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q14-20020a170902dace00b001cfa718038esi1154886plx.388.2023.11.24.07.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:19:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WyqkkMlC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 728F580BC108; Fri, 24 Nov 2023 07:19:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345890AbjKXPT3 (ORCPT + 99 others); Fri, 24 Nov 2023 10:19:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345737AbjKXPTV (ORCPT ); Fri, 24 Nov 2023 10:19:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71B071BEC for ; Fri, 24 Nov 2023 07:19:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40332C43391; Fri, 24 Nov 2023 15:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700839161; bh=AxnCrub8TDnlTzblxU/JgLVOnW/iV5OidhqOG/icin8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WyqkkMlCeftsYMjf0Vqa9+3fFEH7Yd7j5SJtfDSTGcgjjGmLLywaWqcJm0A4iJbBt fLaz4Un0Zy8VnrXcU9qQmhIbgi69X1z4E/JOJWcT5er5dK4US8pHeJor5Sb4YJVezx lx+pYJwu0e2870JDjgTFk3dlfKe750bY6oMD3l3iFOdWPsl1RPWmtTTTrg+I9QjA/f yWjPmfjhQfKvyEiuDYRVOM2ZxjXh6/QhKJ5/lAnY4EJnxxKAh7aK7o7+KQssdE8+F7 3wa4ORDQ8BXEzjs/e0LvmOJHB2ip49l3l3CCqjp/HgrYxoTgJiTh+AV9NwainAvh2U IgI12j2v/SSzA== From: Christian Brauner To: Jann Horn Cc: Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Alexander Viro , David Howells Subject: Re: [PATCH] fs/pipe: Fix lockdep false-positive in watchqueue pipe_write() Date: Fri, 24 Nov 2023 16:19:00 +0100 Message-ID: <20231124-detailgetreu-solidarisch-ae74c731c362@brauner> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231124150822.2121798-1-jannh@google.com> References: <20231124150822.2121798-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1607; i=brauner@kernel.org; h=from:subject:message-id; bh=AxnCrub8TDnlTzblxU/JgLVOnW/iV5OidhqOG/icin8=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaQm7HusxnmZrd2q/KC2xjO1VZ/blq7bwnmhK7fyxqam6 80lT8+wdZSyMIhxMciKKbI4tJuEyy3nqdhslKkBM4eVCWQIAxenAEzEToeR4deDnK0M+7dV3649 /of30JbNaQp23OfXLTXmYdt0Ny5RYRbD/7Lu4Oxpx2oesq7Ta8vpT8+PNtRa25BS3CjzxtuJ4cU pZgA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 07:19:50 -0800 (PST) On Fri, 24 Nov 2023 16:08:22 +0100, Jann Horn wrote: > When you try to splice between a normal pipe and a notification pipe, > get_pipe_info(..., true) fails, so splice() falls back to treating the > notification pipe like a normal pipe - so we end up in > iter_file_splice_write(), which first locks the input pipe, then calls > vfs_iter_write(), which locks the output pipe. > > Lockdep complains about that, because we're taking a pipe lock while > already holding another pipe lock. > > [...] Yeah, that looks to be a improvement in general, since you can't upgrade a regular pipe to a O_NOTIFICATION pipe. IOW, peforming that check with pipe_lock() isn't necessary. (The check for watch queue in pipe_set_size() called from pipe_fcntl() also wouldn't need to be done with __pipe_lock() held fwiw.) --- Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] fs/pipe: Fix lockdep false-positive in watchqueue pipe_write() https://git.kernel.org/vfs/vfs/c/efb8f498327c