From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nadav Amit Subject: Re: [PATCH v2 06/20] x86/alternative: use temporary mm for text poking Date: Tue, 5 Feb 2019 17:54:56 +0000 Message-ID: <6D321F51-6B19-46F6-91AC-74248A542BA0@vmware.com> References: <20190129003422.9328-1-rick.p.edgecombe@intel.com> <20190129003422.9328-7-rick.p.edgecombe@intel.com> <20190205095853.GJ21801@zn.tnic> <20190205113146.GP17528@hirez.programming.kicks-ass.net> <20190205123533.GN21801@zn.tnic> In-Reply-To: <20190205123533.GN21801@zn.tnic> Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 To: Borislav Petkov Cc: Peter Zijlstra , Rick Edgecombe , Andy Lutomirski , Ingo Molnar , LKML , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Dave Hansen , Damian Tometzki , linux-integrity , LSM List , Andrew Morton , Kernel Hardening , Linux-MM , Will Deacon , Ard Biesheuvel , Kristen Carlson Accardi , "Dock, Deneen T" , Kees Cook , Dave Hansen , Masami Hiramatsu List-ID: > On Feb 5, 2019, at 4:35 AM, Borislav Petkov wrote: >=20 > On Tue, Feb 05, 2019 at 12:31:46PM +0100, Peter Zijlstra wrote: >> ... >>=20 >> So while in general I agree with BUG_ON() being undesirable, I think >> liberal sprinking in text_poke() is fine; you really _REALLY_ want this >> to work or fail loudly. Text corruption is just painful. >=20 > Ok. It would be good to have the gist of this sentiment in a comment > above it so that it is absolutely clear why we're doing it. I added a short comment for v3 above each BUG_ON(). > And since text_poke() can't fail, then it doesn't need a retval too. > AFAICT, nothing is actually using it. As Peter said, this is addressed in a separate patch (one patch per logical change).