-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove iov_iter_advance() from iter_read #11378
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's no need to call iov_iter_advance() in zpl_iter_read(). This was preserved from the previous code where it wasn't needed but also didn't cause any problems. Now that the iter functions also handle pipes that's no longer. When fully reading a pipe buffer iov_iter_advance() may results in the pipe buf release function being called which will not be registered resulting in a NULL dereference. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 tasks
behlendorf
added
Status: Accepted
Ready to integrate (reviewed, tested)
and removed
Status: Code Review Needed
Ready for review and testing
labels
Dec 20, 2020
behlendorf
added a commit
that referenced
this pull request
Dec 23, 2020
There's no need to call iov_iter_advance() in zpl_iter_read(). This was preserved from the previous code where it wasn't needed but also didn't cause any problems. Now that the iter functions also handle pipes that's no longer the case. When fully reading a pipe buffer iov_iter_advance() may results in the pipe buf release function being called which will not be registered resulting in a NULL dereference. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #11375 Closes #11378
jsai20
pushed a commit
to jsai20/zfs
that referenced
this pull request
Mar 30, 2021
There's no need to call iov_iter_advance() in zpl_iter_read(). This was preserved from the previous code where it wasn't needed but also didn't cause any problems. Now that the iter functions also handle pipes that's no longer the case. When fully reading a pipe buffer iov_iter_advance() may results in the pipe buf release function being called which will not be registered resulting in a NULL dereference. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11375 Closes openzfs#11378
rincebrain
added a commit
to rincebrain/zfs
that referenced
this pull request
May 29, 2021
It seems like this should have gone with openzfs#11378. Closes: openzfs#12041 Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
13 tasks
rincebrain
added a commit
to rincebrain/zfs
that referenced
this pull request
May 30, 2021
It seems like this should have gone with openzfs#11378. The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. Closes: openzfs#12041 Suggested-by: @siebenmann Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
sempervictus
pushed a commit
to sempervictus/zfs
that referenced
this pull request
May 31, 2021
There's no need to call iov_iter_advance() in zpl_iter_read(). This was preserved from the previous code where it wasn't needed but also didn't cause any problems. Now that the iter functions also handle pipes that's no longer the case. When fully reading a pipe buffer iov_iter_advance() may results in the pipe buf release function being called which will not be registered resulting in a NULL dereference. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11375 Closes openzfs#11378
behlendorf
pushed a commit
that referenced
this pull request
Jun 1, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with #11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue #11378 Closes #12041 Closes #12155
13 tasks
tonyhutter
pushed a commit
that referenced
this pull request
Jun 2, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with #11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue #11378 Closes #12041 Closes #12155 (cherry picked from commit 3f81aba) Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev>
tonyhutter
pushed a commit
to tonyhutter/zfs
that referenced
this pull request
Jun 2, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with openzfs#11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue openzfs#11378 Closes openzfs#12041 Closes openzfs#12155 (cherry picked from commit 3f81aba) Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev>
behlendorf
pushed a commit
to behlendorf/zfs
that referenced
this pull request
Jun 3, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with openzfs#11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue openzfs#11378 Closes openzfs#12041 Closes openzfs#12155
behlendorf
pushed a commit
to behlendorf/zfs
that referenced
this pull request
Jun 8, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with openzfs#11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue openzfs#11378 Closes openzfs#12041 Closes openzfs#12155
behlendorf
pushed a commit
to behlendorf/zfs
that referenced
this pull request
Jun 9, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with openzfs#11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue openzfs#11378 Closes openzfs#12041 Closes openzfs#12155
tonyhutter
pushed a commit
that referenced
this pull request
Jun 23, 2021
The additional iter advance is incorrect, as copy_from_iter() has already done the right thing. This will result in the following warning being printed to the console as of the 5.12 kernel. Attempted to advance past end of bvec iter This change should have been included with #11378 when a similar change was made on the read side. Suggested-by: @siebenmann Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Issue #11378 Closes #12041 Closes #12155 (cherry picked from commit 3f81aba) Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Issue #11375
Description
There's no need to call iov_iter_advance() in zpl_iter_read().
This was preserved from the previous code where it wasn't needed
but also didn't cause any problems. Now that the iter functions
also handle pipes that's no longer true. When fully reading a pipe
buffer iov_iter_advance() may result in the pipe buf release
function being called which will not be registered resulting in
a NULL dereference.
How Has This Been Tested?
The usual local ZTS run and xfstests which lightly exercise sendfile.
Since the issue was reported with
pip
I ran through installingand uninstalling various packages to a home directory using ZFS.
No issues were observed and the installed packages worked
correctly in my testing.
For good measure I also checkout out the ZFS source and built
ZFS with gcc in a ZFS filesystem. No errors were reported and
the resulting kmods worked correctly. This was just a convenient
way to verify the correct behavior of a fairly wide range of utilities.
Types of changes
Checklist:
Signed-off-by
.