diff mbox

rpc.mountd: Remove duplicate and invalid secinfo setting

Message ID 552FB045.80604@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kinglong Mee April 16, 2015, 12:51 p.m. UTC
NFSD return reply of client's SECINFO_NO_NAME request with four
security information number as, 1 1 0 0

It's caused by commit 4a1ad4aa30,
"mountd: Enable all auth flavors on pseudofs exports"

This patch removes duplicate secinfo and invalid secinfo (zero).

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 support/nfs/exports.c | 2 +-
 utils/mountd/v4root.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Scott Mayhew April 17, 2015, 6:15 p.m. UTC | #1
On Thu, 16 Apr 2015, Kinglong Mee wrote:

> NFSD return reply of client's SECINFO_NO_NAME request with four
> security information number as, 1 1 0 0
> 
> It's caused by commit 4a1ad4aa30,
> "mountd: Enable all auth flavors on pseudofs exports"
> 
> This patch removes duplicate secinfo and invalid secinfo (zero).
> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>

This is because flav_map has both AUTH_UNIX/AUTH_SYS and
AUTH_NULL/AUTH_NONE.  I had discussed it with Steve, but since I didn't
observe any problems caused by it in my testing I just left them in.

Acked-by: Scott Mayhew <smayhew@redhat.com>

> ---
>  support/nfs/exports.c | 2 +-
>  utils/mountd/v4root.c | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/support/nfs/exports.c b/support/nfs/exports.c
> index 761a046..0aea6f1 100644
> --- a/support/nfs/exports.c
> +++ b/support/nfs/exports.c
> @@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
>  	struct sec_entry *p;
>  
>  	for (p=ep->e_secinfo; p->flav; p++) {
> -		if (p->flav == flav)
> +		if (p->flav == flav || p->flav->fnum == flav->fnum)
>  			return p - ep->e_secinfo;
>  	}
>  	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
> diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c
> index 429ebb8..d521725 100644
> --- a/utils/mountd/v4root.c
> +++ b/utils/mountd/v4root.c
> @@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
>  	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
>  		struct sec_entry *new;
>  
> +		if (!flav->fnum)
> +			continue;
> +
>  		i = secinfo_addflavor(flav, pseudo);
>  		new = &pseudo->e_secinfo[i];
>  
> -- 
> 2.3.5
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kinglong Mee May 6, 2015, 1:38 p.m. UTC | #2
On 4/18/2015 2:15 AM, Scott Mayhew wrote:
> On Thu, 16 Apr 2015, Kinglong Mee wrote:
> 
>> NFSD return reply of client's SECINFO_NO_NAME request with four
>> security information number as, 1 1 0 0
>>
>> It's caused by commit 4a1ad4aa30,
>> "mountd: Enable all auth flavors on pseudofs exports"
>>
>> This patch removes duplicate secinfo and invalid secinfo (zero).
>>
>> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> 
> This is because flav_map has both AUTH_UNIX/AUTH_SYS and
> AUTH_NULL/AUTH_NONE.  I had discussed it with Steve, but since I didn't
> observe any problems caused by it in my testing I just left them in.
> 
> Acked-by: Scott Mayhew <smayhew@redhat.com>

Also, this one?

thanks,
Kinglong Mee

> 
>> ---
>>  support/nfs/exports.c | 2 +-
>>  utils/mountd/v4root.c | 3 +++
>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/support/nfs/exports.c b/support/nfs/exports.c
>> index 761a046..0aea6f1 100644
>> --- a/support/nfs/exports.c
>> +++ b/support/nfs/exports.c
>> @@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
>>  	struct sec_entry *p;
>>  
>>  	for (p=ep->e_secinfo; p->flav; p++) {
>> -		if (p->flav == flav)
>> +		if (p->flav == flav || p->flav->fnum == flav->fnum)
>>  			return p - ep->e_secinfo;
>>  	}
>>  	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
>> diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c
>> index 429ebb8..d521725 100644
>> --- a/utils/mountd/v4root.c
>> +++ b/utils/mountd/v4root.c
>> @@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
>>  	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
>>  		struct sec_entry *new;
>>  
>> +		if (!flav->fnum)
>> +			continue;
>> +
>>  		i = secinfo_addflavor(flav, pseudo);
>>  		new = &pseudo->e_secinfo[i];
>>  
>> -- 
>> 2.3.5
>>
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Dickson May 7, 2015, 2:17 p.m. UTC | #3
On 04/16/2015 08:51 AM, Kinglong Mee wrote:
> NFSD return reply of client's SECINFO_NO_NAME request with four
> security information number as, 1 1 0 0
> 
> It's caused by commit 4a1ad4aa30,
> "mountd: Enable all auth flavors on pseudofs exports"
> 
> This patch removes duplicate secinfo and invalid secinfo (zero).
> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  support/nfs/exports.c | 2 +-
>  utils/mountd/v4root.c | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
Committed... 

steved.

> 
> diff --git a/support/nfs/exports.c b/support/nfs/exports.c
> index 761a046..0aea6f1 100644
> --- a/support/nfs/exports.c
> +++ b/support/nfs/exports.c
> @@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
>  	struct sec_entry *p;
>  
>  	for (p=ep->e_secinfo; p->flav; p++) {
> -		if (p->flav == flav)
> +		if (p->flav == flav || p->flav->fnum == flav->fnum)
>  			return p - ep->e_secinfo;
>  	}
>  	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
> diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c
> index 429ebb8..d521725 100644
> --- a/utils/mountd/v4root.c
> +++ b/utils/mountd/v4root.c
> @@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
>  	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
>  		struct sec_entry *new;
>  
> +		if (!flav->fnum)
> +			continue;
> +
>  		i = secinfo_addflavor(flav, pseudo);
>  		new = &pseudo->e_secinfo[i];
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index 761a046..0aea6f1 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -408,7 +408,7 @@  int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
 	struct sec_entry *p;
 
 	for (p=ep->e_secinfo; p->flav; p++) {
-		if (p->flav == flav)
+		if (p->flav == flav || p->flav->fnum == flav->fnum)
 			return p - ep->e_secinfo;
 	}
 	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c
index 429ebb8..d521725 100644
--- a/utils/mountd/v4root.c
+++ b/utils/mountd/v4root.c
@@ -69,6 +69,9 @@  set_pseudofs_security(struct exportent *pseudo, int flags)
 	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
 		struct sec_entry *new;
 
+		if (!flav->fnum)
+			continue;
+
 		i = secinfo_addflavor(flav, pseudo);
 		new = &pseudo->e_secinfo[i];