diff for duplicates of <87shjer9vx.fsf@concordia.ellerman.id.au> diff --git a/a/1.txt b/N1/1.txt index 3f60b9b..73732d2 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,8 +1,8 @@ Christophe LEROY <christophe.leroy@c-s.fr> writes: -> Le 02/06/2017 =C3=A0 11:26, Michael Ellerman a =C3=A9crit : +> Le 02/06/2017 à 11:26, Michael Ellerman a écrit : >> Christophe Leroy <christophe.leroy@c-s.fr> writes: ->>=20 +>> >>> Only the get_user() in store_updates_sp() has to be done outside >>> the mm semaphore. All the comparison can be done within the semaphore, >>> so only when really needed. @@ -10,25 +10,25 @@ Christophe LEROY <christophe.leroy@c-s.fr> writes: >>> As we got a DSI exception, the address pointed by regs->nip is >>> obviously valid, otherwise we would have had a instruction exception. >>> So __get_user() can be used instead of get_user() ->>=20 +>> >> I don't think that part is true. ->>=20 +>> >> You took a DSI so there *was* an instruction at NIP, but since then it >> may have been unmapped by another thread. ->>=20 +>> >> So I don't think you can assume the get_user() will succeed. > -> The difference between get_user() and __get_user() is that get_user()=20 +> The difference between get_user() and __get_user() is that get_user() > performs an access_ok() in addition. > -> Doesn't access_ok() only checks whether addr is below TASK_SIZE to=20 +> Doesn't access_ok() only checks whether addr is below TASK_SIZE to > ensure it is a valid user address ? Yeah more or less, via some gross macros. I was actually not that worried about the switch from get_user() to __get_user(), but rather that you removed the check of the return value. -ie.=20 +ie. - if (get_user(inst, (unsigned int __user *)regs->nip)) - return 0; @@ -36,7 +36,7 @@ ie.=20 Became: if (is_write && user_mode(regs)) -- store_update_sp =3D store_updates_sp(regs); +- store_update_sp = store_updates_sp(regs); + __get_user(inst, (unsigned int __user *)regs->nip); diff --git a/a/content_digest b/N1/content_digest index f503370..d59c68a 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -15,9 +15,9 @@ "b\0" "Christophe LEROY <christophe.leroy@c-s.fr> writes:\n" "\n" - "> Le 02/06/2017 =C3=A0 11:26, Michael Ellerman a =C3=A9crit :\n" + "> Le 02/06/2017 \303\240 11:26, Michael Ellerman a \303\251crit :\n" ">> Christophe Leroy <christophe.leroy@c-s.fr> writes:\n" - ">>=20\n" + ">> \n" ">>> Only the get_user() in store_updates_sp() has to be done outside\n" ">>> the mm semaphore. All the comparison can be done within the semaphore,\n" ">>> so only when really needed.\n" @@ -25,25 +25,25 @@ ">>> As we got a DSI exception, the address pointed by regs->nip is\n" ">>> obviously valid, otherwise we would have had a instruction exception.\n" ">>> So __get_user() can be used instead of get_user()\n" - ">>=20\n" + ">> \n" ">> I don't think that part is true.\n" - ">>=20\n" + ">> \n" ">> You took a DSI so there *was* an instruction at NIP, but since then it\n" ">> may have been unmapped by another thread.\n" - ">>=20\n" + ">> \n" ">> So I don't think you can assume the get_user() will succeed.\n" ">\n" - "> The difference between get_user() and __get_user() is that get_user()=20\n" + "> The difference between get_user() and __get_user() is that get_user() \n" "> performs an access_ok() in addition.\n" ">\n" - "> Doesn't access_ok() only checks whether addr is below TASK_SIZE to=20\n" + "> Doesn't access_ok() only checks whether addr is below TASK_SIZE to \n" "> ensure it is a valid user address ?\n" "\n" "Yeah more or less, via some gross macros.\n" "\n" "I was actually not that worried about the switch from get_user() to\n" "__get_user(), but rather that you removed the check of the return value.\n" - "ie.=20\n" + "ie. \n" "\n" "-\tif (get_user(inst, (unsigned int __user *)regs->nip))\n" "-\t\treturn 0;\n" @@ -51,7 +51,7 @@ "Became:\n" "\n" "\tif (is_write && user_mode(regs))\n" - "-\t\tstore_update_sp =3D store_updates_sp(regs);\n" + "-\t\tstore_update_sp = store_updates_sp(regs);\n" "+\t\t__get_user(inst, (unsigned int __user *)regs->nip);\n" "\n" "\n" @@ -63,4 +63,4 @@ "\n" cheers -1a6ac06ba90822ff90ea2690bed12afe5e918a6557d6b34c38f5acb374c1fc34 +05a2ebc6149dc61b30e817ecce2f90cc17a706bf0dbc30f3f1fc6a47c3700ff9
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.