Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 98b728a ('livepatch: Disallow applying after an revert') Signed-off-by: Roger Pau Monné <[email protected]> Tested-by: Bjoern Doebel <[email protected]> Reviewed-by: Ross Lagerwall <[email protected]> master commit: 0dc1f92 master date: 2022-04-08 10:24:10 +0200
- Loading branch information