)]}'
{
  "commit": "6313825cbf834b1852007707cfff2ccd3b0dbd6b",
  "tree": "d93d33d570420df75074c6c825415d0e1711bbc0",
  "parents": [
    "8261abd51344cb4c454514fba1389a9292f9652b"
  ],
  "author": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Wed May 31 15:11:34 2023 +0930"
  },
  "committer": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Thu Jun 01 09:52:07 2023 +0930"
  },
  "message": "Harden PowerPC64 OPD handling against fuzzers\n\nPowerPC64 ELFv1 object files should have at most one .opd section, and\nOPD handling in elf64-ppc.c makes use of this fact by caching some\n.opd section info in the per-object bfd.tdata.  This was done to avoid\nanother word in the target specific section data.  Of course, fuzzers\ndon\u0027t respect the ABI, and even non-malicious users can accidentally\ncreate multiple .opd sections.  So it is better to avoid possible\nbuffer overflows and other confusion when OPD handling for a second\n.opd section references data for the first .opd section, by keeping\nthe data per-section.\n\nThe patch also fixes a memory leak, and a corner case where I think we\ncould hit an assertion in opd_entry_value or read out of bounds in\nppc64_elf_branch_reloc doing a final link producing non-ppc64 output.\n(It\u0027s a really rare corner case because not only would you need to be\nlinking ppc64 objects to non-ppc64 output, you\u0027d also need a branch\nreloc symbol to be defined in a .opd section of a non-ppc64 input.)\n\n\t* elf64-ppc.c (is_ppc64_elf): Move earlier in file.\n\t(ppc64_elf_branch_reloc): Check symbol bfd before accessing\n\tppc64 elf specific data structures.\n\t(struct ppc64_elf_obj_tdata): Move opd union..\n\t(struct _ppc64_elf_section_data): ..to here.\n\t(ppc64_elf_before_check_relocs): Allow for opd sec_type\n\talready set to sec_opd.\n\t(ppc64_elf_check_relocs): Only set sec_type to sec_toc when\n\tunset.  Error for unexpected toc relocs.\n\t(opd_entry_value): Return -1 when non-ppc64 rather than\n\tasserting.  Check and set sec_type too.  Adjust for changed\n\tlocation of contents and relocs.\n\t(ppc64_elf_relocate_section): Adjust for changed location of\n\tcached .opd relocs.\n\t(ppc64_elf_free_cached_info): New function.\n\t(bfd_elf64_bfd_free_cached_info): Define.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "33f4275261d077f6f70adbd5a6953606ef7827ec",
      "old_mode": 33188,
      "old_path": "bfd/elf64-ppc.c",
      "new_id": "a977bec2f503807340ec4c7f3dcf1b6e9a419ad4",
      "new_mode": 33188,
      "new_path": "bfd/elf64-ppc.c"
    }
  ]
}
