]> xenbits.xensource.com Git - livepatch-build-tools.git/commit
create-diff-object: handle missing padding at end of special section
authorJosh Poimboeuf <jpoimboe@redhat.com>
Fri, 14 Apr 2023 15:19:33 +0000 (17:19 +0200)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 18 Apr 2023 13:30:50 +0000 (14:30 +0100)
commit23af906f19a7a49e6f6ccfd5e84f7dc57d0038ff
tree3f8627900c8bd26ad2158abc145c0e87ef68946d
parent5cbf73f0a18b0af51830fe0d9774b49ab1de31b1
create-diff-object: handle missing padding at end of special section

The paravirt_patch_site struct has 12 bytes of data and 4 bytes of
padding, for a total of 16 bytes.  However, when laying out the structs
in the .parainstructions section, the vmlinux script only aligns before
each struct's data, not after.  So the last entry doesn't have the
4-byte padding, which breaks kpatch_regenerate_special_section()'s
assumption of a 16-byte struct, resulting in a memcpy past the end of
the section.

Fixes #747.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
This is commit:

c2dc3836e862 create-diff-object: handle missing padding at end of special section

In kpatch repository.

I've seen the .fixup section get an alignment of 16 but a size of 81,
which makes the error removed in this patch trigger.  Overall I'm not
sure why the original alignment check was done against the size of the
section, the alignment applies to the address of the section, not its
size.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
create-diff-object.c