> From: Roger Pau Monne <[email protected]>
> Sent: Thursday, March 17, 2022 11:08 AM
> To: [email protected] <[email protected]>
> Cc: Roger Pau Monne <[email protected]>; Konrad Rzeszutek Wilk 
> <[email protected]>; Ross Lagerwall <[email protected]>
> Subject: [PATCH 1/2] livepatch: do not ignore sections with 0 size 
>  
> A side effect of ignoring such sections is that symbols belonging to
> them won't be resolved, and that could make relocations belonging to
> other sections that reference those symbols fail.
> 
> For example it's likely to have an empty .altinstr_replacement with
> symbols pointing to it, and marking the section as ignored will
> prevent the symbols from being resolved, which in turn will cause any
> relocations against them to fail.
> 
> In order to solve this do not ignore sections with 0 size, only ignore
> sections that don't have the SHF_ALLOC flag set.
> 
> Special case such empty sections in move_payload so they are not taken
> into account in order to decide whether a livepatch can be safely
> re-applied after a revert.
> 
> Fixes: 98b728a7b2 ('livepatch: Disallow applying after an revert')
> Signed-off-by: Roger Pau Monné <[email protected]>

Reviewed-by: Ross Lagerwall <[email protected]>

Reply via email to