> From: Andrew Cooper <andrew.coop...@citrix.com> > Sent: Monday, April 17, 2023 1:13 PM > To: Xen-devel <xen-devel@lists.xenproject.org> > Cc: Andrew Cooper <andrew.coop...@citrix.com>; Konrad Rzeszutek Wilk > <konrad.w...@oracle.com>; Ross Lagerwall <ross.lagerw...@citrix.com> > Subject: [PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks > > The prior check has && vs || mixups, making it tautologically false and thus > providing no safety at all. There are boundary errors too. > > First start with a comment describing how the .altinstructions and > .altinstr_replacement sections interact, and perform suitable cross-checking. > > Second, rewrite the alt_instr loop entirely from scratch. Origin sites have > non-zero size, and must be fully contained within the livepatches .text > section(s). Any non-zero sized replacements must be fully contained within > the .altinstr_replacement section. > > Fixes: f8a10174e8b1 ("xsplice: Add support for alternatives") > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> > ---
Reviewed-by: Ross Lagerwall <ross.lagerw...@citrix.com>