From nobody Mon Feb 9 01:29:44 2026 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 1D61BC77B7E for ; Thu, 1 Jun 2023 21:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232084AbjFAVZm (ORCPT ); Thu, 1 Jun 2023 17:25:42 -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 ); 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 ; 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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeluddgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghm ihcuofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinh hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejffejgffgueegudevvdejkefg hefghffhffejteekleeufeffteffhfdtudehteenucevlhhushhtvghrufhiiigvpedune curfgrrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhg shhlrggsrdgtohhm X-ME-Proxy: 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 To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Cc: Demi Marie Obenour , 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- 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..adf0c4becc743e4ad59e1d6b0ef= 108ddd56f207d 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; } =20 - if (strcmp(name, DM_CONTROL_NODE) =3D=3D 0) { - DMERR("device name cannot be \"%s\"", DM_CONTROL_NODE); + if (strcmp(name, DM_CONTROL_NODE) =3D=3D 0 || + strcmp(name, ".") =3D=3D 0 || + strcmp(name, "..") =3D=3D 0) { + DMERR("device name cannot be \"%s\", \".\", or \"..\"", DM_CONTROL_NODE); return -EINVAL; } =20 --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab