From patchwork Tue May 31 18:19:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Groshans X-Patchwork-Id: 833202 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4VIKMDc005778 for ; Tue, 31 May 2011 18:20:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753203Ab1EaSUV (ORCPT ); Tue, 31 May 2011 14:20:21 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:49333 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766Ab1EaSUV (ORCPT ); Tue, 31 May 2011 14:20:21 -0400 Received: by gyd10 with SMTP id 10so1876601gyd.19 for ; Tue, 31 May 2011 11:20:20 -0700 (PDT) Received: by 10.90.238.14 with SMTP id l14mr5424493agh.8.1306866020666; Tue, 31 May 2011 11:20:20 -0700 (PDT) Received: from [141.212.112.44] (moscow.citi.umich.edu [141.212.112.44]) by mx.google.com with ESMTPS id f2sm187040ani.45.2011.05.31.11.20.19 (version=SSLv3 cipher=OTHER); Tue, 31 May 2011 11:20:19 -0700 (PDT) Message-ID: <4DE53146.3030208@umich.edu> Date: Tue, 31 May 2011 14:19:50 -0400 From: Michael Groshans User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: linux-nfs@vger.kernel.org Subject: [PATCH] pnfsd: Prevent ipv6 address truncation in /proc/fs/nfsd/pnfs_dlm_device Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 31 May 2011 18:20:23 +0000 (UTC) From: Michael Groshans ipv6 addresses in /proc/fs/nfsd/pnfs_dlm_device were being truncated because the length was determined by looking for the next colon. Changed to use strlen() instead. Signed-off by: Michael Groshans --- fs/nfsd/nfs4pnfsdlm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c index 006ded5..0068ba0 100644 --- a/fs/nfsd/nfs4pnfsdlm.c +++ b/fs/nfsd/nfs4pnfsdlm.c @@ -165,7 +165,7 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len) /* data server list */ /* FIXME: need to check for comma separated valid ip format */ - len = strcspn(bufp, ":"); + len = strlen(bufp); if (len > NFSD_DLM_DS_LIST_MAX) goto out_free; memcpy(new->ds_list, bufp, len);