* [PATCH] Add _sigsys info to siginfo struct [not found] <20220103185854.1675-1-ssbssa.ref@yahoo.de> @ 2022-01-03 18:58 ` Hannes Domani 2022-01-08 11:03 ` Joel Brobecker 2022-01-10 15:12 ` Tom Tromey 0 siblings, 2 replies; 7+ messages in thread From: Hannes Domani @ 2022-01-03 18:58 UTC (permalink / raw) To: gdb-patches This patch adds information about _sigsys structure from newer kernels, so that $_siginfo decoding can show information about _sigsys, making it easier for developers to debug seccomp failures. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283 --- gdb/linux-tdep.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 927e69bf1e1..fb2abdd1a21 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -379,6 +379,13 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, append_composite_type_field (type, "si_fd", int_type); append_composite_type_field (sifields_type, "_sigpoll", type); + /* _sigsys */ + type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); + append_composite_type_field (type, "_call_addr", void_ptr_type); + append_composite_type_field (type, "_syscall", int_type); + append_composite_type_field (type, "_arch", uint_type); + append_composite_type_field (sifields_type, "_sigsys", type); + /* struct siginfo */ siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); siginfo_type->set_name (xstrdup ("siginfo")); -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add _sigsys info to siginfo struct 2022-01-03 18:58 ` [PATCH] Add _sigsys info to siginfo struct Hannes Domani @ 2022-01-08 11:03 ` Joel Brobecker 2022-01-08 12:34 ` Hannes Domani 2022-01-10 15:12 ` Tom Tromey 1 sibling, 1 reply; 7+ messages in thread From: Joel Brobecker @ 2022-01-08 11:03 UTC (permalink / raw) To: Hannes Domani via Gdb-patches; +Cc: Joel Brobecker Hi Hannes, On Mon, Jan 03, 2022 at 07:58:54PM +0100, Hannes Domani via Gdb-patches wrote: > This patch adds information about _sigsys structure from newer > kernels, so that $_siginfo decoding can show information about > _sigsys, making it easier for developers to debug seccomp failures. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283 Thanks for the patch. I'm trusting you for the proper definition of the various fields. This looks reasonable to me, but before we push this, I'm wondering what happens when debugging on a kernel which does not support this feature? Is the data undefined? If yes, do we a precendent for this already? > --- > gdb/linux-tdep.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 927e69bf1e1..fb2abdd1a21 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -379,6 +379,13 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, > append_composite_type_field (type, "si_fd", int_type); > append_composite_type_field (sifields_type, "_sigpoll", type); > > + /* _sigsys */ > + type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > + append_composite_type_field (type, "_call_addr", void_ptr_type); > + append_composite_type_field (type, "_syscall", int_type); > + append_composite_type_field (type, "_arch", uint_type); > + append_composite_type_field (sifields_type, "_sigsys", type); > + > /* struct siginfo */ > siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > siginfo_type->set_name (xstrdup ("siginfo")); > -- > 2.34.1 > -- Joel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add _sigsys info to siginfo struct 2022-01-08 11:03 ` Joel Brobecker @ 2022-01-08 12:34 ` Hannes Domani 2022-01-08 12:44 ` Joel Brobecker 0 siblings, 1 reply; 7+ messages in thread From: Hannes Domani @ 2022-01-08 12:34 UTC (permalink / raw) To: Hannes Domani via Gdb-patches, Joel Brobecker Am Samstag, 8. Januar 2022, 12:04:01 MEZ hat Joel Brobecker via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben: > Hi Hannes, > > On Mon, Jan 03, 2022 at 07:58:54PM +0100, Hannes Domani via Gdb-patches wrote: > > This patch adds information about _sigsys structure from newer > > kernels, so that $_siginfo decoding can show information about > > _sigsys, making it easier for developers to debug seccomp failures. > > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283 > > Thanks for the patch. > > I'm trusting you for the proper definition of the various fields. > This looks reasonable to me, but before we push this, I'm wondering > what happens when debugging on a kernel which does not support > this feature? Is the data undefined? If yes, do we a precendent > for this already? As I understood it, if the kernel doesn't support this feature, then it will never send a SIGSYS signal, and so you wouldn't care about these fields. Hannes ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add _sigsys info to siginfo struct 2022-01-08 12:34 ` Hannes Domani @ 2022-01-08 12:44 ` Joel Brobecker 2022-01-08 13:18 ` Hannes Domani 0 siblings, 1 reply; 7+ messages in thread From: Joel Brobecker @ 2022-01-08 12:44 UTC (permalink / raw) To: Hannes Domani; +Cc: Hannes Domani via Gdb-patches, Joel Brobecker > > > This patch adds information about _sigsys structure from newer > > > kernels, so that $_siginfo decoding can show information about > > > _sigsys, making it easier for developers to debug seccomp failures. > > > > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283 > > > > Thanks for the patch. > > > > I'm trusting you for the proper definition of the various fields. > > This looks reasonable to me, but before we push this, I'm wondering > > what happens when debugging on a kernel which does not support > > this feature? Is the data undefined? If yes, do we a precendent > > for this already? > > As I understood it, if the kernel doesn't support this feature, then it will > never send a SIGSYS signal, and so you wouldn't care about these fields. I see; thanks for clarifying this for me. The patch looks good to me. Thank you, -- Joel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add _sigsys info to siginfo struct 2022-01-08 12:44 ` Joel Brobecker @ 2022-01-08 13:18 ` Hannes Domani 0 siblings, 0 replies; 7+ messages in thread From: Hannes Domani @ 2022-01-08 13:18 UTC (permalink / raw) To: Joel Brobecker; +Cc: Hannes Domani via Gdb-patches Am Samstag, 8. Januar 2022, 13:44:15 MEZ hat Joel Brobecker <brobecker@adacore.com> Folgendes geschrieben: > > > > This patch adds information about _sigsys structure from newer > > > > kernels, so that $_siginfo decoding can show information about > > > > _sigsys, making it easier for developers to debug seccomp failures. > > > > > > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283 > > > > > > Thanks for the patch. > > > > > > I'm trusting you for the proper definition of the various fields. > > > This looks reasonable to me, but before we push this, I'm wondering > > > what happens when debugging on a kernel which does not support > > > this feature? Is the data undefined? If yes, do we a precendent > > > for this already? > > > > As I understood it, if the kernel doesn't support this feature, then it will > > never send a SIGSYS signal, and so you wouldn't care about these fields. > > I see; thanks for clarifying this for me. The patch looks good to me. Pushed, thanks. Hannes ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add _sigsys info to siginfo struct 2022-01-03 18:58 ` [PATCH] Add _sigsys info to siginfo struct Hannes Domani 2022-01-08 11:03 ` Joel Brobecker @ 2022-01-10 15:12 ` Tom Tromey 2022-01-16 9:39 ` Joel Brobecker 1 sibling, 1 reply; 7+ messages in thread From: Tom Tromey @ 2022-01-10 15:12 UTC (permalink / raw) To: Hannes Domani via Gdb-patches >>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes: Hannes> This patch adds information about _sigsys structure from newer Hannes> kernels, so that $_siginfo decoding can show information about Hannes> _sigsys, making it easier for developers to debug seccomp failures. I wonder if this is deserving of a NEWS entry. Tom ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add _sigsys info to siginfo struct 2022-01-10 15:12 ` Tom Tromey @ 2022-01-16 9:39 ` Joel Brobecker 0 siblings, 0 replies; 7+ messages in thread From: Joel Brobecker @ 2022-01-16 9:39 UTC (permalink / raw) To: Tom Tromey; +Cc: Hannes Domani via Gdb-patches, Joel Brobecker > Hannes> This patch adds information about _sigsys structure from newer > Hannes> kernels, so that $_siginfo decoding can show information about > Hannes> _sigsys, making it easier for developers to debug seccomp failures. > > I wonder if this is deserving of a NEWS entry. Hmm, yeah; I think Tom is right, it does. -- Joel ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-01-16 9:39 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20220103185854.1675-1-ssbssa.ref@yahoo.de> 2022-01-03 18:58 ` [PATCH] Add _sigsys info to siginfo struct Hannes Domani 2022-01-08 11:03 ` Joel Brobecker 2022-01-08 12:34 ` Hannes Domani 2022-01-08 12:44 ` Joel Brobecker 2022-01-08 13:18 ` Hannes Domani 2022-01-10 15:12 ` Tom Tromey 2022-01-16 9:39 ` Joel Brobecker
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).