On Tue, 17 Jun 2008, Linus Torvalds wrote:Bron, does this untested patch hide the bug? I don't think this patch is correct, because it doesn't really fix the basic issue (the code should do the right thing even if a page isn't there), but it might hide it by faulting in the whole "bytes" range rather than just the first iov. So Nick, it's still over to you, but if this does hide it, then that's an interesting detail in itself. Linus --- mm/filemap.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 1e6a7d3..0080a27 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1808,9 +1808,20 @@ EXPORT_SYMBOL(iov_iter_advance); */ int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) { - char __user *buf = i->iov->iov_base + i->iov_offset; - bytes = min(bytes, i->iov->iov_len - i->iov_offset); - return fault_in_pages_readable(buf, bytes); + unsigned long offset = i->iov_offset; + const struct iovec *iov = i->iov; + + while (bytes) { + char __user *buf = iov->iov_base + offset; + size_t n = min(bytes, iov->iov_len - offset); + + if (fault_in_pages_readable(buf, n)) + return -EFAULT; + bytes -= n; + offset = 0; + iov++; + } + return 0; } EXPORT_SYMBOL(iov_iter_fault_in_readable); --
| Stephen Smalley | Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
git: | |
| David Fenyes | sigsetmask()? (LINUX) |
| Stephen Tweedie | Unmounting root (no kidding!) [was: Some Linux problems---solved] |
| Les Andrzejewski | X386/WD90C31/SUMSUNG SYNC MASTER 4 |
| Doug Evans | Re: Stabilizing Linux |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Herbert Xu | Re: [PATCH] myr10ge: again fix lro_gen_skb() alignment |
