diff mbox series

livepatch: create-diff-object: Check that the section has a secsym

Message ID 20220706021817.20437-1-sarah.newman@computer.org (mailing list archive)
State Superseded
Headers show
Series livepatch: create-diff-object: Check that the section has a secsym | expand

Commit Message

Sarah Newman July 6, 2022, 2:18 a.m. UTC
A STT_SECTION symbol is not needed if if it is not used as a relocation
target. Therefore, a section, in this case a debug section, may not have
a secsym associated with it.

This is a livepatch backport of kpatch upstream commit [1]:
create-diff-object: Check that the section has a secsym ba3defa

Signed-off-by: Sarah Newman <sarah.newman@computer.org>

[1] https://github.com/dynup/kpatch/commit/ba3defa06073dcc69917dbbbb9df570ca4e56612
---
 create-diff-object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich July 6, 2022, 6:54 a.m. UTC | #1
On 06.07.2022 04:18, Sarah Newman wrote:
> A STT_SECTION symbol is not needed if if it is not used as a relocation
> target. Therefore, a section, in this case a debug section, may not have
> a secsym associated with it.
> 
> This is a livepatch backport of kpatch upstream commit [1]:
> create-diff-object: Check that the section has a secsym ba3defa
> 
> Signed-off-by: Sarah Newman <sarah.newman@computer.org>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

However I think the 7-digit hash above wants either extending to at
least 10 digits (better 12), or dropping altogether for having the
full hash ...

> [1] https://github.com/dynup/kpatch/commit/ba3defa06073dcc69917dbbbb9df570ca4e56612

... here anyway. But I guess the rules set forth in
xen.git:docs/process/sending-patches.pandoc could be applied here,
and hence an Origin: tag would best be used.

The other thing is: You didn't Cc any of the maintainer(s).

Jan
Ross Lagerwall July 13, 2022, 4:21 p.m. UTC | #2
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> on behalf of Sarah Newman <sarah.newman@computer.org>
> Sent: Wednesday, July 6, 2022 3:18 AM
> To: Xen-devel@lists.xenproject.org <Xen-devel@lists.xenproject.org>
> Cc: Sarah Newman <sarah.newman@computer.org>
> Subject: [PATCH] livepatch: create-diff-object: Check that the section has a secsym 
>  
> A STT_SECTION symbol is not needed if if it is not used as a relocation
> target. Therefore, a section, in this case a debug section, may not have
> a secsym associated with it.
> 
> This is a livepatch backport of kpatch upstream commit [1]:
> create-diff-object: Check that the section has a secsym ba3defa
> 
> Signed-off-by: Sarah Newman <sarah.newman@computer.org>
> 

Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
diff mbox series

Patch

diff --git a/create-diff-object.c b/create-diff-object.c
index a516670..780e6c8 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -1484,7 +1484,7 @@  static void kpatch_include_debug_sections(struct kpatch_elf *kelf)
 	list_for_each_entry(sec, &kelf->sections, list) {
 		if (is_debug_section(sec)) {
 			sec->include = 1;
-			if (!is_rela_section(sec))
+			if (!is_rela_section(sec) && sec->secsym)
 				sec->secsym->include = 1;
 		}
 	}