Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1415077rwp; Thu, 13 Jul 2023 10:27:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlFRsA5t1WoJ5PG6G+DWqj/jqrlWbRssl/xWethOurRnpncxUdeKIEqbfNRDvdrVcignF0FV X-Received: by 2002:a05:6a00:4a83:b0:676:2a5c:7bc5 with SMTP id dr3-20020a056a004a8300b006762a5c7bc5mr2427709pfb.1.1689269259617; Thu, 13 Jul 2023 10:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689269259; cv=none; d=google.com; s=arc-20160816; b=JxZJNKO2jv9B+UukUkflUd+daQuOzoloJIpeSADg8Nh/xZyl675a9s+SpLLjusLrS/ vGZ785J1/ANmSFYMCSJl50dzQz4kfPCqUsY0zAI2ZXqCShFb3VUIrnPw75iXuFg1gRNG kNjG1s76mByv4C4KbY9Boan3Vx/E4jj4Mm3ATTA9c9rAI/q9mMK9TK6F4H/srxrQ5isf G2appIi5G0gVQ3rACFTEmJW7OFjR0sBNWIMoQ3GttI/Qd/r1hlcbBLlxgSZqCIZ/lpz8 eZmt61FlPl6STqHXwXnJhkJEAy6Q8dzSWu+w83gy+xAl+JfTeyRmA7cxss7ir6U3/0yx Zqwg== 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=Wo1YhKpiuAogT2Mk1Czu1kn38Kb9XTkmc0Kdc4fLWmI=; fh=R4VPE/HK/jPQy4d5A/C7QM6UEDE2192WAHrYRn0Xcyc=; b=EWc6LLZ6HZNhJ9SPta9T9Dw7KQOse68nF8/Raot3lw72B5ymiM8qcEL0NK3ekBFwgd 7LbQDG/BnwAxpGLvlXOkwJIA00L89f0vTmcUdaXopKu+e7mfsnpzTt1aJiW/Hl8WMRll +41jPBk3/8tbncXCul2E45Y6B/1umj1S/EfWBJD7pFzsfWVEWTheEk/CioclWI5jNo5k LWYRLuypiK8Ez9oBKJNpZPW5NDz4pdfn8+B6+pNsLcFcv2eOt8OV0WntQkp77AffP9Rv Obvb5CnGBQPaOTRaHHE4LJdbsn9IA/bbrtnBSTo0fkcGGJfcE1UQlDjgi+SNpJrZXbS/ glpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xrm5ygEA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 34-20020a630a22000000b0055c1fb5a4a9si5169809pgk.661.2023.07.13.10.27.27; Thu, 13 Jul 2023 10:27:39 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=Xrm5ygEA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235283AbjGMQp3 (ORCPT + 99 others); Thu, 13 Jul 2023 12:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235134AbjGMQp1 (ORCPT ); Thu, 13 Jul 2023 12:45:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCD6A273F; Thu, 13 Jul 2023 09:45:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5AB4061ABC; Thu, 13 Jul 2023 16:45:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 265BFC433C8; Thu, 13 Jul 2023 16:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689266720; bh=EYt4iVezJKnvAkatfVTh6UE+U2wAlMrUTkseeDOaRrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xrm5ygEAON2Aar9YGb6Gvc8HVb6TzERYyxYHhjZ+O5/LzljdIPe53MQEyu+6HAoHz zxHnrtjvYdz6sknkDV31O2Ep+SjisADMjYR5kpRyq05Lis7rPixq/mX+KpGN+c01tT OS4jvVUJWsIY9IBSyNEVahOwK3ilHU91+8EzHoAZiKvaW5GUlqfduG8OmHNJTgELwN pjdJlyY4YDdEx91YwgE3gE3e42t0l8K4iJB6f4Xko6AaqCWVCYgcd0GMj53+tO57H3 8tR6g0dbZFTFtQBo9jWhDhUiiNT5zhjtErgel6fseJ0wmYrvB1LgxhjU20eHQk3E7u +Pe+5tlJY2A3g== From: Christian Brauner To: Wang Ming Cc: Christian Brauner , opensource.kernel@vivo.com, Alexander Viro , "Eric W. Biederman" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] fs: Fix error checking for d_hash_and_lookup() Date: Thu, 13 Jul 2023 18:41:23 +0200 Message-Id: <20230713-verkraften-fortkommen-cbb49d8d2ea5@brauner> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230713120555.7025-1-machel@vivo.com> References: <20230713120555.7025-1-machel@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1574; i=brauner@kernel.org; h=from:subject:message-id; bh=gJUuPKM4EW0q4dZ1DFgnHG6lOhKj3nmCzj4C3HBEr2s=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaRs0GRpPh08PV52bvahCc35T9n0Vzty/unb/vuO7trGyULO 1YvtOkpZGMS4GGTFFFkc2k3C5ZbzVGw2ytSAmcPKBDKEgYtTACbSvJrhr3z/ZcZDDtfCOQvuNiwpms jN+k57p8fH6TphbE/jNzetmcvI8Gh1znL9J9+mrIyvl38fcH3/9CsxDcJpOh1qPu/cVn1ZxgAA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, 13 Jul 2023 20:05:42 +0800, Wang Ming wrote: > The d_hash_and_lookup() function returns error pointers or NULL. > Most incorrect error checks were fixed, but the one in int path_pts() > was forgotten. > > That one is valid but the chance of running into this issue is almost zero. For this to be a problem a ptmx device node must have been created on a filesystem with a custom hash function that cannot hash a three ascii char string. The only filesystem that would reject this is efivarfs because it has very specific expectations about naming. But it neither allows the creation of symlinks nor device nodes and bind-mounts of ptmx don't have that issue. The only other candidate would be ntfs and only if an oom condition hits. But the ntfs driver can't create any files so that device node would have to preexist. So all in all mostly an academic issue but still. --- Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes 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.fixes [1/1] fs: Fix error checking for d_hash_and_lookup() https://git.kernel.org/vfs/vfs/c/5ad699137e4a