On Fri, 5 Apr 2019, Borislav Petkov wrote: > From: Jann Horn <ja...@google.com> > > Change generic_load_microcode() to use the iov_iter API instead of a > clumsy open-coded version which has to pay attention to __user data > or kernel data, depending on the loading method. This allows to avoid > explicit casting between user and kernel pointers. > > Because the iov_iter API makes it hard to read the same location twice, > as a side effect, also fix a double-read of the microcode header (which > could e.g. lead to out-of-bounds reads in microcode_sanity_check()). > > Not that it matters much, only root is allowed to load microcode > anyway...
Nice! Reviewed-by: Thomas Gleixner <t...@linutronix.de>