From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id B92C93858418 for ; Tue, 8 Aug 2023 13:08:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B92C93858418 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bd0a96e63dso256110a34.2 for ; Tue, 08 Aug 2023 06:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691500110; x=1692104910; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DXTBOmGq71QOx7hKHYXfKArZvnJfyIy+qZjp3wadwRg=; b=Aq3PgPvU0GOFbY3N0umrmKMd23FBydHBSF0YRk7N7sfBpsUVq4eAfJtX1nasiyJ/wC fe+H0lZ8bnLLkX0R46G3EP+eo9MmTOfd7fC+IorErwyB0gIdvwl9X4iz1N3SEyIkxMaT ALZmQ4lV2MsWRdmgO6EZxl+CIKvg3Gl8AadhvevC/spTuj+QND2rC+gmvd3btTTzAL01 zVMjw8emnR5DZCGjGtnHNXViuClZDbvzn+XhZgCBdbbvi86roBGRuPvOpQJstdfrAHCj 6BTghU0UfCqHNZDgmcAeMs1k+D76h4X85GEXhw03Ek3kjtM5uLy/qpxqKruHJQ2YYac7 iA3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691500110; x=1692104910; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DXTBOmGq71QOx7hKHYXfKArZvnJfyIy+qZjp3wadwRg=; b=lgyzHDMQor+iUPe/TvzT7/BEiKECknm7P0TB4/tTN4Lk3g9Bl3mlaGFSYvVaGeVt85 6czDfOdYybFsGCjr5HnigF5Lb5lp2Hu4vOh1UDJkSnYO7on0fQgQ6KhywV9auDuRQYUV TrYjkHrrPNPL/zy7I6NkVSCAgr3eZgTGLNWCYuKvQgIkny3gpgCZE+WLlprRl+x44h+4 R8cNoaZ0G1XwmCDaz9r/Hts+0NlZp/WpaZXsk4nWotREp6tX4s+N2R4Zg3EFePBC/qyl kxQVmVQoo1nHb+V2k0xiLLokUznbbl+Eeeds6BPdyYNVq7T32VJMg1g2OlFING+M9lh2 U4fg== X-Gm-Message-State: AOJu0YwG4mEHm3S9l7xFyoMwfssOjVGzRRs9hBlbTHz4BWMkfGTBRPfk lIsnWLO7CLiMDnwnE4NipYFkKCPwzZtT+EPbqWfHyg== X-Google-Smtp-Source: AGHT+IGna+MlUE5mVdz/tmF5s8S8L9Af/RY3KQTUOmJd4ejiONlt9mbLFdMULdZAN2RJ8g11kpyLJw== X-Received: by 2002:a9d:6d12:0:b0:6bc:cd0d:427e with SMTP id o18-20020a9d6d12000000b006bccd0d427emr12126293otp.38.1691500109995; Tue, 08 Aug 2023 06:08:29 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:9aa9:3d65:5ea9:b093:ea65? ([2804:1b3:a7c1:9aa9:3d65:5ea9:b093:ea65]) by smtp.gmail.com with ESMTPSA id l19-20020a05683004b300b006b9848f8aa7sm6007752otd.45.2023.08.08.06.08.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Aug 2023 06:08:28 -0700 (PDT) Message-ID: <0441fd42-f774-2a5a-7a4d-0a8e21953780@linaro.org> Date: Tue, 8 Aug 2023 10:08:25 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: Add PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG etc. from Linux 6.4 to sys/ptrace.h Content-Language: en-US To: Joseph Myers , libc-alpha@sourceware.org References: <8063f59-aecf-80f9-847c-9e9656b76b4@codesourcery.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <8063f59-aecf-80f9-847c-9e9656b76b4@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-15.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 02/08/23 17:57, Joseph Myers wrote: > Linux 6.4 adds new constants PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > and PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG. Add those to all > relevant sys/ptrace.h headers, along with adding the associated > argument structure to bits/ptrace-shared.h (named struct > __ptrace_sud_config there following the usual convention for such > structures). > > Tested for x86_64 and with build-many-glibcs.py. LGTM, it matches commit 3f67987cdc09778e75098f9f5168832f8f8e1f1c added on 6.4. Reviewed-by: Adhemerval Zanella > > diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h > index 2bbbedc597..c4dc6f9d02 100644 > --- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h > @@ -59,6 +59,8 @@ __BEGIN_DECLS > #undef PTRACE_SECCOMP_GET_METADATA > #undef PTRACE_GET_SYSCALL_INFO > #undef PTRACE_GET_RSEQ_CONFIGURATION > +#undef PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > +#undef PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > > /* Type of the REQUEST argument to `ptrace.' */ > enum __ptrace_request > @@ -195,8 +197,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > > diff --git a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h > index e6c7eb60e0..a31bc6b2ee 100644 > --- a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h > @@ -204,8 +204,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > > diff --git a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h > index 2737937dea..96a656217d 100644 > --- a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h > +++ b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h > @@ -130,6 +130,16 @@ struct __ptrace_rseq_configuration > __uint32_t pad; > }; > > +/* Argument of PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG and > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG. */ > +struct __ptrace_sud_config > +{ > + __uint64_t mode; > + __uint64_t selector; > + __uint64_t offset; > + __uint64_t len; > +}; > + > /* Perform process tracing functions. REQUEST is one of the values > above, and determines the action to be taken. > For all requests except PTRACE_TRACEME, PID specifies the process to be > diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h > index c4e4e76c56..27a4291b7b 100644 > --- a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h > @@ -157,8 +157,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > > diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h > index 744f0f727e..2fbd29455c 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h > @@ -40,6 +40,7 @@ __BEGIN_DECLS > # undef PTRACE_GETSIGINFO > # undef PTRACE_GETSIGMASK > # undef PTRACE_GET_SYSCALL_INFO > +# undef PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > # undef PTRACE_GETVRREGS > # undef PTRACE_GETVSRREGS > # undef PTRACE_INTERRUPT > @@ -62,6 +63,7 @@ __BEGIN_DECLS > # undef PTRACE_SETREGSET > # undef PTRACE_SETSIGINFO > # undef PTRACE_SETSIGMASK > +# undef PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > # undef PTRACE_SETVRREGS > # undef PTRACE_SETVSRREGS > # undef PTRACE_SINGLEBLOCK > @@ -265,8 +267,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > > diff --git a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h > index 948c1165a6..c1adc3d515 100644 > --- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h > @@ -86,6 +86,8 @@ __BEGIN_DECLS > # undef PTRACE_SYSCALL_INFO_EXIT > # undef PTRACE_SYSCALL_INFO_SECCOMP > # undef PTRACE_GET_RSEQ_CONFIGURATION > +# undef PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > +# undef PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > #endif > /* Type of the REQUEST argument to `ptrace.' */ > enum __ptrace_request > @@ -221,6 +223,16 @@ enum __ptrace_request > PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211, > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > + > PTRACE_PEEKUSR_AREA = 0x5000, > #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA > > diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h > index bcbc9013b7..56ce00c72a 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h > @@ -225,8 +225,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > > diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h > index 075c5e126d..c57575cf7a 100644 > --- a/sysdeps/unix/sysv/linux/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/sys/ptrace.h > @@ -174,8 +174,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > > diff --git a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h > index 9319f4735a..547aa83c55 100644 > --- a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h > @@ -194,8 +194,18 @@ enum __ptrace_request > #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO > > /* Get rseq configuration information. */ > - PTRACE_GET_RSEQ_CONFIGURATION = 0x420f > + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, > #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION > + > + /* Set configuration for syscall user dispatch. */ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, > +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG > + > + /* Get configuration for syscall user dispatch. */ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 > +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ > + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG > }; > > >