From nobody Tue Jan 2 21:46:28 2024 X-Original-To: bugs@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 4T4RJ42H1Lz55trN for ; Tue, 2 Jan 2024 21:46:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T4RJ40V3Jz3G9T for ; Tue, 2 Jan 2024 21:46:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704231988; a=rsa-sha256; cv=none; b=wgDLTrLhA4qIvxSr1/iq0pFmsBKvCCuqB3hRIvDnFV00d1jDQ6ZJCLJ3izp335lf65srqs 9+YXcb+6JY9UhYoPgQtyyhhkkD4EbLVAcE6yfn+SJDup/Ie9YFgmHlRfD8gjNZ1IWO/XBY Jh4MCR2quhVWSp1EZaWpT9CXv+jJ55OjeVm+u9zWSSDsRs/dNzC7bcry4T0mwKBst2zGg0 ZTTzL/nSB9BhR+uZqFXnBDBt7a2wY4Xstpg2TZ7EgPjRz+T51PYRo7hTYnNbKEpGSUh0KG 87xYKD15QtmxqG09EmWleyi1lPA9Yz7Va7NuYhSk2yTAkLqSmj1kshP+5/WwHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704231988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7F5oNxFXYYnJ51VBoXPbJb2H82XKyNWFJsSjjCmKs+o=; b=hHFfNvucEjdCwIYgJ+iBgGtblVX0tz8M0WuKV4BqLPNxdCLSTyQfTeq0Hvn7V0kEG9pywf u5HaZUAPZPHSa2sx/ed7MFSZ0YW5wykhh/CpAzNCkLYMVXNgndqxGh9Zv9nQRCHrQ8csmh eKvtHH4NMCkEK3lwlXHNq+lL6H1OcLq5uudHn8PrLKZ2pub9IKr+ZEEVsZK9Y0NjarbIwX CfbgojkmNSVd26vmhMe9AW4GAHRIQU5kted8kNe28VXZQ3HWKV52DVsLP16mKIakSSFd/X TUXGug8sls/B+sDMPA513uDh6u9h86qRdIzeSl+tZ+2JranD/sFIANLzhJiolw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T4RJ36grhz1HLB for ; Tue, 2 Jan 2024 21:46:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 402LkRMw006831 for ; Tue, 2 Jan 2024 21:46:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 402LkR25006830 for bugs@FreeBSD.org; Tue, 2 Jan 2024 21:46:27 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 276043] md5(1) et al are broken when reading the last argument because of capsicum(4) code Date: Tue, 02 Jan 2024 21:46:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: rbranco@suse.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276043 Ricardo Branco changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|fread(3) is truncated when |md5(1) et al are broken |reading from |when reading the last |pseudo-filesystems |argument because of | |capsicum(4) code --- Comment #2 from Ricardo Branco --- I figured out the problematic code at: ``` /* * XXX Enter capability mode on the last argv file. * When a casper file service or other approach is * available, switch to that and enter capability m= ode * earlier. */ if (*(argv + 1) =3D=3D NULL) { #ifdef HAVE_CAPSICUM cap_rights_init(&rights, CAP_READ, CAP_FSTA= T); if (caph_rights_limit(fileno(f), &rights) <= 0 || caph_enter() < 0) err(1, "capsicum"); #endif } ``` So md5 works if I pass /dev/null as the last argument: $ md5 /compat/linux/proc/cpuinfo MD5 (/compat/linux/proc/cpuinfo) =3D 36966b53dc9e57113b2b7637d8b51720 $ md5 /compat/linux/proc/cpuinfo /dev/null MD5 (/compat/linux/proc/cpuinfo) =3D 142e18c701aa58b0e691920e2bf98e56 MD5 (/dev/null) =3D d41d8cd98f00b204e9800998ecf8427e --=20 You are receiving this mail because: You are the assignee for the bug.=