From nobody Tue May 10 13:53:22 2022 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 F3F0F1AD2CD0 for ; Tue, 10 May 2022 13:53:22 +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 4KyKJ25t63z3Q4W for ; Tue, 10 May 2022 13:53:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 AAA32267BD for ; Tue, 10 May 2022 13:53:22 +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 24ADrMtr098445 for ; Tue, 10 May 2022 13:53:22 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24ADrMRp098444 for bugs@FreeBSD.org; Tue, 10 May 2022 13:53:22 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 263893] pam_exec.so in auth stack with expose_authtok option makes su segfault Date: Tue, 10 May 2022 13:53:22 +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: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: titus@edc.ro X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652190802; 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=+gDyc4OnACE2W9Nu6ZKjzfcLyCrmfT1MjaWzsLB1YbA=; b=CsOzTMCFeXEAp45dhCWbG54YUpeqf13wnH5/J4w6NdegCpckpOeOGzrnQrBV4fJJbEE/VQ L3Y/4cKvhjkyUetR+2QIPVqoH0OeBWG24eRteGqh8aATsdlaB8YufKbXzxvTotavMzgesI tSuJqj82DGwqXfPSiJHYt36ZL+zNVBIRdKSehSz8q9O2ND5d0MU+fV6ZLgebJTZBbwfmtq u+LwhlgF5Yc9JUbI5j8rIHx44S6fZHVmuKVKUuwfE+ADaawerzLytNxunxmH8MHcwev3Mo iZl8ZF4V3quNJsCQGo4fvK1LoQ2MwDTe6MvwSrBEdE/smPbWZQiA5+FvqfD7zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652190802; a=rsa-sha256; cv=none; b=Yk7r6+wj9+uz7mc9aq/O52wH+uIXeh/yK6lAlQyxfr8N6uwpuYy4uH85yKRBNBShIa77Gh lzhLUJHpe75UWOCTeZBUHj/Vs4A3REh5PjPvuYVFo1h6OegawwYvlvsWhIspEaJjEqWm4+ 8x2ugOCdEV14PEdXxIfLmdQpFmZ/zg5urwiSBSkNJGe5nl6xQh73XKiZIHWVRL9ShXXlj4 Xre1CE3hfA8AeYPksoRc9LLoVV2UHy0BoSzTsvaOxn0EYCtiqtVUujV8gI9lVwQBodNxXt ZJI1bOWT8dpw0caotq9AakjvFvgh9jvB1tEzeJ2Ot685rNE0Krrzh6DXFOM0Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263893 titus m changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |titus@edc.ro --- Comment #1 from titus m --- from pam_exec(8) expose_authtok Write the authentication token to the program's standard input stream, followed by a NUL character. Ignored for pam_sm_setcred(). problem is that it is not ignored when code _pam_exec() is trying to retrieve the auth token when it is called from pam_sm_setcred pam_get_item will set item to null; PAM_AUTHTOK item is= set to null when pam_authenticate finishes then a strlen is performed on null and it segfaults if (options->use_first_pass || strcmp(func, "pam_sm_setcred") =3D=3D 0) { /* don't prompt, only expose existing token */ rc =3D pam_get_item(pamh, PAM_AUTHTOK, &item); authtok =3D item; }=20 ...... authtok_size =3D strlen(authtok) + 1; // <=3D bombs here --=20 You are receiving this mail because: You are the assignee for the bug.=