diff for duplicates of <1535646146.26689.11.camel@intel.com> diff --git a/a/content_digest b/N1/content_digest index 3c53138..316a0a7 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -27,7 +27,11 @@ Mike Kravetz <mike.kravetz@oracle.com> Nadav Amit <nadav.amit@gmail.com> Oleg Nesterov <oleg@redhat.com> - " Pavel Machek <pavel@ucw.cz>\0" + Pavel Machek <pavel@ucw.cz> + Peter Zijlstra <peterz@infradead.org> + Ravi V. Shankar <ravi.v.shankar@intel.com> + Shanbhogue + " Vedvyas <vedvyas.shanbhogue@intel.com>\0" "\00:1\0" "b\0" "On Thu, 2018-08-30 at 08:55 -0700, Andy Lutomirski wrote:\n" @@ -95,4 +99,4 @@ "\n" Yu-cheng -9f29037332e5441ec160ae5ffa97af4f8af8ee029bd2d0c1ac50643ec50cd2c8 +7dc91e61338b3bede4a5f74a2b4070dd67b2932a33cefebd92bb84b2b86777e5
diff --git a/a/1.txt b/N2/1.txt index ddbd840..5582015 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -6,12 +6,12 @@ On Thu, 2018-08-30 at 08:55 -0700, Andy Lutomirski wrote: > > > > > > > > > WRUSS is a new kernel-mode instruction but writes directly -> > > to user shadow stack memory. This is used to construct +> > > to user shadow stack memory.A A This is used to construct > > > a return address on the shadow stack for the signal > > > handler. > > > > > > This instruction can fault if the user shadow stack is -> > > invalid shadow stack memory. In that case, the kernel does +> > > invalid shadow stack memory.A A In that case, the kernel does > > > fixup. > > > > > > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com> @@ -20,16 +20,16 @@ On Thu, 2018-08-30 at 08:55 -0700, Andy Lutomirski wrote: > > > +static inline int write_user_shstk_64(unsigned long addr, > > > unsigned long val) > > > +{ -> > > + int err = 0; +> > > +A A A A A A A int err = 0; > > > + -> > > + asm volatile("1: wrussq %1, (%0)\n" -> > > + "2:\n" -> > > + _ASM_EXTABLE_HANDLE(1b, 2b, +> > > +A A A A A A A asm volatile("1: wrussq %1, (%0)\n" +> > > +A A A A A A A A A A A A A A A A A A A A "2:\n" +> > > +A A A A A A A A A A A A A A A A A A A A _ASM_EXTABLE_HANDLE(1b, 2b, > > > ex_handler_wruss) -> > > + : -> > > + : "r" (addr), "r" (val)); +> > > +A A A A A A A A A A A A A A A A A A A A : +> > > +A A A A A A A A A A A A A A A A A A A A : "r" (addr), "r" (val)); > > > + -> > > + return err; +> > > +A A A A A A A return err; > > > +} > > What's up with "err"? You set it to zero, and then you return it, > > but @@ -38,12 +38,12 @@ On Thu, 2018-08-30 at 08:55 -0700, Andy Lutomirski wrote: > > > > > > +__visible bool ex_handler_wruss(const struct > > > exception_table_entry *fixup, -> > > + struct pt_regs *regs, int +> > > +A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A struct pt_regs *regs, int > > > trapnr) > > > +{ -> > > + regs->ip = ex_fixup_addr(fixup); -> > > + regs->ax = -1; -> > > + return true; +> > > +A A A A A A A regs->ip = ex_fixup_addr(fixup); +> > > +A A A A A A A regs->ax = -1; +> > > +A A A A A A A return true; > > > +} > > And here you just write into regs->ax, but your "asm volatile" > > doesn't @@ -51,11 +51,11 @@ On Thu, 2018-08-30 at 08:55 -0700, Andy Lutomirski wrote: > > > > I think you probably want to add something like an explicit > > `"+&a"(err)` output to the asm statements. -> We require asm goto support these days. How about using that? You +> We require asm goto support these days.A A How about using that?A A You > won't even need a special exception handler. > > Also, please change the BUG to WARN in the you-did-it-wrong 32-bit -> case. And return -EFAULT. +> case.A A And return -EFAULT. > > --Andy diff --git a/a/content_digest b/N2/content_digest index 3c53138..84c2b91 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -27,7 +27,11 @@ Mike Kravetz <mike.kravetz@oracle.com> Nadav Amit <nadav.amit@gmail.com> Oleg Nesterov <oleg@redhat.com> - " Pavel Machek <pavel@ucw.cz>\0" + Pavel Machek <pavel@ucw.cz> + Peter Zijlstra <peterz@infradead.org> + Ravi V. Shankar <ravi.v.shankar@intel.com> + Shanbhogue + " Vedvyas <vedvyas.shanbhogue@intel.com>\0" "\00:1\0" "b\0" "On Thu, 2018-08-30 at 08:55 -0700, Andy Lutomirski wrote:\n" @@ -38,12 +42,12 @@ "> > > \n" "> > > \n" "> > > WRUSS is a new kernel-mode instruction but writes directly\n" - "> > > to user shadow stack memory.\302\240\302\240This is used to construct\n" + "> > > to user shadow stack memory.A A This is used to construct\n" "> > > a return address on the shadow stack for the signal\n" "> > > handler.\n" "> > > \n" "> > > This instruction can fault if the user shadow stack is\n" - "> > > invalid shadow stack memory.\302\240\302\240In that case, the kernel does\n" + "> > > invalid shadow stack memory.A A In that case, the kernel does\n" "> > > fixup.\n" "> > > \n" "> > > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>\n" @@ -52,16 +56,16 @@ "> > > +static inline int write_user_shstk_64(unsigned long addr,\n" "> > > unsigned long val)\n" "> > > +{\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240int err = 0;\n" + "> > > +A A A A A A A int err = 0;\n" "> > > +\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240asm volatile(\"1: wrussq %1, (%0)\\n\"\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\"2:\\n\"\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240_ASM_EXTABLE_HANDLE(1b, 2b,\n" + "> > > +A A A A A A A asm volatile(\"1: wrussq %1, (%0)\\n\"\n" + "> > > +A A A A A A A A A A A A A A A A A A A A \"2:\\n\"\n" + "> > > +A A A A A A A A A A A A A A A A A A A A _ASM_EXTABLE_HANDLE(1b, 2b,\n" "> > > ex_handler_wruss)\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240:\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240: \"r\" (addr), \"r\" (val));\n" + "> > > +A A A A A A A A A A A A A A A A A A A A :\n" + "> > > +A A A A A A A A A A A A A A A A A A A A : \"r\" (addr), \"r\" (val));\n" "> > > +\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240return err;\n" + "> > > +A A A A A A A return err;\n" "> > > +}\n" "> > What's up with \"err\"? You set it to zero, and then you return it,\n" "> > but\n" @@ -70,12 +74,12 @@ "> > > \n" "> > > +__visible bool ex_handler_wruss(const struct\n" "> > > exception_table_entry *fixup,\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240struct pt_regs *regs, int\n" + "> > > +A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A struct pt_regs *regs, int\n" "> > > trapnr)\n" "> > > +{\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240regs->ip = ex_fixup_addr(fixup);\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240regs->ax = -1;\n" - "> > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240return true;\n" + "> > > +A A A A A A A regs->ip = ex_fixup_addr(fixup);\n" + "> > > +A A A A A A A regs->ax = -1;\n" + "> > > +A A A A A A A return true;\n" "> > > +}\n" "> > And here you just write into regs->ax, but your \"asm volatile\"\n" "> > doesn't\n" @@ -83,11 +87,11 @@ "> > \n" "> > I think you probably want to add something like an explicit\n" "> > `\"+&a\"(err)` output to the asm statements.\n" - "> We require asm goto support these days.\302\240\302\240How about using that?\302\240\302\240You\n" + "> We require asm goto support these days.A A How about using that?A A You\n" "> won't even need a special exception handler.\n" "> \n" "> Also, please change the BUG to WARN in the you-did-it-wrong 32-bit\n" - "> case.\302\240\302\240And return -EFAULT.\n" + "> case.A A And return -EFAULT.\n" "> \n" "> --Andy\n" "\n" @@ -95,4 +99,4 @@ "\n" Yu-cheng -9f29037332e5441ec160ae5ffa97af4f8af8ee029bd2d0c1ac50643ec50cd2c8 +f87fa779d4674cdc3041d2820ed6e5e00fc10a34afe0a97038debfba73824284
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.