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: <20241024.092248.1743299714523375638.fujita.tomonori@gmail.com>
Date: Thu, 24 Oct 2024 09:22:48 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: miguel.ojeda.sandonis@...il.com
Cc: aliceryhl@...gle.com, fujita.tomonori@...il.com,
 netdev@...r.kernel.org, rust-for-linux@...r.kernel.org, andrew@...n.ch,
 hkallweit1@...il.com, tmgross@...ch.edu, ojeda@...nel.org,
 alex.gaynor@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
 benno.lossin@...ton.me, a.hindborg@...sung.com, anna-maria@...utronix.de,
 frederic@...nel.org, tglx@...utronix.de, arnd@...db.de,
 jstultz@...gle.com, sboyd@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v3 5/8] rust: time: Add wrapper for fsleep
 function

On Wed, 16 Oct 2024 11:42:07 +0200
Miguel Ojeda <miguel.ojeda.sandonis@...il.com> wrote:

> On Wed, Oct 16, 2024 at 10:29 AM Alice Ryhl <aliceryhl@...gle.com> wrote:
>>
>> You probably want this:
>>
>> delta.as_nanos().saturating_add(time::NSEC_PER_USEC - 1) / time::NSEC_PER_USEC
>>
>> This would avoid a crash if someone passes i64::MAX nanoseconds and
>> CONFIG_RUST_OVERFLOW_CHECKS is enabled.
> 
> I think we should document whether `fsleep` is expected to be usable
> for "forever" values.
> 
> It sounds like that, given "too large" values in `msecs_to_jiffies`
> mean "infinite timeout".

Do you mean msecs_to_jiffies() returns MAX_JIFFY_OFFSET ((LONG_MAX >>
1)-1) with a value exceeding i32::MAX milliseconds?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ