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: <20220428205001.hiuzwpn5emxtrh4s@offworld>
Date:   Thu, 28 Apr 2022 13:50:01 -0700
From:   Davidlohr Bueso <dave@...olabs.net>
To:     Prakash Sangappa <prakash.sangappa@...cle.com>
Cc:     linux-kernel@...r.kernel.org, tglx@...utronix.de,
        akpm@...ux-foundation.org, peterz@...radead.org,
        manfred@...orfullife.com
Subject: Re: [PATCH v3] ipc: Update semtimedop() to use hrtimer

On Thu, 28 Apr 2022, Prakash Sangappa wrote:

>semtimedop() should be converted to use hrtimer like it has been done
>for most of the system calls with timeouts. This system call already
>takes a struct timespec as an argument and can therefore provide finer
>granularity timed wait.
>
>Signed-off-by: Prakash Sangappa <prakash.sangappa@...cle.com>
>Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
>---
>v1->v2:
>  - Use timespec64_valid() to validate timeout
>     and other changes as suggested by Thomas Gleixner
>v2-v3 Added Reviewed by tag
>---

The second '---' is not necesary, it's the first one that counts.

>@@ -2166,10 +2167,8 @@ long __do_semtimedop(int semid, struct sembuf *sops,
>		sem_unlock(sma, locknum);
>		rcu_read_unlock();
>
>-		if (timeout)
>-			jiffies_left = schedule_timeout(jiffies_left);
>-		else
>-			schedule();
>+		timed_out = !schedule_hrtimeout_range(exp,
>+				current->timer_slack_ns, HRTIMER_MODE_ABS);

I'm wondering if the slack parameter instead of passing the timer_slack_ns
value immediately, we should do a rt_task() check and pass zero if so.
And the opposite for the posix mqueue case: bit a little more lenient when
!rt_task() and pass current->timer_slack_ns instead of zero. Of course mq
is a lot more rt aware than sysv semaphores, but that doesn't mean both forms
of ipc are not seen used with or without RT constraints.

Thanks,
Davidlohr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ