[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <gjlcd7nrmipdpim4dr2kfrk5mleo2yt2btwbhxdflzfcpckjjl@fieqlaavqja2>
Date: Thu, 23 Oct 2025 20:53:26 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Tamir Duberstein <tamird@...nel.org>
Cc: Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>, 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 <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, linux-pm@...r.kernel.org,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] rust: opp: simplify callers of `to_c_str_array`
On 23-10-25, 09:59, Tamir Duberstein wrote:
> Use `Option` combinators to make this a bit less noisy.
>
> Wrap the `dev_pm_opp_set_config` operation in a closure and use type
> ascription to leverage the compiler to check for use after free.
>
> Signed-off-by: Tamir Duberstein <tamird@...nel.org>
> ---
> Note: this diff is much smaller with whitespace suppressed (`-w`).
>
> An alternative approach to compiler checking for UAF that doesn't change
> indentation is to add `drop((self, clk_names, regulator_names))` after
> `let ret = ...;` but that felt more prone to becoming out of date if
> more owned data needed to be added to the function scope.
> ---
> Changes in v2:
> - Avoid use after free; add compiler checking. (Thanks Viresh!)
> - Link to v1: https://patch.msgid.link/20251020-opp-simpler-code-v1-1-04f7f447712f@kernel.org
> ---
> rust/kernel/opp.rs | 112 +++++++++++++++++++++++++++--------------------------
> 1 file changed, 58 insertions(+), 54 deletions(-)
Thanks, tested this and it works.
Lets see if someone has any more inputs, otherwise I can apply it.
--
viresh
Powered by blists - more mailing lists