NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/59081: Add close_range() system call




On 3/27/25 10:25 PM, Christos Zoulas via gnats wrote:
The following reply was made to PR kern/59081; it has been noted by GNATS.

From: Christos Zoulas <christos%zoulas.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: kern-bug-people%netbsd.org@localhost,
  gnats-admin%netbsd.org@localhost,
  netbsd-bugs%netbsd.org@localhost,
  rbranco%suse.de@localhost
Subject: Re: kern/59081: Add close_range() system call
Date: Thu, 27 Mar 2025 17:20:09 -0400

  --Apple-Mail=_5E07A147-354B-43C5-A631-962ED35D838E
  Content-Transfer-Encoding: 7bit
  Content-Type: text/plain;
  	charset=us-ascii
Here is a complete patch: https://www.netbsd.org/~christos/close_range.diff christos
The whole approach with CLOSE_RANGE_UNSHARE is broken, meaning that
the current behaviour with the Linux emulation is broken.

It doesn't respect the fd range and unshares the whole filedesc structure:

https://github.com/NetBSD/src/blob/trunk/sys/compat/linux/common/linux_misc.c#L2090

The diff in https://www.netbsd.org/~christos/close_range.diff is doing the same.

Linux limits CLOSE_RANGE_UNSHARE to the specified range:

https://github.com/torvalds/linux/blob/master/fs/file.c#L788

So either we consider my patch in its original form or drop this attempt to
extend CLOSE_RANGE_UNSHARE to NetBSD.

Either way, the current Linux code needs fixing, which my patch does.

Best,
Ricardo.


Home | Main Index | Thread Index | Old Index