From nobody Fri Jan 20 16:49:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz5740YWjz2t0Hk for ; Fri, 20 Jan 2023 16:49:04 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4Nz5735PfFz4CLs; Fri, 20 Jan 2023 16:49:03 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id A3BF1E999; Fri, 20 Jan 2023 08:49:00 -0800 (PST) Date: Fri, 20 Jan 2023 08:49:00 -0800 From: Gleb Smirnoff To: Alexander Chernikov Cc: Alan Somers , "Danilo G. Baio" , dev-commits-src-all@freebsd.org Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT Message-ID: References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> X-Rspamd-Queue-Id: 4Nz5735PfFz4CLs X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Fri, Jan 20, 2023 at 11:04:33AM +0000, Alexander Chernikov wrote: A> I think another question is that if if should be done by ifconfig(8) at all. Kernel can take care of trying to load the required modules, checking the privileges. A> I’m considering adding such code for the netlink-based interface creation. This is already done in netgraph, but I won't call this solution a pretty one. You ask kernel to do some network related ioctl(2), but it actually does kldload(2). At what stage of the syscall we understand that kldload(2) needs to be done? Are we free of network locks at this stage? Cause kldload will take a very different set of locks, possibly creating a LOR, and in an edge case will go into NFS taking network locks. -- Gleb Smirnoff