From nobody Sat Nov 01 17:18:45 2025 X-Original-To: freebsd-hackers@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 4czPhR1v8Wz6GG1M for ; Sat, 01 Nov 2025 17:18:47 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4czPhR1LwXz3skS; Sat, 01 Nov 2025 17:18:47 +0000 (UTC) (envelope-from jamie@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762017527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CFNH7MaI4+S3gPTdyW8oUAaDbJ4VvS5Pw4bBNvqV3bw=; b=NtMF1Kx6ZgOjK3slRKHlStx0N9eXt2eXvvVk+aWJfXooa350DPAEhL22USdaFrrozzesgE k+0mHxByzdZ6iFXEoTZc7uMpF4hchrEtb88StTkF6T+qj2e9kTlrZDM9O12yzTAkXSttJ0 GY7/vC6dkHBjIWm3dTuvenpSxdbmI6VbkOTDEql4YwH5TzQVpo5MCKE7ciDpyLqH9mDk6i FScaNIOuV4uZZv9CCXRitf+MtFtGWCJAU2kCv1DfmYeQN5GZBZMMZmnyJMVYvGWxcOhTeR xANhGgKWkc7l2udVwJxxXafE/qVzQep8v9HjpH+RLSqXgLg1sPqFJYLz19jyLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762017527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CFNH7MaI4+S3gPTdyW8oUAaDbJ4VvS5Pw4bBNvqV3bw=; b=VwJv83iFtUst0BHxLZbn2IrfgKYh1UAA7fLBxstiiyWZ1W/krQ7G7Oi30qE6EgSW9yHkEb +PsZc/r4RgGxVj6H98xHk5AWjPWOy5IW2Pr4yhQG9LbbiV4zFFxRqLW8rnGVf1OJV9RXPE o7Uosi5MxQj0LY09wjEx9bK4OpWtyz8Gr2EujIfyGLfe7LjVBOkAheErQ81R7kp3xUUB2I bU7zNwrGSHhBSkFIuN1MYF4XMMmLvav3qJp5KZFB7XiCi+Lea1I30z0+WCrk7CfXh5ThyC PoZV4vG61jGJvo2wROh8jGXVmZOIytQI62QsEniW3Vi5VEwNlLmcGztR/9mnnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762017527; a=rsa-sha256; cv=none; b=GLdH2EQu/c7jbQcf6LEHc2yVkCG4Lhsu5z2Jpbg7ba1x2GgD/fdNvN507NcDXmDMQJYk1/ vxSErRrsOT7CW9SawtmA1qbwCRgkKHsSPL8wslEuNPGrMD3Zwbf+2Z3XmHF+gN0x70hvAe NN9Fv0t86T5Gvapdp6BMwb0v5q1XoV9rwl4xoAQh+F5qqUwM6gaCT2CuNI4fuLeBYoECBp JOa9XykOyakFTA7jRGHR2MFoq0YiD5CfAA4GkrwrHT/51feh4YBzgtwUy+4mWxyiKZQnmo HMcxUi2fmIqWuQC/L99ecn2J4UjzuOeieGbk20HBKhkFqaHcFGt9kRBakNR9GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from m2.gritton.org (gritton.org [67.43.236.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jamie) by smtp.freebsd.org (Postfix) with ESMTPSA id 4czPhR0ZPYz1Ktj; Sat, 01 Nov 2025 17:18:47 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (localgritton [127.0.0.212]) by m2.gritton.org (Postfix) with ESMTPSA id 62EF38B0A0; Sat, 1 Nov 2025 10:18:45 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Date: Sat, 01 Nov 2025 10:18:45 -0700 From: James Gritton To: Andrea Cocito Cc: freebsd-hackers@freebsd.org Subject: Re: Exposing default route(s) to "inherit" jails In-Reply-To: <867AD117-5557-4BB8-8976-DBF56BBD8FF1@cocito.eu> References: <867AD117-5557-4BB8-8976-DBF56BBD8FF1@cocito.eu> Message-ID: X-Sender: jamie@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025-10-31 23:59, Andrea Cocito wrote: > Hallo, > > In a project I am working on we need to use in jails tools, like map, > which need to see the default route. Jails with “inherit” network mode > cannot see default route. > > I experimented with dedicated FIBs in which I inject the routes and > various other paths, nothing worked. I finally decided to patch the > kernel and add a sysctl knob. > > Setting net.route.inherit_jail_default_routes=1 makes the default > routes visible to “inherit” jails, leaving it at the default (0) keeps > the known and current behaviour. > > I wonder: > 1. Did I miss some other, simpler, solution? > 2. What are the security risks of exposing (read only( default routes > to a jail? > 3. Could this be useful to others? > 4. What would be the path to propose this as a PR for integration in > the codebase. > > So far the patch is tested on 14.3-p5. Patch attached. I don't see a problem with this. For that matter, I don't see a problem with seeing all the routes if the admin decides it's fine for a jail to see them. But don't take it from me - I hope someone else with more of a networking background will chime in with any reasons why this is or isn't a good idea. I would make this not a sysctl knob, but another flag under jail.allow. - Jamie