Re: [PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks

2023-04-18 Thread Ross Lagerwall
> From: Andrew Cooper > Sent: Monday, April 17, 2023 1:13 PM > To: Xen-devel > Cc: Andrew Cooper ; Konrad Rzeszutek Wilk > ; Ross Lagerwall > Subject: [PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks >   > The prior check has && vs || mixups

Re: [PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks

2023-04-17 Thread Jan Beulich
On 17.04.2023 15:37, Andrew Cooper wrote: > On 17/04/2023 1:35 pm, Jan Beulich wrote: >> On 17.04.2023 14:13, Andrew Cooper wrote: >>> --- a/xen/common/livepatch.c >>> +++ b/xen/common/livepatch.c >>> @@ -803,28 +803,84 @@ static int prepare_payload(struct payload *payload, >>> if ( sec ) >>>

Re: [PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks

2023-04-17 Thread Andrew Cooper
On 17/04/2023 1:35 pm, Jan Beulich wrote: > On 17.04.2023 14:13, Andrew Cooper wrote: >> --- a/xen/common/livepatch.c >> +++ b/xen/common/livepatch.c >> @@ -803,28 +803,84 @@ static int prepare_payload(struct payload *payload, >> if ( sec ) >> { >> #ifdef CONFIG_HAS_ALTERNATIVE >> +

Re: [PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks

2023-04-17 Thread Jan Beulich
On 17.04.2023 14:13, Andrew Cooper wrote: > --- a/xen/common/livepatch.c > +++ b/xen/common/livepatch.c > @@ -803,28 +803,84 @@ static int prepare_payload(struct payload *payload, > if ( sec ) > { > #ifdef CONFIG_HAS_ALTERNATIVE > +/* > + * (As of April 2023),

[PATCH v2 3/3] xen/livepatch: Fix .altinstructions safety checks

2023-04-17 Thread Andrew Cooper
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,