mm: /proc/pid/smaps_rollup: fix no vma's null-deref
PATCH 1/1 mm: /proc/pid/smaps_rollup: fix no vma's null-deref
Commit 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file") introduced a null-deref if there are no vma's in the task in show_smaps_rollup.
---c4c84f06285e on upstream resolves this issue, but a fix must still be applied to stable trees 4.19-5.19.
fs/proc/task_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/task_mmu.c +1 -1
@@ -969,7 +969,7 @@ static int show_smaps_rollup(struct seq_file *m, void *v) vma = vma->vm_next; } -show_vma_header_prefix (m, priv->mm->mmap->vm_start, +show_vma_header_prefix (m, priv->mm->mmap ? priv->mm->mmap->vm_start :0 , last_vma_end,0 ,0 ,0 ,0 );seq_pad (m,' ' );seq_puts (m,"[rollup]\n" );
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
Greg KH
maintainerQuoted 10 lines · Seth Jenkins
Commit
258f669e7e88("mm:/proc/pid/smaps_rollup: convert to single valueseq_file") introduced a null-deref if there are no vma's in the task inshow_smaps_rollup.Fixes 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file")Signed-off-by Seth Jenkins <[email protected]>Reviewed-by Alexey Dobriyan <[email protected]>Tested-by Alexey Dobriyan <[email protected]>---
c4c84f06285eon upstream resolves this issue, but a fix must still be applied to stable trees 4.19-5.19.
And you need to document really really really well why we can not take that upstream commit please.
Also note that 5.19.y is end-of-life.
Please fix up and resend.
thanks,
greg k-h
Hi Greg,
The upstream commit that fixed the issue was not an intentional fix AFAIK, but a refactor to switch to maple tree VMA lookups. I was under the impression that there were no plans to backport maple trees back to stable trees but do let me know if that presumption is incorrect. Assuming they're not getting backported, what do you think of this instead:c4c84f06285e on upstream resolves this issue as part of the switch to using maple trees for VMA lookups, but a fix must still be applied to stable trees 4.19-5.19.
Quoted 23 lines · Greg KH
Quoted 10 lines · Seth Jenkins
Commit
258f669e7e88("mm:/proc/pid/smaps_rollup: convert to single valueseq_file") introduced a null-deref if there are no vma's in the task inshow_smaps_rollup.Fixes 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file")Signed-off-by Seth Jenkins <[email protected]>Reviewed-by Alexey Dobriyan <[email protected]>Tested-by Alexey Dobriyan <[email protected]>---
c4c84f06285eon upstream resolves this issue, but a fix must still be applied to stable trees 4.19-5.19.And you need to document really really really well why we can not take that upstream commit please.
Also note that 5.19.y is end-of-life.
Please fix up and resend.
thanks,
greg k-h
Quoted 6 lines · Seth Jenkins
Hi Greg,
The upstream commit that fixed the issue was not an intentional fix AFAIK, but a refactor to switch to maple tree VMA lookups. I was under the impression that there were no plans to backport maple trees back to stable trees but do let me know if that presumption is incorrect.
Backporting the maple tree to earlier kernels would be a giant upheaval. I doubt it could ever be justified; certainly the need for this patch would not be sufficient. Not only would we have to backport the maple tree data structure itself (which could be justified), but we'd also have to redo the conversion of the VMAs from rbtree to maple tree.
Quoted 30 lines
Assuming they're not getting backported, what do you think of this instead:
c4c84f06285eon upstream resolves this issue as part of the switch to using maple trees for VMA lookups, but a fix must still be applied to stable trees 4.19-5.19.Quoted 23 lines · Greg KH
Quoted 10 lines · Seth Jenkins
Commit
258f669e7e88("mm:/proc/pid/smaps_rollup: convert to single valueseq_file") introduced a null-deref if there are no vma's in the task inshow_smaps_rollup.Fixes 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file")Signed-off-by Seth Jenkins <[email protected]>Reviewed-by Alexey Dobriyan <[email protected]>Tested-by Alexey Dobriyan <[email protected]>---
c4c84f06285eon upstream resolves this issue, but a fix must still be applied to stable trees 4.19-5.19.And you need to document really really really well why we can not take that upstream commit please.
Also note that 5.19.y is end-of-life.
Please fix up and resend.
thanks,
greg k-h
Greg KH
maintainerA: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
Quoted 8 lines · Seth Jenkins
Hi Greg,
The upstream commit that fixed the issue was not an intentional fix AFAIK, but a refactor to switch to maple tree VMA lookups. I was under the impression that there were no plans to backport maple trees back to stable trees but do let me know if that presumption is incorrect. Assuming they're not getting backported, what do you think of this instead:
Yes, as Matthew said, backporting maple trees is not a good idea, we don't want that.
Quoted 3 lines
c4c84f06285eon upstream resolves this issue as part of the switch to using maple trees for VMA lookups, but a fix must still be applied to stable trees 4.19-5.19.
That's better, yes. Please add that and resend a new version.
thanks,
greg k-h