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: <b07a1e07-9265-4b77-9665-0bfae9b506d3@kxxt.dev>
Date: Tue, 27 Jan 2026 21:09:41 +0800
From: Levi Zim <i@...t.dev>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
 Tamir Duberstein <tamird@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, 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>,
 Alex Gaynor <alex.gaynor@...il.com>, Boris-Chengbiao Zhou <bobo1239@....de>,
 Kees Cook <kees@...nel.org>, rust-for-linux@...r.kernel.org,
 linux-kernel@...r.kernel.org, stable@...r.kernel.org,
 Daniel Almeida <daniel.almeida@...labora.com>, Fiona Behrens <me@...enk.dev>
Subject: Re: [PATCH] scripts: generate_rust_analyzer.py: avoid FD leak


On 1/26/26 10:09 AM, Miguel Ojeda wrote:
> On Thu, Jan 22, 2026 at 5:44 PM Tamir Duberstein <tamird@...nel.org> wrote:
>>
>> Use a context manager to avoid leaking file descriptors.
> 
> This may have been intentionally written like that for simplicity,
> since I think CPython closes them immediately in practice even if it
> does not guarantee it (and I think the kernel may be assuming CPython
> given the version requirement?).

Path.read_text from pathlib would be a better choice for keeping the simplicity
while ensuring the file is closed.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.read_text

Best regards,
Levi
 
> Nevertheless, it is better to be explicit and proper, but it is not
> urgent, so I would say let's put this in rust-analyzer after the merge
> window even if you end up considering it a fix.
> 
> Like in the other one, I don't see the Tested-by from Daniel, so I
> would suggest taking the chance to double-check that meanwhile too.
> 
> Thanks!
> 
> Cheers,
> Miguel
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ