Message ID | 20240329160703.4012941-1-qing.zhao@oracle.com |
---|---|
Headers | show |
Series | New attribute "counted_by" to annotate bounds for C99 FAM(PR108896) | expand |
>>>>> Qing Zhao <qing.zhao@oracle.com> writes: > This is the 8th version of the patch. > compare with the 7th version, the difference are: [...] Hi. I was curious to know if the information supplied by this attribute shows up in the DWARF. It would be good if it did, because that would let gdb correctly print these arrays without user intervention. Tom
On Fri, Mar 29, 2024 at 12:09:15PM -0600, Tom Tromey wrote: > >>>>> Qing Zhao <qing.zhao@oracle.com> writes: > > > This is the 8th version of the patch. > > > compare with the 7th version, the difference are: > > [...] > > Hi. I was curious to know if the information supplied by this attribute > shows up in the DWARF. It would be good if it did, because that would > let gdb correctly print these arrays without user intervention. Does DWARF have such an annotation? Regardless, I think this could be a future patch to not hold up landing the initial feature.
Hi, Tom, Thanks a lot for the comments. It’s good to hear that this new attribute might be able to be used to help gdb. We might spend some time to study to use this information in other consumers, for example, gdb, in the future, if necessary and possible. If you have good examples to show the importance of using such information in gdb, please let me know. I’m glad to study a little more. At this time, I agree with Kees, it’s better for the initial patches of the “counted-by” support to focus on the the attribute itself and the immediate security consumers, such as array bound sanitizer and dynamic object size, etc. So, let’s delay the possible support to gdb in a later patch. Does this sound reasonable to you? Qing > On Mar 29, 2024, at 15:16, Kees Cook <keescook@chromium.org> wrote: > > On Fri, Mar 29, 2024 at 12:09:15PM -0600, Tom Tromey wrote: >>>>>>> Qing Zhao <qing.zhao@oracle.com> writes: >> >>> This is the 8th version of the patch. >> >>> compare with the 7th version, the difference are: >> >> [...] >> >> Hi. I was curious to know if the information supplied by this attribute >> shows up in the DWARF. It would be good if it did, because that would >> let gdb correctly print these arrays without user intervention. > > Does DWARF have such an annotation? Regardless, I think this could be a > future patch to not hold up landing the initial feature. > > -- > Kees Cook
Kees> Does DWARF have such an annotation? Regardless, I think this could be a Kees> future patch to not hold up landing the initial feature. Sure, the compiler can emit the array length (and structure size) as a DWARF expression using the length. Tom
> So, let’s delay the possible support to gdb in a later patch. > Does this sound reasonable to you? It's not really up to me, but sure. I was just curious if it perhaps already worked, but not enough to apply the patches and find out. Tom
On Fri, Mar 29, 2024 at 04:06:58PM +0000, Qing Zhao wrote:
> This is the 8th version of the patch.
Thanks for the updated version!
I've done a full Linux kernel build and run through my behavioral
regression test suite. Everything is working as expected.
-Kees