From owner-svn-src-head@freebsd.org Wed May 3 18:07:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E28D5CF31; Wed, 3 May 2017 18:07:49 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED5BCB8; Wed, 3 May 2017 18:07:49 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x241.google.com with SMTP id x188so7052279itb.3; Wed, 03 May 2017 11:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nswA4UjDWWLUBGC5qaD0ZjaknqEnYZRayCwvj7Xpckw=; b=kc151v3BikoE0RaNnajcgmGw9d0vK3RXSBcxK3MDbsOV53hXvTtxFAtzQtIr5Q6aL4 hQN6t8ilFiOdzm0wjR7qQXc+/9udbym8zFPqqyfnye5xgev3sKGIDJEO6aQAa2QAFEcY n9qC1zMsGQ5LCCQtNtz4j+kVweOGcc0oU9i+1A1QWOUEadHyYeyLqDgXIHBsS43zdvNZ o+VdeCh9o1a1P0UfTK9pINFWj2an0gFUClKeb3xCzOOSERH1lo3cTp1zXf8RKfGOvTgM Owq/PV2UOuTLWAOUMopZ4sI+DZW6FvyyQ62M8i1TMEKr6HZPlVucATme91qUl9ZbhkPK EehA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nswA4UjDWWLUBGC5qaD0ZjaknqEnYZRayCwvj7Xpckw=; b=WhmlH58yLZ6vlsloOZv46sW9Z+640eXuZl1CG6PrAwvf/vO9ETV4if921IhcCvrz28 t7Z81S11lfpFCotaaF+JQkNqXKhTbWiWtzFjrf04+jJgIL8gjCu0jieFsn/gA4lV83WU DSLm8D4tyQs6x7PRHUvAv5VOtfDGNH5bXmX/Mv3aFX6jx7ckXBOH7OKF2zjIYrDVBTIR w1I5cWXdbf5z6Nb4zFCunhUF+6J/ecP0DJ7vhXcxRvlitge/V1EKOcgj+3TJhpTXfrID 4xMuZo08lwQeiM5W2p+GOakuzegcPzLOrVDwGJzRBffmaubJVHMlJlK4VAN2auI79cSI /5RA== X-Gm-Message-State: AN3rC/763VqXyI2V10acLfspgzO1TVbZBfahpW1l1kyh86hlBeDmVh8G l6W9oHgmcp+bZlBPYJo0mASuREdhPg== X-Received: by 10.36.57.68 with SMTP id l65mr5452725ita.101.1493834868262; Wed, 03 May 2017 11:07:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.132.202 with HTTP; Wed, 3 May 2017 11:07:47 -0700 (PDT) In-Reply-To: References: <201705031721.v43HL2vS071819@repo.freebsd.org> From: Ryan Stone Date: Wed, 3 May 2017 14:07:47 -0400 Message-ID: Subject: Re: svn commit: r317755 - head/sbin/ifconfig To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2017 18:07:49 -0000 On Wed, May 3, 2017 at 1:39 PM, Ryan Stone wrote: > > > On Wed, May 3, 2017 at 1:21 PM, Alan Somers wrote: > >> Author: asomers >> Date: Wed May 3 17:21:01 2017 >> New Revision: 317755 >> URL: https://svnweb.freebsd.org/changeset/base/317755 >> >> Log: >> Various Coverity fixes in ifconfig(8) >> >> * Exit early if kldload(2) fails (1011259). This is the only change that >> affects ifconfig's behavior. >> >> > > Please revert this ASAP. kldload is expected to fail for a number of > benign reasons and this change is likely to prevent any network > configuration from being applied to systems, breaking remote access. > > It's been pointed out to me off-list that the situation is not quite as dire as I had originally believed. The ifconfig code in question already searches to check if the module in question is loaded before calling kldload. However, there is at least one driver (mlx4_en) that does not follow the "if_" kld module naming convention that this code depends on, so this change will make it impossible to apply configuration to mlx4_en interfaces. Additionally, it is possible that other drivers use the naming convention for their kld file but not for the module declared in the C code, in which case this change would also break configuration of those interfaces. jhb@ suggests that ifconfig should only attempt to load a module if the interface doesn't already exist, by calling if_nametoindex to check for the existence of the interface. That seems to be a reasonable fix for me, but in the interest of not breaking users' networking configuration (potentially making it impossible to fix a remote machine), I'd recommend that the part of the change that checks the return code from kldload() be reverted while a fix for this issue is worked on.