From nobody Tue Feb 13 02:28:10 2024 X-Original-To: dev-commits-src-main@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 4TYlcT1D3Cz59Y1D for ; Tue, 13 Feb 2024 02:28:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 4TYlcS5vrBz3xPh 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-x533.google.com with SMTP id 4fb4d7f45d1cf-55f279dca99so5927434a12.3 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=JwzhQ9VCcovyeH4p59dH38StOJ/cJN0mUvsT0/1AiQz/wBEwbjDJIlrNUOmkOQ6KtX RnvnYBZ9f0Bh82g1jG/0Ag/hFRwP49Il0MKBDkk/dRwbw4xTobSQVrFaT36gPjyjVt8j HTcWW8eTeej8lmzsMITWLV1qy8nSddoHVn9ZcZC2fv30WiIO0/LBdUqJBSimGvDuthLA ceyvE8D9dGaRTNA8S9CzXkEzCLU1kXINuar2icVH+9zZN0liC5E7TfyTL5m9LbwxqlBH aXYU+JjJd6cSrFfebdd5e1yhup4fATWweCB+hI73zP8twHFLc+AebYx5nkPx75rEQ4qm JzeQ== X-Forwarded-Encrypted: i=1; AJvYcCXh5GTKI30vuqQqHllhohsgQzFZmtr5xXv1j3rAY+meFXw8yAIrMSsoKUv/8HU8lffgh6uDC9bZ+Mdy3Gg9zhIzdi23IHGodP9dwWfj3II3BA== X-Gm-Message-State: AOJu0YygsiIUeNCHzMPh2Mj7ABDcg7EIgLwU+x2fKmVWE9phNEIsFPqJ X822IRkrgtNYn5B4OVHmug06FSSCmKEppuyGLjD/yRCu7u8BfOWv3BYAo9B7dDDKbr+jzJwn7TX SrtKRVh4yLydOehVjXxeZBluDvVbaBoQwoNrOqA== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4TYlcS5vrBz3xPh 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--