[SRU][Artful][PATCH 0/1] iov_iter: fix page_copy_sane for compound pages

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Artful][PATCH 0/1] iov_iter: fix page_copy_sane for compound pages

Joseph Salisbury-3
BugLink: http://bugs.launchpad.net/bugs/1772031

== SRU Justification ==
Artful is missing commit a90bcb86ae70, which was sent
to upstream stable.  Since upstream 4.13 is EOL, Artful never got it.

Because Artful does not have this commit when receiving large UDP packages
with a small MTU there are backtraces, examples posted in the bug.

Commit a90bcb86ae70 is in mainline as ov v4.14-rc2 and is only needed in
Artful.

== Fix ==
a90bcb86ae70 ("iov_iter: fix page_copy_sane for compound pages")

== Regression Potential ==
Low.  This commit fixes a current regression in Artful.  It was also
cc'd to stable, so it has had additional upstream review.

== Test Case ==
A test kernel was built with this patch and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.


Petar Penkov (1):
  iov_iter: fix page_copy_sane for compound pages

 lib/iov_iter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Artful][PATCH 1/1] iov_iter: fix page_copy_sane for compound pages

Joseph Salisbury-3
From: Petar Penkov <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1772031

Issue is that if the data crosses a page boundary inside a compound
page, this check will incorrectly trigger a WARN_ON.

To fix this, compute the order using the head of the compound page and
adjust the offset to be relative to that head.

Fixes: 72e809ed81ed ("iov_iter: sanity checks for copy to/from page
primitives")

Signed-off-by: Petar Penkov <[hidden email]>
CC: Al Viro <[hidden email]>
CC: Eric Dumazet <[hidden email]>
Signed-off-by: Al Viro <[hidden email]>
(cherry picked from commit a90bcb86ae700c12432446c4aa1819e7b8e172ec)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 lib/iov_iter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 52c8dd6..1c1c06d 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -687,8 +687,10 @@ EXPORT_SYMBOL(_copy_from_iter_full_nocache);
 
 static inline bool page_copy_sane(struct page *page, size_t offset, size_t n)
 {
- size_t v = n + offset;
- if (likely(n <= v && v <= (PAGE_SIZE << compound_order(page))))
+ struct page *head = compound_head(page);
+ size_t v = n + offset + page_address(page) - page_address(head);
+
+ if (likely(n <= v && v <= (PAGE_SIZE << compound_order(head))))
  return true;
  WARN_ON(1);
  return false;
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Artful][PATCH 1/1] iov_iter: fix page_copy_sane for compound pages

Kleber Sacilotto de Souza
On 06/01/18 09:29, Joseph Salisbury wrote:

> From: Petar Penkov <[hidden email]>
>
> BugLink: http://bugs.launchpad.net/bugs/1772031
>
> Issue is that if the data crosses a page boundary inside a compound
> page, this check will incorrectly trigger a WARN_ON.
>
> To fix this, compute the order using the head of the compound page and
> adjust the offset to be relative to that head.
>
> Fixes: 72e809ed81ed ("iov_iter: sanity checks for copy to/from page
> primitives")
>
> Signed-off-by: Petar Penkov <[hidden email]>
> CC: Al Viro <[hidden email]>
> CC: Eric Dumazet <[hidden email]>
> Signed-off-by: Al Viro <[hidden email]>
> (cherry picked from commit a90bcb86ae700c12432446c4aa1819e7b8e172ec)
> Signed-off-by: Joseph Salisbury <[hidden email]>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

> ---
>  lib/iov_iter.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/iov_iter.c b/lib/iov_iter.c
> index 52c8dd6..1c1c06d 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -687,8 +687,10 @@ EXPORT_SYMBOL(_copy_from_iter_full_nocache);
>  
>  static inline bool page_copy_sane(struct page *page, size_t offset, size_t n)
>  {
> - size_t v = n + offset;
> - if (likely(n <= v && v <= (PAGE_SIZE << compound_order(page))))
> + struct page *head = compound_head(page);
> + size_t v = n + offset + page_address(page) - page_address(head);
> +
> + if (likely(n <= v && v <= (PAGE_SIZE << compound_order(head))))
>   return true;
>   WARN_ON(1);
>   return false;
>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Artful][PATCH 0/1] iov_iter: fix page_copy_sane for compound pages

Khaled Elmously
In reply to this post by Joseph Salisbury-3
On 2018-06-01 12:29:36 , Joseph Salisbury wrote:

> BugLink: http://bugs.launchpad.net/bugs/1772031
>
> == SRU Justification ==
> Artful is missing commit a90bcb86ae70, which was sent
> to upstream stable.  Since upstream 4.13 is EOL, Artful never got it.
>
> Because Artful does not have this commit when receiving large UDP packages
> with a small MTU there are backtraces, examples posted in the bug.
>
> Commit a90bcb86ae70 is in mainline as ov v4.14-rc2 and is only needed in
> Artful.
>
> == Fix ==
> a90bcb86ae70 ("iov_iter: fix page_copy_sane for compound pages")
>
> == Regression Potential ==
> Low.  This commit fixes a current regression in Artful.  It was also
> cc'd to stable, so it has had additional upstream review.
>
> == Test Case ==
> A test kernel was built with this patch and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
>
>
> Petar Penkov (1):
>   iov_iter: fix page_copy_sane for compound pages
>
>  lib/iov_iter.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
Acked-by: Khalid Elmously <[hidden email]>
 

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][Artful][PATCH 0/1] iov_iter: fix page_copy_sane for compound pages

Khaled Elmously
In reply to this post by Joseph Salisbury-3
Applied to artful

On 2018-06-01 12:29:36 , Joseph Salisbury wrote:

> BugLink: http://bugs.launchpad.net/bugs/1772031
>
> == SRU Justification ==
> Artful is missing commit a90bcb86ae70, which was sent
> to upstream stable.  Since upstream 4.13 is EOL, Artful never got it.
>
> Because Artful does not have this commit when receiving large UDP packages
> with a small MTU there are backtraces, examples posted in the bug.
>
> Commit a90bcb86ae70 is in mainline as ov v4.14-rc2 and is only needed in
> Artful.
>
> == Fix ==
> a90bcb86ae70 ("iov_iter: fix page_copy_sane for compound pages")
>
> == Regression Potential ==
> Low.  This commit fixes a current regression in Artful.  It was also
> cc'd to stable, so it has had additional upstream review.
>
> == Test Case ==
> A test kernel was built with this patch and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
>
>
> Petar Penkov (1):
>   iov_iter: fix page_copy_sane for compound pages
>
>  lib/iov_iter.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team