-
Notifications
You must be signed in to change notification settings - Fork 18.4k
debug/elf: validate shstrndx #55001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug/elf: validate shstrndx #55001
Conversation
Changes: 1. When e_shstrndx holds the value SHN_UNDEF (0), the file has no section name string table. In this case, do not try to set section names . 2. e_shstrndx should point to an SHT_STRTAB section. If it does not, returns an error. Reference: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html Note: The reference states that: If the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00), this member has the value SHN_XINDEX (0xffff) and the actual index of the section name string table section is contained in the sh_link field of the section header at index 0. This case (e_shstrndx == 0xffff) is not implemented.
This PR (HEAD: 59eefe5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/430155 to see it. Tip: You can toggle comments from me using the |
Message from Ian Lance Taylor: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
This PR (HEAD: b7b8c37) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/430155 to see it. Tip: You can toggle comments from me using the |
Message from Zeke Lu: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
Message from Ian Lance Taylor: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
This PR (HEAD: aeb70ca) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/430155 to see it. Tip: You can toggle comments from me using the |
Message from Zeke Lu: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
Message from Ian Lance Taylor: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
Message from Ian Lance Taylor: Patch Set 3: Run-TryBot+1 Auto-Submit+1 Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
Message from Gopher Robot: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
Message from Gopher Robot: Patch Set 3: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/430155. |
Changes: 1. When e_shstrndx holds the value SHN_UNDEF (0), the file has no section name string table. In this case, do not try to set section names . 2. e_shstrndx should point to an SHT_STRTAB section. If it does not, returns an error. Reference: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html Updates #54967. Change-Id: Ic8f228061d996fd7845dfa630719a1ba12d2bb60 GitHub-Last-Rev: aeb70ca GitHub-Pull-Request: #55001 Reviewed-on: https://go-review.googlesource.com/c/go/+/430155 Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
This PR is being closed because golang.org/cl/430155 has been merged. |
Changes:
name string table. In this case, do not try to set section names .
an error.
Reference:
https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
Updates #54967.