Message ID | 20230601212456.1533-7-demi@invisiblethingslab.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp626163vqr; Thu, 1 Jun 2023 14:34:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69rv89TzjEhspLszq62BOfA5Jv/hXjNFVWcKOmKt9DZI0I+M2e08NgDyG76mNnq8xjKY1t X-Received: by 2002:a05:6a20:e19b:b0:ff:ed6b:4c9e with SMTP id ks27-20020a056a20e19b00b000ffed6b4c9emr10643146pzb.36.1685655289657; Thu, 01 Jun 2023 14:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685655289; cv=none; d=google.com; s=arc-20160816; b=TEnS9/13mbHE3gFnRm6MnN86UxbrpkvjqPWUoWEUqNQikP81JUyZRRGL5WUIoJPTFm ttU1c5tIzCkLOrD8r74EpuQDX7zBq+jNKUCQMhE/7QfHpokwmRWmaDK1+S13eCOZS2MS 39acfNp+UVrkhGB0SrXqz3twpxeAae99Gno0RqQ+V6WK9dt5cTFBE7wHDB1cxsl0DsUe JS2pSVuKL4rjZpLrMRvNcRxsRkwALwnEp8j4/M6nw2ekkBKCGc228+lGXuRPpWIElovg DXIJ43GqiYIAUG7u3fbEPbB6zLKZ5Q/02TfiAw/ymt7DCDOzIqgc0TghuFRu4NS2Dljb A9cw== 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 :feedback-id:dkim-signature:dkim-signature; bh=h/1KwQmVaBXUd1H3OHkX9KZBr+WvyoaYktC9lrYuvik=; b=Br08o0hW9cLHrKDH71Q5xXA5dwQTmwtygeEVxbTtFJnkuE9jPmmArM+xzQVEL1Oe13 0ynZDcykRlrHfNoO9eR+qspT2DSp7KH2ES340mE/ge20Ora9NgX2LSbE+FFZqrOGfEaC OFZEvNKARkRssBrPTklaiuXDhvLaQt+BXyK9w/iiNl6fFkbR7Na/R1SiPA7hIoq2Xtak Rgj7ILVx6HbMoqE9DBv51At9wVrFGkpPOO2xb7dTTlXdmx8uF0fN2bywr6lVqIb+SHx2 dqGpQRW1hsDhnt47Aye3fGiUdrNVSh4nBi8zf9gYLzQClxoDosJ+dQaxtZ4ecEXQBslr 9svQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b="kMK42/eP"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=aTkAGIVw; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a63be07000000b0052866b25be5si3303326pgf.746.2023.06.01.14.34.34; Thu, 01 Jun 2023 14:34:49 -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=@invisiblethingslab.com header.s=fm1 header.b="kMK42/eP"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=aTkAGIVw; 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 S232160AbjFAVZl (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Thu, 1 Jun 2023 17:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231700AbjFAVZZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Jun 2023 17:25:25 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08CB195 for <linux-kernel@vger.kernel.org>; Thu, 1 Jun 2023 14:25:24 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1827B5C01D9; Thu, 1 Jun 2023 17:25:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 01 Jun 2023 17:25:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1685654724; x=1685741124; bh=h/1KwQmVaB XUd1H3OHkX9KZBr+WvyoaYktC9lrYuvik=; b=kMK42/eP2QQw4iUjZwnuhTf7+N I8hnwQvpNyGrcpi701r+NYHbQNUNNtEkwodP+KKRX25LcWStIj6vg866vTVQ6t3c bldGK7ptPX1Gw6AspQW46YYt36yXWssA/PptTC7RvTMO784ZrR+uyt+kdQoXNxsM nDBewdaCVISlh5JZ19A4bDdvWKN6/L+L8QT8Q98+tgiKO79IwN6gJfzHNCiCx2cH I5expoAb73sL4DRIUBcdrcF8f0Ha7O7XlAuFfLn3yw2bbGqibn4yTc5gloWJKe7O ajCG3rM4H2NA+xa751J0cyC98iNe9YXFT6yluN7w2Kb8eyM6fdjL3QD7c+fQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1685654724; x= 1685741124; bh=h/1KwQmVaBXUd1H3OHkX9KZBr+WvyoaYktC9lrYuvik=; b=a TkAGIVwq2iFivqFUKv2DA1VXOJJnOlnFEzrgATMUTlhvLHCgMW/qBYE6xJHH68Rc 59UUXKm7wT4hq98cjMhkY+KnWJLS8nH0Sym3gB82X2HAydwujG/4Uz67emSIKOPc dOofJ08BkOCrCY2L0FPK0B9Hi9FE+vNkkyTyGEHJ2cMdtMminLMqWqFVE2zXnChz Fk6WhTpiRuMyhjnDzLtsWQ1y5hgOdhpN+UBzMVauvtZ1jjGKLly1L9fMgzxt32tX mjD9kfCAacfZh4MBl3d8yaJtA5vPfScToCaSNEYieLfPPbbdHQqCBjYzZC3Fp9yw Pwfor2M+KQyJooGa4MvCA== X-ME-Sender: <xms:wwx5ZN-1nVIOm-poAfwY9drGrP90YJr5LpDKtQC7y0V1wVqOEYF2nA> <xme:wwx5ZBvmFjIoi_nEYkSHx4SoUgCEPCj5JjzzcatwrTOK9fa3MSU7SUicVzOfNeewF waFfYuhoSjT7ZE> X-ME-Received: <xmr:wwx5ZLCTwGhQvoIACKWGpOIxAADgTa98P88Cz2-F86hbwBliEpBaJSG_lXwozkbcuhGdXiGEa_I> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeluddgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghm ihcuofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinh hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejffejgffgueegudevvdejkefg hefghffhffejteekleeufeffteffhfdtudehteenucevlhhushhtvghrufhiiigvpedune curfgrrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhg shhlrggsrdgtohhm X-ME-Proxy: <xmx:wwx5ZBdu0qnky4yPi8iZRFNjfK0r4M2LhhyDSGerNQOK36XFPeGGJA> <xmx:wwx5ZCNO-Qh9kG24AtB4r0wKEVfpVCo8avynWEOLTvq3v27efeUSKA> <xmx:wwx5ZDlThLHPAN4DdI1yz7fhhxtS3qwq8COBRROqtcR1yY02SWmdhw> <xmx:xAx5ZLbchMSSD7_LbgR_uT6c8M0LsdGIxZ-a370F4lDPGenGDUjQEA> Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jun 2023 17:25:23 -0400 (EDT) From: Demi Marie Obenour <demi@invisiblethingslab.com> To: Alasdair Kergon <agk@redhat.com>, Mike Snitzer <snitzer@kernel.org>, dm-devel@redhat.com Cc: Demi Marie Obenour <demi@invisiblethingslab.com>, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] device-mapper: "." and ".." are not valid symlink names Date: Thu, 1 Jun 2023 17:24:55 -0400 Message-Id: <20230601212456.1533-7-demi@invisiblethingslab.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601212456.1533-1-demi@invisiblethingslab.com> References: <20230601212456.1533-1-demi@invisiblethingslab.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767537680827275472?= X-GMAIL-MSGID: =?utf-8?q?1767537680827275472?= |
Series |
Several device-mapper fixes
|
|
Commit Message
Demi Marie Obenour
June 1, 2023, 9:24 p.m. UTC
Using either of these is going to greatly confuse userspace, as they are
not valid symlink names and so creating the usual /dev/mapper/NAME
symlink will not be possible. As creating a device with either of these
names is almost certainly a userspace bug, just error out.
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
---
drivers/md/dm-ioctl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index b12592bcb4b2b8513f5da6208fb545203534d7ff..adf0c4becc743e4ad59e1d6b0ef108ddd56f207d 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -771,8 +771,10 @@ static int check_name(const char *name) return -EINVAL; } - if (strcmp(name, DM_CONTROL_NODE) == 0) { - DMERR("device name cannot be \"%s\"", DM_CONTROL_NODE); + if (strcmp(name, DM_CONTROL_NODE) == 0 || + strcmp(name, ".") == 0 || + strcmp(name, "..") == 0) { + DMERR("device name cannot be \"%s\", \".\", or \"..\"", DM_CONTROL_NODE); return -EINVAL; }