All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <1531955428.12385.30.camel@intel.com>

diff --git a/a/content_digest b/N1/content_digest
index 3ee8761..3931750 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -32,7 +32,10 @@
   Mike Kravetz <mike.kravetz@oracle.com>
   Nadav Amit <nadav.amit@gmail.com>
   Oleg Nesterov <oleg@redhat.com>
- " Pavel Machek <pavel@ucw.cz>Peter\0"
+  Pavel Machek <pavel@ucw.cz>
+  Peter Zijlstra <peterz@infradead.org>
+  Ravi V. Shankar <ravi.v.shankar@intel.com>
+ " Vedvyas Shanbhogue <vedvyas.shanbhogue@intel.com>\0"
  "\00:1\0"
  "b\0"
  "On Wed, 2018-07-18 at 14:45 -0700, Dave Hansen wrote:\n"
@@ -219,4 +222,4 @@
  "\n"
  Yu-cheng
 
-22ac8be111ef0e340b8a47d3ba9c9418fe12a713964728f65d567446a90abdba
+50b0accdf31e684d69dbac8b05dbfa48374c0453814953114bed8a0fa3892dec

diff --git a/a/1.txt b/N2/1.txt
index 84ddad7..87efa05 100644
--- a/a/1.txt
+++ b/N2/1.txt
@@ -181,3 +181,7 @@ pte_write() any more.
 Ok, I will change it.
 
 Yu-cheng
+--
+To unsubscribe from this list: send the line "unsubscribe linux-doc" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff --git a/a/content_digest b/N2/content_digest
index 3ee8761..ad55278 100644
--- a/a/content_digest
+++ b/N2/content_digest
@@ -32,7 +32,10 @@
   Mike Kravetz <mike.kravetz@oracle.com>
   Nadav Amit <nadav.amit@gmail.com>
   Oleg Nesterov <oleg@redhat.com>
- " Pavel Machek <pavel@ucw.cz>Peter\0"
+  Pavel Machek <pavel@ucw.cz>
+  Peter Zijlstra <peterz@infradead.org>
+  Ravi V. Shankar <ravi.v.shankar@intel.com>
+ " Vedvyas Shanbhogue <vedvyas.shanbhogue@intel.com>\0"
  "\00:1\0"
  "b\0"
  "On Wed, 2018-07-18 at 14:45 -0700, Dave Hansen wrote:\n"
@@ -217,6 +220,10 @@
  "\n"
  "Ok, I will change it.\n"
  "\n"
- Yu-cheng
+ "Yu-cheng\n"
+ "--\n"
+ "To unsubscribe from this list: send the line \"unsubscribe linux-doc\" in\n"
+ "the body of a message to majordomo@vger.kernel.org\n"
+ More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
-22ac8be111ef0e340b8a47d3ba9c9418fe12a713964728f65d567446a90abdba
+82c14cab47f7af6ad7df6eae066b9ece5a3c30955345dadc8dd9a774b92661aa

diff --git a/a/1.txt b/N3/1.txt
index 84ddad7..6a6abb8 100644
--- a/a/1.txt
+++ b/N3/1.txt
@@ -24,8 +24,8 @@ On Wed, 2018-07-18 at 14:45 -0700, Dave Hansen wrote:
 > > 
 > > However, a shadow stack PTE is always RO & DIRTY; it can be:
 > > 
-> >   RO & DIRTY_HW - is_shstk_pte(pte) is true; or
-> >   RO & DIRTY_SW - the page is being shared.
+> > A  RO & DIRTY_HW - is_shstk_pte(pte) is true; or
+> > A  RO & DIRTY_SW - the page is being shared.
 > > 
 > > Update these functions to check a non-sharing shadow stack page
 > > still exists after the COW.
@@ -36,48 +36,48 @@ On Wed, 2018-07-18 at 14:45 -0700, Dave Hansen wrote:
 > > 
 > > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
 > > ---
-> >  mm/gup.c         | 38 ++++++++++++++++++++++++++++++++++----
-> >  mm/huge_memory.c | 19 ++++++++++++++-----
-> >  2 files changed, 48 insertions(+), 9 deletions(-)
+> > A mm/gup.cA A A A A A A A A | 38 ++++++++++++++++++++++++++++++++++----
+> > A mm/huge_memory.c | 19 ++++++++++++++-----
+> > A 2 files changed, 48 insertions(+), 9 deletions(-)
 > > 
 > > diff --git a/mm/gup.c b/mm/gup.c
 > > index fc5f98069f4e..316967996232 100644
 > > --- a/mm/gup.c
 > > +++ b/mm/gup.c
 > > @@ -63,11 +63,41 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,
-> >  /*
-> >   * FOLL_FORCE can write to even unwritable pte's, but only
-> >   * after we've gone through a COW cycle and they are dirty.
+> > A /*
+> > A  * FOLL_FORCE can write to even unwritable pte's, but only
+> > A  * after we've gone through a COW cycle and they are dirty.
 > > + *
 > > + * Background:
 > > + *
 > > + * When we force-write to a read-only page, the page fault
 > > + * handler copies the page and sets the new page's PTE to
-> > + * RO & DIRTY.  This routine tells
+> > + * RO & DIRTY.A A This routine tells
 > > + *
-> > + *     "Can we write to the page?"
+> > + *A A A A A "Can we write to the page?"
 > > + *
 > > + * by checking:
 > > + *
-> > + *     (1) The page has been copied, i.e. FOLL_COW is set;
-> > + *     (2) The copy still exists and its PTE is RO & DIRTY.
+> > + *A A A A A (1) The page has been copied, i.e. FOLL_COW is set;
+> > + *A A A A A (2) The copy still exists and its PTE is RO & DIRTY.
 > > + *
 > > + * However, a shadow stack PTE is always RO & DIRTY; it can
 > > + * be:
 > > + *
-> > + *     RO & DIRTY_HW: when is_shstk_pte(pte) is true; or
-> > + *     RO & DIRTY_SW: when the page is being shared.
+> > + *A A A A A RO & DIRTY_HW: when is_shstk_pte(pte) is true; or
+> > + *A A A A A RO & DIRTY_SW: when the page is being shared.
 > > + *
 > > + * To test a shadow stack's non-sharing page still exists,
 > > + * we verify that the new page's PTE is_shstk_pte(pte).
 > The content is getting there, but we need it next to the code, please.
 > 
 > > 
-> >   */
+> > A  */
 > > -static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
 > > +static inline bool can_follow_write(pte_t pte, unsigned int flags,
-> > +				    struct vm_area_struct *vma)
-> >  {
+> > +				A A A A struct vm_area_struct *vma)
+> > A {
 > > -	return pte_write(pte) ||
 > > -		((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
 > > +	if (!is_shstk_mapping(vma->vm_flags)) {
@@ -86,34 +86,34 @@ On Wed, 2018-07-18 at 14:45 -0700, Dave Hansen wrote:
 > Let me see if I can say this another way.
 > 
 > The bigger issue is that these patches change the semantics of
-> pte_write().  Before these patches, it meant that you *MUST* have this
-> bit set to write to the page controlled by the PTE.  Now, it means: you
+> pte_write().A A Before these patches, it meant that you *MUST* have this
+> bit set to write to the page controlled by the PTE.A A Now, it means: you
 > can write if this bit is set *OR* the shadowstack bit combination is set.
 
 Here, we only figure out (1) if the page is pointed by a writable PTE; or
 (2) if the page is pointed by a RO PTE (data or SHSTK) and it has been
-copied and it still exists.  We are not trying to
+copied and it still exists. A We are not trying to
 determine if the
 SHSTK PTE is writable (we know it is not).
 
 We look for the dirty bit to be sure the COW'ed page is still there.
 The difference for the shadow stack case is that we look for the *hardware*
-dirty bit.  Perhaps we can create another macro, pte_ro_dirty_hw(), which
+dirty bit. A Perhaps we can create another macro, pte_ro_dirty_hw(), which
 is equivalent to is_shstk_pte().
 
 > 
-> That's the fundamental problem.  We need some code in the kernel that
+> That's the fundamental problem.A A We need some code in the kernel that
 > logically represents the concept of "is this PTE a shadowstack PTE or a
 > PTE with the write bit set", and we will call that pte_write(), or maybe
 > pte_writable().
 > 
-> You *have* to somehow rectify this situation.  We can absolutely no
+> You *have* to somehow rectify this situation.A A We can absolutely no
 > leave pte_write() in its current, ambiguous state where it has no real
 > meaning or where it is used to mean _both_ things depending on context.
 
 True, the processor can always write to a page through a shadow stack
-PTE, but it must do that with a CALL instruction.  Can we define a 
-write operation as: MOV r1, *(r2).  Then we don't have any doubt on
+PTE, but it must do that with a CALL instruction. A Can we define aA 
+write operation as: MOV r1, *(r2). A Then we don't have any doubt on
 pte_write() any more.
 
 > 
@@ -124,34 +124,34 @@ pte_write() any more.
 > > +		return ((flags & FOLL_FORCE) && (flags & FOLL_COW) &&
 > > +			is_shstk_pte(pte));
 > > +	}
-> >  }
+> > A }
 > Ok, it's rewrite time I guess.
 > 
 > Yu-cheng, you may not know all the history, but this code is actually
-> the source of the "Dirty COW" security issue.  We need to be very, very
-> careful with it, and super-explicit about all the logic.  This is the
+> the source of the "Dirty COW" security issue.A A We need to be very, very
+> careful with it, and super-explicit about all the logic.A A This is the
 > time to blow up the comments and walk folks through exactly what we
 > expect to happen.
 > 
-> Anybody think I'm being too verbose?  Is there a reason not to just go
+> Anybody think I'm being too verbose?A A Is there a reason not to just go
 > whole-hog on this sucker?
 > 
 > static inline bool can_follow_write(pte_t pte, unsigned int flags,
-> 				    struct vm_area_struct *vma)
+> 				A A A A struct vm_area_struct *vma)
 > {
 > 	/*
 > 	 * FOLL_FORCE can "write" to hardware read-only PTEs, but
-> 	 * has to do a COW operation first.  Do not allow the
+> 	 * has to do a COW operation first.A A Do not allow the
 > 	 * hardware protection override unless we see FOLL_FORCE
 > 	 * *and* the COW has been performed by the fault code.
 > 	 */
 > 	bool gup_cow_ok = (flags & FOLL_FORCE) &&
-> 			  (flags & FOLL_COW);
+> 			A A (flags & FOLL_COW);
 > 
 > 	/*
 > 	 * FOLL_COW flags tell us whether the page fault code did a COW
 > 	 * operation but not whether the PTE we are dealing with here
-> 	 * was COW'd.  It could have been zapped and refaulted since the
+> 	 * was COW'd.A A It could have been zapped and refaulted since the
 > 	 * COW operation.
 > 	 */
 > 	bool pte_cow_ok;
@@ -169,9 +169,9 @@ pte_write() any more.
 > 		/* Shadow stack PTEs are always hardware-writable */
 > 
 > 		/*
-> 		 * Shadow stack pages do copy-on-access, so any present
-> 		 * shadow stack page has had a COW-equivalent performed.
-> 		 */
+> 		A * Shadow stack pages do copy-on-access, so any present
+> 		A * shadow stack page has had a COW-equivalent performed.
+> 		A */
 > 		pte_cow_ok = is_shstk_pte(pte));
 > 	}
 > 
diff --git a/a/content_digest b/N3/content_digest
index 3ee8761..e892566 100644
--- a/a/content_digest
+++ b/N3/content_digest
@@ -32,7 +32,10 @@
   Mike Kravetz <mike.kravetz@oracle.com>
   Nadav Amit <nadav.amit@gmail.com>
   Oleg Nesterov <oleg@redhat.com>
- " Pavel Machek <pavel@ucw.cz>Peter\0"
+  Pavel Machek <pavel@ucw.cz>
+  Peter Zijlstra <peterz@infradead.org>
+  Ravi V. Shankar <ravi.v.shankar@intel.com>
+ " Vedvyas Shanbhogue <vedvyas.shanbhogue@intel.com>\0"
  "\00:1\0"
  "b\0"
  "On Wed, 2018-07-18 at 14:45 -0700, Dave Hansen wrote:\n"
@@ -61,8 +64,8 @@
  "> > \n"
  "> > However, a shadow stack PTE is always RO & DIRTY; it can be:\n"
  "> > \n"
- "> > \302\240 RO & DIRTY_HW - is_shstk_pte(pte) is true; or\n"
- "> > \302\240 RO & DIRTY_SW - the page is being shared.\n"
+ "> > A  RO & DIRTY_HW - is_shstk_pte(pte) is true; or\n"
+ "> > A  RO & DIRTY_SW - the page is being shared.\n"
  "> > \n"
  "> > Update these functions to check a non-sharing shadow stack page\n"
  "> > still exists after the COW.\n"
@@ -73,48 +76,48 @@
  "> > \n"
  "> > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>\n"
  "> > ---\n"
- "> > \302\240mm/gup.c\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240| 38 ++++++++++++++++++++++++++++++++++----\n"
- "> > \302\240mm/huge_memory.c | 19 ++++++++++++++-----\n"
- "> > \302\2402 files changed, 48 insertions(+), 9 deletions(-)\n"
+ "> > A mm/gup.cA A A A A A A A A | 38 ++++++++++++++++++++++++++++++++++----\n"
+ "> > A mm/huge_memory.c | 19 ++++++++++++++-----\n"
+ "> > A 2 files changed, 48 insertions(+), 9 deletions(-)\n"
  "> > \n"
  "> > diff --git a/mm/gup.c b/mm/gup.c\n"
  "> > index fc5f98069f4e..316967996232 100644\n"
  "> > --- a/mm/gup.c\n"
  "> > +++ b/mm/gup.c\n"
  "> > @@ -63,11 +63,41 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,\n"
- "> > \302\240/*\n"
- "> > \302\240 * FOLL_FORCE can write to even unwritable pte's, but only\n"
- "> > \302\240 * after we've gone through a COW cycle and they are dirty.\n"
+ "> > A /*\n"
+ "> > A  * FOLL_FORCE can write to even unwritable pte's, but only\n"
+ "> > A  * after we've gone through a COW cycle and they are dirty.\n"
  "> > + *\n"
  "> > + * Background:\n"
  "> > + *\n"
  "> > + * When we force-write to a read-only page, the page fault\n"
  "> > + * handler copies the page and sets the new page's PTE to\n"
- "> > + * RO & DIRTY.\302\240\302\240This routine tells\n"
+ "> > + * RO & DIRTY.A A This routine tells\n"
  "> > + *\n"
- "> > + *\302\240\302\240\302\240\302\240\302\240\"Can we write to the page?\"\n"
+ "> > + *A A A A A \"Can we write to the page?\"\n"
  "> > + *\n"
  "> > + * by checking:\n"
  "> > + *\n"
- "> > + *\302\240\302\240\302\240\302\240\302\240(1) The page has been copied, i.e. FOLL_COW is set;\n"
- "> > + *\302\240\302\240\302\240\302\240\302\240(2) The copy still exists and its PTE is RO & DIRTY.\n"
+ "> > + *A A A A A (1) The page has been copied, i.e. FOLL_COW is set;\n"
+ "> > + *A A A A A (2) The copy still exists and its PTE is RO & DIRTY.\n"
  "> > + *\n"
  "> > + * However, a shadow stack PTE is always RO & DIRTY; it can\n"
  "> > + * be:\n"
  "> > + *\n"
- "> > + *\302\240\302\240\302\240\302\240\302\240RO & DIRTY_HW: when is_shstk_pte(pte) is true; or\n"
- "> > + *\302\240\302\240\302\240\302\240\302\240RO & DIRTY_SW: when the page is being shared.\n"
+ "> > + *A A A A A RO & DIRTY_HW: when is_shstk_pte(pte) is true; or\n"
+ "> > + *A A A A A RO & DIRTY_SW: when the page is being shared.\n"
  "> > + *\n"
  "> > + * To test a shadow stack's non-sharing page still exists,\n"
  "> > + * we verify that the new page's PTE is_shstk_pte(pte).\n"
  "> The content is getting there, but we need it next to the code, please.\n"
  "> \n"
  "> > \n"
- "> > \302\240 */\n"
+ "> > A  */\n"
  "> > -static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)\n"
  "> > +static inline bool can_follow_write(pte_t pte, unsigned int flags,\n"
- "> > +\t\t\t\t\302\240\302\240\302\240\302\240struct vm_area_struct *vma)\n"
- "> > \302\240{\n"
+ "> > +\t\t\t\tA A A A struct vm_area_struct *vma)\n"
+ "> > A {\n"
  "> > -\treturn pte_write(pte) ||\n"
  "> > -\t\t((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));\n"
  "> > +\tif (!is_shstk_mapping(vma->vm_flags)) {\n"
@@ -123,34 +126,34 @@
  "> Let me see if I can say this another way.\n"
  "> \n"
  "> The bigger issue is that these patches change the semantics of\n"
- "> pte_write().\302\240\302\240Before these patches, it meant that you *MUST* have this\n"
- "> bit set to write to the page controlled by the PTE.\302\240\302\240Now, it means: you\n"
+ "> pte_write().A A Before these patches, it meant that you *MUST* have this\n"
+ "> bit set to write to the page controlled by the PTE.A A Now, it means: you\n"
  "> can write if this bit is set *OR* the shadowstack bit combination is set.\n"
  "\n"
  "Here, we only figure out (1) if the page is pointed by a writable PTE; or\n"
  "(2) if the page is pointed by a RO PTE (data or SHSTK) and it has been\n"
- "copied and it still exists. \302\240We are not trying to\n"
+ "copied and it still exists. A We are not trying to\n"
  "determine if the\n"
  "SHSTK PTE is writable (we know it is not).\n"
  "\n"
  "We look for the dirty bit to be sure the COW'ed page is still there.\n"
  "The difference for the shadow stack case is that we look for the *hardware*\n"
- "dirty bit. \302\240Perhaps we can create another macro, pte_ro_dirty_hw(), which\n"
+ "dirty bit. A Perhaps we can create another macro, pte_ro_dirty_hw(), which\n"
  "is equivalent to is_shstk_pte().\n"
  "\n"
  "> \n"
- "> That's the fundamental problem.\302\240\302\240We need some code in the kernel that\n"
+ "> That's the fundamental problem.A A We need some code in the kernel that\n"
  "> logically represents the concept of \"is this PTE a shadowstack PTE or a\n"
  "> PTE with the write bit set\", and we will call that pte_write(), or maybe\n"
  "> pte_writable().\n"
  "> \n"
- "> You *have* to somehow rectify this situation.\302\240\302\240We can absolutely no\n"
+ "> You *have* to somehow rectify this situation.A A We can absolutely no\n"
  "> leave pte_write() in its current, ambiguous state where it has no real\n"
  "> meaning or where it is used to mean _both_ things depending on context.\n"
  "\n"
  "True, the processor can always write to a page through a shadow stack\n"
- "PTE, but it must do that with a CALL instruction. \302\240Can we define a\302\240\n"
- "write operation as: MOV r1, *(r2). \302\240Then we don't have any doubt on\n"
+ "PTE, but it must do that with a CALL instruction. A Can we define aA \n"
+ "write operation as: MOV r1, *(r2). A Then we don't have any doubt on\n"
  "pte_write() any more.\n"
  "\n"
  "> \n"
@@ -161,34 +164,34 @@
  "> > +\t\treturn ((flags & FOLL_FORCE) && (flags & FOLL_COW) &&\n"
  "> > +\t\t\tis_shstk_pte(pte));\n"
  "> > +\t}\n"
- "> > \302\240}\n"
+ "> > A }\n"
  "> Ok, it's rewrite time I guess.\n"
  "> \n"
  "> Yu-cheng, you may not know all the history, but this code is actually\n"
- "> the source of the \"Dirty COW\" security issue.\302\240\302\240We need to be very, very\n"
- "> careful with it, and super-explicit about all the logic.\302\240\302\240This is the\n"
+ "> the source of the \"Dirty COW\" security issue.A A We need to be very, very\n"
+ "> careful with it, and super-explicit about all the logic.A A This is the\n"
  "> time to blow up the comments and walk folks through exactly what we\n"
  "> expect to happen.\n"
  "> \n"
- "> Anybody think I'm being too verbose?\302\240\302\240Is there a reason not to just go\n"
+ "> Anybody think I'm being too verbose?A A Is there a reason not to just go\n"
  "> whole-hog on this sucker?\n"
  "> \n"
  "> static inline bool can_follow_write(pte_t pte, unsigned int flags,\n"
- "> \t\t\t\t\302\240\302\240\302\240\302\240struct vm_area_struct *vma)\n"
+ "> \t\t\t\tA A A A struct vm_area_struct *vma)\n"
  "> {\n"
  "> \t/*\n"
  "> \t * FOLL_FORCE can \"write\" to hardware read-only PTEs, but\n"
- "> \t * has to do a COW operation first.\302\240\302\240Do not allow the\n"
+ "> \t * has to do a COW operation first.A A Do not allow the\n"
  "> \t * hardware protection override unless we see FOLL_FORCE\n"
  "> \t * *and* the COW has been performed by the fault code.\n"
  "> \t */\n"
  "> \tbool gup_cow_ok = (flags & FOLL_FORCE) &&\n"
- "> \t\t\t\302\240\302\240(flags & FOLL_COW);\n"
+ "> \t\t\tA A (flags & FOLL_COW);\n"
  "> \n"
  "> \t/*\n"
  "> \t * FOLL_COW flags tell us whether the page fault code did a COW\n"
  "> \t * operation but not whether the PTE we are dealing with here\n"
- "> \t * was COW'd.\302\240\302\240It could have been zapped and refaulted since the\n"
+ "> \t * was COW'd.A A It could have been zapped and refaulted since the\n"
  "> \t * COW operation.\n"
  "> \t */\n"
  "> \tbool pte_cow_ok;\n"
@@ -206,9 +209,9 @@
  "> \t\t/* Shadow stack PTEs are always hardware-writable */\n"
  "> \n"
  "> \t\t/*\n"
- "> \t\t\302\240* Shadow stack pages do copy-on-access, so any present\n"
- "> \t\t\302\240* shadow stack page has had a COW-equivalent performed.\n"
- "> \t\t\302\240*/\n"
+ "> \t\tA * Shadow stack pages do copy-on-access, so any present\n"
+ "> \t\tA * shadow stack page has had a COW-equivalent performed.\n"
+ "> \t\tA */\n"
  "> \t\tpte_cow_ok = is_shstk_pte(pte));\n"
  "> \t}\n"
  "> \n"
@@ -219,4 +222,4 @@
  "\n"
  Yu-cheng
 
-22ac8be111ef0e340b8a47d3ba9c9418fe12a713964728f65d567446a90abdba
+6b998ba10ae516f578e573f07c585567971cd9f6e076f50acc5d3f77220cf2c7

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.