diff options
-rw-r--r-- | fs/nfs/super.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 11ab7ff6e087..13a3ab30b143 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1100,6 +1100,10 @@ static int nfs_validate_mount_data(void *options, | |||
1100 | if (mntfh->size < sizeof(mntfh->data)) | 1100 | if (mntfh->size < sizeof(mntfh->data)) |
1101 | memset(mntfh->data + mntfh->size, 0, | 1101 | memset(mntfh->data + mntfh->size, 0, |
1102 | sizeof(mntfh->data) - mntfh->size); | 1102 | sizeof(mntfh->data) - mntfh->size); |
1103 | |||
1104 | if (!nfs_verify_server_address((struct sockaddr *) &data->addr)) | ||
1105 | goto out_no_address; | ||
1106 | |||
1103 | /* | 1107 | /* |
1104 | * Translate to nfs_parsed_mount_data, which nfs_fill_super | 1108 | * Translate to nfs_parsed_mount_data, which nfs_fill_super |
1105 | * can deal with. | 1109 | * can deal with. |
@@ -1131,6 +1135,10 @@ static int nfs_validate_mount_data(void *options, | |||
1131 | if (nfs_parse_mount_options((char *)options, args) == 0) | 1135 | if (nfs_parse_mount_options((char *)options, args) == 0) |
1132 | return -EINVAL; | 1136 | return -EINVAL; |
1133 | 1137 | ||
1138 | if (!nfs_verify_server_address((struct sockaddr *) | ||
1139 | &args->nfs_server.address)) | ||
1140 | goto out_no_address; | ||
1141 | |||
1134 | c = strchr(dev_name, ':'); | 1142 | c = strchr(dev_name, ':'); |
1135 | if (c == NULL) | 1143 | if (c == NULL) |
1136 | return -EINVAL; | 1144 | return -EINVAL; |
@@ -1159,10 +1167,6 @@ static int nfs_validate_mount_data(void *options, | |||
1159 | goto out_v3_not_compiled; | 1167 | goto out_v3_not_compiled; |
1160 | #endif /* !CONFIG_NFS_V3 */ | 1168 | #endif /* !CONFIG_NFS_V3 */ |
1161 | 1169 | ||
1162 | if (!nfs_verify_server_address((struct sockaddr *) | ||
1163 | &args->nfs_server.address)) | ||
1164 | goto out_no_address; | ||
1165 | |||
1166 | return 0; | 1170 | return 0; |
1167 | 1171 | ||
1168 | out_no_data: | 1172 | out_no_data: |