From nobody Wed Jun 07 01:29:58 2023 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 4QbVBv5Wtnz4ZjNH for ; Wed, 7 Jun 2023 01:29:59 +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 4QbVBt6xYPz44Df for ; Wed, 7 Jun 2023 01:29:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686101399; 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; bh=QhJz133PniUZnm+9/4JYzgp6gHMnbSXpAS4I8Wjw/KM=; b=iLNAPtglJcWacd7eK2GXhHk4NeFIqf45e3GFf/PpRga4/G7zuv7q0kzw9HBcTWd4WwN5ZN TBO0M003K5+A4j75LhkYxUZ9qW3JDn2dyfdYzaAavXYKDAj2Mc3qZ/Q6rB4VIGE5CKZSt8 TS1KBoNpD3sgGK3+tmfXU8NA2zNkmA9FUn8To9VCbzecEyrF4HsqyLtNM2to6hDYb2vgx8 i4Oczw5BuXpGh+w6Joju2QykXgb6Tdw0uHrchUn90lofMbT11LzGq7LR1EmNr4WGjFDlaP 9avx+qNYcFWm0YubwMN4flsFsvG5rAHlJhqO2/8OtBWZFGA/8XCZvPOz2we1IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686101399; a=rsa-sha256; cv=none; b=vkt/0AWLNv9S1E8EVnGaOXhOjRxA8Z0qCWtkSZTihr9wk3dsA30JEFWaWAdScEVuoiDU7p 9DsCh7kmm+Pkhm0ngAwJyInUqZ9uCHC0LMqS0llSlyD2aRBPVRZ3HEewYTgXriyEukvPWA WF0gfdv79xH6FXfRURG84o7RaDXNMwcy8B47XYxNT5sRY3o/nPmI8U2b8nFiVluJKnpc+Q hVbwChACWoenoXq9UZMLV9KMqvyOyG+7pcwJkXauYWxZSGvQTO8PF4tybN0MGYjSz0HYez iKCsV3vwxGbhMpb+n6sU8hVWkMQIUqEXSq23S+1SHfq22ovGuV4fIrllbI4HHw== 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 4QbVBt5lG5zsLC for ; Wed, 7 Jun 2023 01:29:58 +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 3571TwRR065362 for ; Wed, 7 Jun 2023 01:29:58 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3571TwE8065361 for bugs@FreeBSD.org; Wed, 7 Jun 2023 01:29:58 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 271874] login_getpath etc. leak memory contrary to manpage Date: Wed, 07 Jun 2023 01:29:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: andrew@tao11.riddles.org.uk X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271874 Bug ID: 271874 Summary: login_getpath etc. leak memory contrary to manpage Product: Base System Version: 13.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: andrew@tao11.riddles.org.uk The manpage for login_getpath, login_getcapstr, etc., explicitly says that returned strings are not to be freed, that the memory will be reused or fre= ed on login_close. This is an outright lie; the memory is just leaked. Most callers probably d= on't care about this, since they're setting up for an exec, but some do, This isn't new; it was raised nearly 10 YEARS AGO in #195128, which remains open and unfixed. However, I suggest that the right fix might be to leave t= he code alone and change the manpage; at least OpenBSD explicitly documents th= at returned capability strings are to be freed if they are not the passed-in def/err values. --=20 You are receiving this mail because: You are the assignee for the bug.=