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: <CANiq72ktoo_yfapmGsjkbyd07DwC7wcTL_3h9pHvk6Rt01+w7g@mail.gmail.com>
Date: Wed, 26 Mar 2025 12:06:34 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Jani Nikula <jani.nikula@...ux.intel.com>
Cc: Lyude Paul <lyude@...hat.com>, Maxime Ripard <mripard@...nel.org>, 
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>, dri-devel@...ts.freedesktop.org, 
	linux-kernel@...r.kernel.org, 
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann <tzimmermann@...e.de>, 
	David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Miguel Ojeda <ojeda@...nel.org>, 
	Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, 
	Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
	"open list:RUST:Keyword:b(?i:rust)b" <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH 1/2] drm/edid: Use unsigned int in drm_add_modes_noedid()

On Wed, Mar 26, 2025 at 11:39 AM Jani Nikula
<jani.nikula@...ux.intel.com> wrote:
>
> That is largely the point, though. You know something fishy is going on
> when you have a negative resolution. Nobody blinks an eye when you ask
> for 4294963K telly, but it's still just as bonkers as that negative 4K.
>
> I think the change at hand is fine, but please let's not pretend using
> unsigned somehow protects us from negative numbers.

Is there a reasonable maximum that could/should be checked for? (I
don't know the context)

In other words, if one wants to detect invalid values in a primitive
type, one needs to define the valid range anyway. Using the negatives
of a signed type is convenient in C, but perhaps there is a tighter
threshold?

If so, then an extra advantage is that on the Rust side one could also
have a proper strong type for this etc.

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ