Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfs_mount ignores FSINFO RPC failures #210

Closed
earlchew opened this issue May 10, 2017 · 3 comments
Closed

nfs_mount ignores FSINFO RPC failures #210

earlchew opened this issue May 10, 2017 · 3 comments

Comments

@earlchew
Copy link
Contributor

During nfs_mount(), an FSINFO RPC is used to determine the characteristics of the remote file system. The results of the RPC are used without first checking if the RPC succeeded.

@earlchew
Copy link
Contributor Author

This one was reproducible with effort, but took a fair amount of time to pin down.

@sahlberg
Copy link
Owner

Merged.

How did you reproduce this? I think the decode buffer is guaranteed to be zeroed out when the original request pdu is allocated. Thus read max and write max should read out as zero and then you other change to check for the min should catch this?

@earlchew
Copy link
Contributor Author

I used a live reproduction in which I have a unit test written for an application that performs a mount, a small amount of IO, and some directory operations. The unit test is mostly intended to test application behaviour, but in this case is useful for verifying operation (in a limited scenario) of libnfs. In this case, libnfs is used to connect to a storage cluster, and to obtain test scenario coverage, the test also involves failing the connection to the storage cluster network. Carnage from the latter triggers this failure.

Generally speaking, my experience has been that relying on actual faults to exercise infrequently used code paths is not very effective. It requires a lot of effort to get a good amount of coverage. For other projects recently, I prefer to use direct software fault simulation in order to force threads of execution to take under-used code paths. Once configured, I have found that it is possible to get good coverage for little ongoing effort.

I think the decode buffer is guaranteed to be zeroed out when the original request pdu is allocated. Thus read max and write max should read out as zero and then you other change to check for the min should catch this?

You are right. Without those changes, this defect might have manifested as a division by zero, but instead shows its hand as the application allocating all the the memory available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants