From nobody Fri Jan 20 17:12:52 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 4Nz5fp49sKz2t3N6 for ; Fri, 20 Jan 2023 17:13:06 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz5fn6r51z4Fb4; Fri, 20 Jan 2023 17:13:05 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-f49.google.com with SMTP id i23so1492897ual.13; Fri, 20 Jan 2023 09:13:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UpeCCZpIBGbsvwwh+ADeImKfnWuFgzPCm4zytJd6JSk=; b=uQvcnk0m6LnmbClOWLpPEmtLUdLq81U8ts0RRH2JY7ZYvMKbOATf9Gz9pjQyTAnnYo VXkV7Gv4BLmbZamo+5VoRercMEN5blbXDQKvN6Yg3it3saa2hFyZBxNl1EF/unYBNPbp ndALqyN+RIOqX8k3ZG6i4RMkuKybHdtSCg1ivv0rkzD6pmSvjeSkZsHpNVnkVmNKhjMt 2zaRYX9E4Rh+68LmIs1BZbK8kGL2MGqYuYPho0zqzoVFObPxonsUnVc0OCBliuooy5Nm cIQSm3sqz0nyoXOyYhLumNGmeL7VI6Igodw5W69WUq1ZYsyxmJ6U0LAVXg0Bf2Q6QZ21 pYpA== X-Gm-Message-State: AFqh2kqtwheOq4Ofrja98h0QYG8Ko5kA2ciLozsGD2ib6yn5dPUAIuDj hMNPkLVaJXoXqM2XTzhDlmgifZZ7m/qFiu7/FLOT8gDe X-Google-Smtp-Source: AMrXdXvWYRrBORdWzLdqHD0BFFzVfNEi5WFAkrPGP+yNUj5DjXhAPj5sCz9vl+b0iqyS2oWRnmxEZNcvsK6lzEBgRGc= X-Received: by 2002:ab0:85e:0:b0:5ef:f384:b17a with SMTP id b30-20020ab0085e000000b005eff384b17amr1677407uaf.57.1674234784083; Fri, 20 Jan 2023 09:13:04 -0800 (PST) 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 References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 20 Jan 2023 10:12:52 -0700 Message-ID: Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT To: Gleb Smirnoff Cc: Alexander Chernikov , "Danilo G. Baio" , dev-commits-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Nz5fn6r51z4Fb4 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, 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 9:49 AM Gleb Smirnoff wrote: > > 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) a= t all. Kernel can take care of trying to load the required modules, checkin= g the privileges. > A> I=E2=80=99m considering adding such code for the netlink-based interfa= ce 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 ifconfig tries to load a KLD preemptively, long before it does the hard work (cloning an interface or something). Trying to teach the kernel to load the module on-demand would be hard, we would probably have to do it in many different places.