From nobody Tue Jan 14 10:59:00 2025 X-Original-To: net@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 4YXR2X1ZTkz5kXG6 for ; Tue, 14 Jan 2025 10:59:00 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXR2X0hf0z3KnG for ; Tue, 14 Jan 2025 10:59:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736852340; 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=aLpmShFCnER+Vnz0/HcgpofsjzrGvIXjvke1YFrvKrw=; b=DAp9dH/R6cZT47UWyKPUWcQMMxVvpEQrLjPHhI+bZ1KXXFKSa6Z1CGFQ6zXw6qQkdYgmVA f0kgoreWRKAnKIDbY5AB9tgUnyZMKv/DqpFddbsew/mXok0uuRxE2puvXiSsq0nBCoHz8Z RsuNoJQTxLJfLOz2sSmaRd/6GOuqzlGKnf7+ljVvDzafzPbcY8h3trQ1lFt+QMN+jGQMnU rCIZegFnd0ZaucEkFMjSqxEiSN7HnBdzOAybmmPPM9lUnpboBglriJ4Ngl9YiU1s1TjFzo 5wI0RdJ5+hVCRV4nJ60pq+bH4lVuTjc7bpqYIiiEbM5KRs9S5bb3dv4VmMZxTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736852340; 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=aLpmShFCnER+Vnz0/HcgpofsjzrGvIXjvke1YFrvKrw=; b=QsHySDm7wawyYJzXAGw9MY31u/XBAwfGue221PEj7mqNAqJKXuIUwJli8bKGZ7yWFx/F8W 2N+RMV2pzjoFmpKpqGoApo3Sy6F2kCBvv4YzIzGNyuUDhFwxdu+PgUOjOF6zoE6yNOsjPP 2OdX4PaUtZGUW8tABdV/YKuTJTQZAKUpdKZXa+dGWJNMKkMuX/RrJdGIZ7LVTJH96sCDQ4 1MnqTQ5x3BlQEprB149N5zXRdFvwnMgqcgtfIYdj7Sfy/Kthb895hLXZ30wRSheJRCSd/B /B++IfyaufPJXGGU41UQyeMfTJx/YMCptVgUuf0IPWM2AyyELEwO3t030G5NAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736852340; a=rsa-sha256; cv=none; b=qjn8NZSTiwkIMD33VZYnQUdW8RNnGGx85vNFgUFPXN8lMokNjZk+rvWdMz27aZimBBvYxw y3mOk0YHuGGMWkOS/UYFY1q0pvzLr/S3/zW/88lSy+ukompKi0Ma2Ums9WFZ+mCZa6M/1T GufCK0Tv7qswgABN5xWJ/ZPWwwj4JUBOxQor0l2GBWDLPfuTrxsJqeXTl0Xdl/PIZA+nEs N9ZN5KcvxfcXkM2WXsa/mvL2fp2LXEpajpG8oIbHo7m2S17ZhHA+L4o9xA700oKPdwbyfd 7OS2RBdXrfidHD3RUs33O3Xh2JLP740OJoOs66WnjnzR+DBfJQxCIjtQ+Tap7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YXR2W702Sz1CQq for ; Tue, 14 Jan 2025 10:58:59 +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 50EAwxm7059989 for ; Tue, 14 Jan 2025 10:58:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 50EAwxAJ059988 for net@FreeBSD.org; Tue, 14 Jan 2025 10:58:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 173002] [net] data type size problem in if_spppsubr.c Date: Tue, 14 Jan 2025 10:59:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D173002 --- Comment #7 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D08ec14fecf6a93c0321c31ba1f0b04db6= b888f16 commit 08ec14fecf6a93c0321c31ba1f0b04db6b888f16 Author: Zhenlei Huang AuthorDate: 2025-01-14 10:56:49 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-14 10:56:49 +0000 sppp: Fix getting wrong spppreq cmd from ioctl ifr->ifr_data is supposed to point to a struct spppreq. The first member cmd of struct spppreq is int type. It was pre-read via `fueword()` befo= re a full fetching. Unfortunately an user space `struct spppreq spr` may n= ot be zeroed explicitly, on 64bit architectures `fueword()` reads 64bit wo= rd thus the garbage (extra 4 bytes) may be read into kernel space (subcmd). Prior to f9d8181868ee, `subcmd` was declared as int and assigned from `fuword()` and was implicitly converted from long to int. On 64bit litt= le endian architectures the implicitly conversion overflows (undefined bahavior) which happen to trash the garbage (the extra 4 bytes, high 32 bits) and worked, but no luck on 64bit big endian architectures. Since f9d8181868ee `subcmd` was changed to u_long then there is no conversion so we end up mismatching `subcmd` with user space's `cmd`. It is also a bit hackish to get the value of cmd via `fueword()`, inste= ad we refer to it directly from spr->cmd. This is a direct commit to stable/13 as sppp(4) no longer exists in main and stable/14. PR: 173002 Reviewed by: glebius (previous version) Fixes: f9d8181868ee Fixed yet more ioctl breakage due to the type of .= .. Differential Revision: https://reviews.freebsd.org/D47335 sys/net/if_spppsubr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=