Skip to content

add-patches-section doesn't handle symbol collisions properly #53

@sjenning

Description

@sjenning

Given the following patch:

--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2207,6 +2207,7 @@ KSM_ATTR(sleep_millisecs);
 static ssize_t pages_to_scan_show(struct kobject *kobj,
                                  struct kobj_attribute *attr, char *buf)
 {
+       printk("hello from pages_to_scan_show()!\n");
        return sprintf(buf, "%u\n", ksm_thread_pages_to_scan);
 }

running the output of create-diff-object into add-patches-section results in

found patched function pages_to_scan_show
original function at address ffffffff811a1450 (length 36)

looking at vmlinux:
13403: 0000000000000000      0 FILE    LOCAL  DEFAULT      ABS ksm.c
...
13425: ffffffff81194030     36 FUNC    LOCAL  DEFAULT        1 pages_to_scan_show
...
13723: 0000000000000000      0 FILE    LOCAL  DEFAULT      ABS huge_memory.c
...
13745: ffffffff811a1450     36 FUNC    LOCAL  DEFAULT        1 pages_to_scan_show

add-patches-section is patching the pages_to_scan_show() in huge_memory.c when it should patch the one in ksm.c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions