From nobody Tue Feb 13 02:28:10 2024 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 4TYlcT3f2Dz59YDy for ; Tue, 13 Feb 2024 02:28:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 4TYlcS5vxMz3xdM for ; Tue, 13 Feb 2024 02:28:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5600c43caddso4641933a12.2 for ; Mon, 12 Feb 2024 18:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1707791302; x=1708396102; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=r5uCYuv5vGFnLL1HPK9A9JUbEG8KLZ4hd3S8416+U/A=; b=MIGPhen3I7Vrtl/jbS3Ur0Oc+4W+yKFoYq4cDyGPsCXB6WGrQmy4aT2vRvcYmNwO76 y/0GA3ELzW9WhhCF0r0SZwtZamyUB6aNlzPTsIkv1QCQ1JUYltjajiFXYffb67BEYT9L MDdCusjcGRqAp9GvGxFAxzuf0nD1eFS/1h90HGqwJ5j15NNABOFf1J6WLE+pw/rZEjst 776LiM8dQrvEChXgqtW62G1f9nz4F74k+3phBXqq3qMlKdboFwF7KgwT2EVb9ME6ykiK KrDWrPVGnuu4dapQTKLQZ7nOzXeJRnKX7fHhCo64eslZGVUfL8Oxf/HFxJlWijU9jBqu qREA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707791302; x=1708396102; h=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=r5uCYuv5vGFnLL1HPK9A9JUbEG8KLZ4hd3S8416+U/A=; b=ENIh2qNL9sjhlwIrb3ehoa7hf8YhZOZsYOzaKZa+EfGqsZhDY/3CtjLb1MmmIvtsGt 3TeoGruItiPdpC7uI5JjISort+1lKOlzmu4C5+SPMN3NModRtVQiS6+asSTiK4C13dZZ Lunra+NPfXjSXlU5ujj00OVEPbq8FDkIQtx3/3TBPoaQHg4IivEh9BOcOxAklC34WlFk bhzG9N0ElIvIk+g9bfKOGKqL217i71DJ1/8YRaXSrbwVPllpStqNfjY4hvyfwlc2sz7E XJE/RA/4JWEbL00jUQc5qqNBVSpsEyZyYhgclA+U4BXXSj5VIw00z3fFKNAHK4G16GMw YyVg== X-Forwarded-Encrypted: i=1; AJvYcCX8FjduVBJ478Pk3/rgjdeEQh9u8Fp2poUAw2yH1qezXey3UMjhC9ju3S+cqKInToV2xXJ2oC3cdTKmJUIv6lYd1Mva8ZL8J2kJ/FXS1QA3 X-Gm-Message-State: AOJu0Yw/yB6445JDlv2e5YdUVcZZp5VSJNogZASKEn0dyg1tt7wMkRLV nRKod2IDAtFmTJHE16ChBSzYoetqkjkB5aTRKs6yyfm8y5YouEzujYfXoG5gPbGcbkB3K0PDCRU wppq30T7JyG+Vr6KYXWDcbUaPVRyhthk8oclyzA== X-Google-Smtp-Source: AGHT+IEIRoz1ewqhQyBgUHmLDaJgAOhil9LJGcPdvFKvzE9tljiuB/6wPduJRbCnY6gbzMUcsclE12t2rtwm5MIdJ8Q= X-Received: by 2002:aa7:d40f:0:b0:561:3de1:ba36 with SMTP id z15-20020aa7d40f000000b005613de1ba36mr5517366edq.34.1707791301776; Mon, 12 Feb 2024 18:28:21 -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: <202402121853.41CIrfdp030604@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 12 Feb 2024 19:28:10 -0700 Message-ID: Subject: Re: git: 0df5f65908dd - main - reboot: Implement zfs support To: Jessica Clarke Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000e4a7c306113a2543" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4TYlcS5vxMz3xdM X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --000000000000e4a7c306113a2543 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2024, 6:10=E2=80=AFPM Jessica Clarke w= rote: > On 12 Feb 2024, at 18:53, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D0df5f65908dd1913212535e6c4dd4c7= 3ce19c305 > > > > commit 0df5f65908dd1913212535e6c4dd4c73ce19c305 > > Author: Warner Losh > > AuthorDate: 2024-02-12 18:45:37 +0000 > > Commit: Warner Losh > > CommitDate: 2024-02-12 18:45:37 +0000 > > > > reboot: Implement zfs support > > > > Implement full support for ZFS -k support. For ZFS, we have to set a > > property that gets cleared by the boot loaeder for whether or not to > > process nextboot.conf. Do this using system("zfsbootcfg..." rather > than > > coding the small subset of that program inline to avoid CDDL > > contamination of reboot and the complications of disabling CDDL and/= or > > ZFS. The few bytes needed to implement reboot for systems with zfs i= s > > not worth saving for systems w/o ZFS. > > Can we at least use posix_spawn rather than system? The asprintf+system > combo may in practice be safe, especially given the nature of this > tool, but I don=E2=80=99t think it=E2=80=99s a great idea to be writing s= ystem-using > code in 2024 when it=E2=80=99s easy to avoid. That way nobody needs to st= op and > think carefully about whether the code is safe, because it is by > construction. > News to me, but also the first time I've used system in 15 or 20 years... Sure, I'll rework and add you to the reviewers. So TIL... Warner > --000000000000e4a7c306113a2543 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Feb 12, 2024, 6:10=E2=80=AFPM Jessica Clarke &= lt;jrtc27@freebsd.org> wrote:<= br>
On 12 Feb 2024, at 18:53, Warner Lo= sh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D0df5f65908dd1913212535e6c4dd4c= 73ce19c305
>
> commit 0df5f65908dd1913212535e6c4dd4c73ce19c305
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-02-12 18:45:37 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-02-12 18:45:37 +0000
>
>=C2=A0 =C2=A0 reboot: Implement zfs support
>
>=C2=A0 =C2=A0 Implement full support for ZFS -k support. For ZFS, we ha= ve to set a
>=C2=A0 =C2=A0 property that gets cleared by the boot loaeder for whethe= r or not to
>=C2=A0 =C2=A0 process nextboot.conf. Do this using system("zfsboot= cfg..." rather than
>=C2=A0 =C2=A0 coding the small subset of that program inline to avoid C= DDL
>=C2=A0 =C2=A0 contamination of reboot and the complications of disablin= g CDDL and/or
>=C2=A0 =C2=A0 ZFS. The few bytes needed to implement reboot for systems= with zfs is
>=C2=A0 =C2=A0 not worth saving for systems w/o ZFS.

Can we at least use posix_spawn rather than system? The asprintf+system
combo may in practice be safe, especially given the nature of this
tool, but I don=E2=80=99t think it=E2=80=99s a great idea to be writing sys= tem-using
code in 2024 when it=E2=80=99s easy to avoid. That way nobody needs to stop= and
think carefully about whether the code is safe, because it is by
construction.

News to me, but also the first time I've used system in 15= or 20 years...

Sure, I&= #39;ll rework and add you to the reviewers. So TIL...

Warner=C2=A0
--000000000000e4a7c306113a2543--