lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6FA93FD0-D4C3-427A-9C92-18BE8218F264@oracle.com>
Date: Fri, 23 May 2025 20:03:27 +0000
From: Prakash Sangappa <prakash.sangappa@...cle.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "rostedt@...dmis.org"
	<rostedt@...dmis.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "bigeasy@...utronix.de" <bigeasy@...utronix.de>,
        "kprateek.nayak@....com"
	<kprateek.nayak@....com>
Subject: Re: [PATCH V4 6/6] Add API to query supported rseq cs flags



> On May 23, 2025, at 12:57 PM, Mathieu Desnoyers <mathieu.desnoyers@...icios.com> wrote:
> 
> On 2025-05-13 17:45, Prakash Sangappa wrote:
>> For the API, add a new flag to sys_rseq 'flags' argument called
>> RSEQ_FLAG_QUERY_CS_FLAGS.
>> When this flag is passed it returns a bit mask of all the supported
>> rseq cs flags in the user provided rseq struct's 'flags' member.
>> Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
>> Signed-off-by: Prakash Sangappa <prakash.sangappa@...cle.com>
>> ---
>>  include/uapi/linux/rseq.h |  1 +
>>  kernel/rseq.c             | 17 +++++++++++++++++
>>  2 files changed, 18 insertions(+)
>> diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h
>> index 015534f064af..44baea9dd10a 100644
>> --- a/include/uapi/linux/rseq.h
>> +++ b/include/uapi/linux/rseq.h
>> @@ -20,6 +20,7 @@ enum rseq_cpu_id_state {
>>    enum rseq_flags {
>>   RSEQ_FLAG_UNREGISTER = (1 << 0),
>> + RSEQ_FLAG_QUERY_CS_FLAGS = (1 << 1),
>>  };
>>    enum rseq_cs_flags_bit {
>> diff --git a/kernel/rseq.c b/kernel/rseq.c
>> index c4bc52f8ba9c..997f7ca722ca 100644
>> --- a/kernel/rseq.c
>> +++ b/kernel/rseq.c
>> @@ -576,6 +576,23 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len,
>>   return 0;
>>   }
>>  + /*
>> + * return supported rseq_cs flags
>> + * It is an or of all the rseq_cs_flags;
>> + */
>> + if (flags & RSEQ_FLAG_QUERY_CS_FLAGS) {
>> + u32 rseq_csflags = RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT |
>> +   RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL  |
>> +   RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE |
> 
> Those 3 flags (above) are already or'd by RSEQ_CS_NO_RESTART_FLAGS,
> and they are all deprecated. See rseq_warn_flags().
> 
> So I would not return them within the set of supported
> rseq flags.

WIll remove those from the supported flags.

Thanks 
-Prakash.

> 
> Thanks,
> 
> Mathieu
> 
> 
> 
>> +   RSEQ_CS_FLAG_DELAY_RESCHED |
>> +   RSEQ_CS_FLAG_RESCHEDULED;
>> + if (!rseq)
>> + return -EINVAL;
>> + if (copy_to_user(&rseq->flags, &rseq_csflags, sizeof(u32)))
>> + return -EFAULT;
>> + return 0;
>> + }
>> +
>>   if (unlikely(flags))
>>   return -EINVAL;
>>  
> 
> 
> -- 
> Mathieu Desnoyers
> EfficiOS Inc.
> https://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ