Skip to contentSkip to conversation

pnfs server data server list

DISCUSSION J. Bruce Fields 2 participants 2 messages Jun 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

We were just noticing that the pnfs/gfs2 code stores the data server list as a comma-delimited string of ip addresses.

That string is passed from userspace without any validation--as far as I can tell, if the adminstrator passes in random data, that random data will get handed to the client as is.

It would be better to validate that data when it's written to the /proc/fs/nfsd/ file--if for no other reason than to give administrators better error messages.

While we're at it: should we just store the thing as a list of sockaddr's instead of as a string?

I figure that would:
- guarantee we never forget to validate the input; and
- be more useful if we eventually use them as addresses in the kernel (e.g. for MDS<->DS protocol; does anyone have a prototype design for that?).

But it means some more work converting back and forth (since getdeviceinfo still needs the addresses as strings).

--b.

#1 lore raw
Quoted 6 lines · J. Bruce Fields

We were just noticing that the pnfs/gfs2 code stores the data server list as a comma-delimited string of ip addresses.

That string is passed from userspace without any validation--as far as I can tell, if the adminstrator passes in random data, that random data will get handed to the client as is.

Yes, the validation code was never written.

Quoted 4 lines

It would be better to validate that data when it's written to the /proc/fs/nfsd/ file--if for no other reason than to give administrators better error messages.

Yes, that is where validation should occur, in nfsd4_set_pnfs_dlm_device.

Quoted 4 lines

While we're at it: should we just store the thing as a list of sockaddr's instead of as a string?

Quoted 8 lines

I figure that would:
- guarantee we never forget to validate the input; and
- be more useful if we eventually use them as addresses in the kernel (e.g. for MDS<->DS protocol; does anyone have a prototype design for that?).

But it means some more work converting back and forth (since getdeviceinfo still needs the addresses as strings).

If validation occurs in nfsd4_set_pnfs_dlm_device then it is guaranteed that we never forget to validate the input. As for the sockaddr form being more useful for the yet-to-be designed (much less written) MDS<->DS protocol, don't bother until needed!

I vote for validation in nfsd4_set_pnfs_dlm_device and leaving it a comma-delimited string.

-->Andy

Quoted 6 lines

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html