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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E738C33CB6 for ; Thu, 16 Jan 2020 17:56:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD6932077B for ; Thu, 16 Jan 2020 17:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579197380; bh=ujVdl9VB2s0NJ0OplB8+AK6AmULobBzuKgxgojeVXDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lXp4ly7Zkj57dk0lRA+f9xtQlT5IxIh6oDFHIKnraJgVu8qZo8nB7HWLHQCVLc84z fXWwUr9hMY98+0PgHTig6HhP26QfHKE3+d0eud6Zw5XLUlZVGVulXGycTYU27V5nOp +Yf1BxjD10l9wKP1StwvkUfNlspWDnhrr4hR+P2Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394060AbgAPR4Q (ORCPT ); Thu, 16 Jan 2020 12:56:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:34576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394048AbgAPRn7 (ORCPT ); Thu, 16 Jan 2020 12:43:59 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5A1052469C; Thu, 16 Jan 2020 17:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579196639; bh=ujVdl9VB2s0NJ0OplB8+AK6AmULobBzuKgxgojeVXDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XTe3tv6en8eW8/urjxLeL5IEujAQjI2KJewtgXgZB5y0Y/CDEKKGboe7bEn7Y6c7q 7bk85MofKVJqKW4lx6rnd7CZiHp3EEF9wXmda0YFDKGF/guiWcC3ewHN0gorxVhWGK N7OPV0FgdP2ZLupFRGlr9h8zWTUk7v40rQ4NDBiw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Eric W. Biederman" , Trond Myklebust , Sasha Levin , linux-nfs@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 051/174] fs/nfs: Fix nfs_parse_devname to not modify it's argument Date: Thu, 16 Jan 2020 12:40:48 -0500 Message-Id: <20200116174251.24326-51-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116174251.24326-1-sashal@kernel.org> References: <20200116174251.24326-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "Eric W. Biederman" [ Upstream commit 40cc394be1aa18848b8757e03bd8ed23281f572e ] In the rare and unsupported case of a hostname list nfs_parse_devname will modify dev_name. There is no need to modify dev_name as the all that is being computed is the length of the hostname, so the computed length can just be shorted. Fixes: dc04589827f7 ("NFS: Use common device name parsing logic for NFSv4 and NFSv2/v3") Signed-off-by: "Eric W. Biederman" Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index dced329a8584..47a7751146cf 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1901,7 +1901,7 @@ static int nfs_parse_devname(const char *dev_name, /* kill possible hostname list: not supported */ comma = strchr(dev_name, ','); if (comma != NULL && comma < end) - *comma = 0; + len = comma - dev_name; } if (len > maxnamlen) -- 2.20.1