dynup / kpatch

kpatch - live kernel patching
GNU General Public License v2.0
1.49k stars 305 forks source link

ppc64le: ".toc" entry being a relocation to ".data*" section #1073

Closed julien-thierry closed 1 year ago

julien-thierry commented 4 years ago

Hi,

Kpatch-build does not support modificaitons to data sections and prevents such section to be included in the patch object.

One issue appears on ppc64le when the ".toc" section has a reference to a data section. ".toc" section and its relocations are always included in the final patch object as a "standard_element", and whenever a relocation is included in the patch object, the symbol/section it references get included as well. Which can cause a data section to be dragged in with the following message:

data section .data selected for inclusion

In the attached reproducer, neither the data nor the toc gets modified.

data-inclusion-reprod.tar.gz

julien-thierry commented 4 years ago

@kamalesh-babulal Have you ever had to deal with this kind of issues? Would you have any insights on how we could safely deal with them?

Thanks

kamalesh-babulal commented 4 years ago

@julien-thierry, there is a long-standing issue similar to this #795, the root cause looks similar. It needs to be fixed. Following one-liner, helped in reproducing it:

--- a/drivers/ata/pata_piccolo.c
+++ b/drivers/ata/pata_piccolo.c
@@ -94,6 +94,8 @@ static int ata_tosh_init_one(struct pci_dev *dev, const struct pci_device_id *id
        };
        const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };
        /* Just one port for the moment */
+       if (!jiffies)
+               printk("Kpatch\n");
        return ata_pci_bmdma_init_one(dev, ppi, &tosh_sht, NULL, 0);
 }

will try and debug more and update my findings/ideas.

julien-thierry commented 4 years ago

Yes, my reproducer actually comes from pata_piccolo.c as well. I think you don't even need to introduce a code change. Just using create-diff-object on pata_piccolo.o as orig and patched might trigger the issue (or just doing kpatch-build with a comment changed).

But yes, the root cause of the issue you pointed at seems to be the same as this one.

github-actions[bot] commented 1 year ago

This issue has been open for 30 days with no activity and no assignee. It will be closed in 7 days unless a comment is added.

github-actions[bot] commented 1 year ago

This issue was closed because it was inactive for 7 days after being marked stale.