From nobody Tue Apr 23 10:24:08 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 4VNys54b8Sz5Jv27 for ; Tue, 23 Apr 2024 10:24:09 +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 4VNys52kcZz4Lln for ; Tue, 23 Apr 2024 10:24:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713867849; a=rsa-sha256; cv=none; b=esK4KdWVl8hT7qeeXvWBuHK5/3WL5j+c9nRvDPxjPnzXT4fiALPHg72VwBYZMTP32hw+6h 8JjlE8lx78DK4oE+1FthpuoDezMlc7/jY1hwP4KsezXgncDY20e3V+MScJYLeXliuhZJ0t YYu4bxRROnClCHUjUUacbMeGxd6uLqwJ3uAyMspTabmOBEDlEXpk8vEn96kMcWTYXgmtrY yPR6poUhS8Z7kP+kgOpYx0BnwqTaZIskMXohuWgHy4Brq5T3YbjU3/yropfk2ENtYLgqlZ BLoJyzX6qPd4DRgal75Eb8hJ3Y6/4vqj7s7MPyDmKJkdtElIzKtzM+1PlQfgvw== 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=1713867849; 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=ju1oqx5hg+zBkUGRjJqfrjFgxSzjq7CF5ceM7vs1a+c=; b=WJdtQpfRU0mYe54PnRNNsLtpxhk8VDZVwZ8ymZPJ9jEwxX9B04MS2d/1Hpx/LKWHLt6I5e 81d72yxj8LDI4bxfPe3YotRJv3EVE4ssDhyQKVfGAmQK9aMxAlPAhjoty1Rxrek7tfsGOE CnJU3+3JXRz6Mr5elzcQiYqE/jNyhb7+hP/rKRiUyPYj6jFk+nLLoP/SQTtMSNu29B4eM9 AEA2DQshUbdzbMWCL9jf9hBj8NVcs6YHNMYn8JBzW3pliVN49dPwQCiJSBH4jJq1lcyFLb FQfQJ9wWXauaJpVSphVUdV8Fsdg+qOE7o2gsETO6BQAMor5pCGBKodaF5qg3Cg== 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 4VNys52LbMzSYP for ; Tue, 23 Apr 2024 10:24:09 +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 43NAO9km099713 for ; Tue, 23 Apr 2024 10:24:09 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43NAO9Dv099712 for bugs@FreeBSD.org; Tue, 23 Apr 2024 10:24:09 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 278546] fdevname_r: pass partially uninitialized memory to kernel Date: Tue, 23 Apr 2024 10:24:08 +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: 14.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: rozhuk.im@gmail.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: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278546 Bug ID: 278546 Summary: fdevname_r: pass partially uninitialized memory to kernel Product: Base System Version: 14.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: rozhuk.im@gmail.com Created attachment 250173 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D250173&action= =3Dedit patch valgrind: =3D=3D55093=3D=3D Syscall param ioctl(generic) points to uninitialised byte= (s) =3D=3D55093=3D=3D at 0x860342A: ioctl (in /lib/libc.so.7) =3D=3D55093=3D=3D by 0x855D1B6: fdevname_r (in /lib/libc.so.7) =3D=3D55093=3D=3D by 0x863842C: ptsname (in /lib/libc.so.7) =3D=3D55093=3D=3D by 0x76DCBD2: openpty (in /lib/libutil.so.9) =3D=3D55093=3D=3D by 0x76DCC93: forkpty (in /lib/libutil.so.9) =3D=3D55093=3D=3D by 0x7E9F8B4: UnixProcessImpl::Execute(wxEvtHandler*, wxArrayString const&, unsigned long, wxString const&, IProcessCallback*) (CodeLite/unixprocess_impl.cpp:312) =3D=3D55093=3D=3D by 0x7D1F4CA: CreateAsyncProcess(wxEvtHandler*, wxArra= yString const&, unsigned long, wxString const&, std::__1::vector, std::__1::allocator > > const*, wxString const&) (CodeLite/asyncprocess.cpp:274) =3D=3D55093=3D=3D by 0x7D20BA0: CreateAsyncProcess(wxEvtHandler*, wxStri= ng const&, unsigned long, wxString const&, std::__1::vector, std::__1::allocator > > const= *, wxString const&) (CodeLite/asyncprocess.cpp:282) =3D=3D55093=3D=3D by 0x1495BE1E: GitPlugin::AsyncRunGit(wxEvtHandler*, w= xString const&, unsigned long, wxString const&, bool) (git/git.cpp:2961) =3D=3D55093=3D=3D by 0x149587CF: GitPlugin::ProcessGitActionQueue() (git/git.cpp:1274) =3D=3D55093=3D=3D by 0x149569E2: GitPlugin::DoSetRepoPath(wxString const= &) (git/git.cpp:496) =3D=3D55093=3D=3D by 0x1494509D: GitPlugin::OnWorkspaceLoaded(clWorkspac= eEvent&) (git/git.cpp:1013) =3D=3D55093=3D=3D Address 0x1ffbffcfc4 is on thread 1's stack =3D=3D55093=3D=3D in frame #1, created by fdevname_r (???:) =3D=3D55093=3D=3D Uninitialised value was created by a stack allocation =3D=3D55093=3D=3D at 0x855D180: fdevname_r (in /lib/libc.so.7) =3D=3D55093=3D=3D=20 struct fiodgname_arg { int len; void *buf; }; #define FIODGNAME _IOW('f', 120, struct fiodgname_arg) /* get dev. na= me */ char * fdevname_r(int fd, char *buf, int len) { struct fiodgname_arg fgn; fgn.buf =3D buf; fgn.len =3D len; if (_ioctl(fd, FIODGNAME, &fgn) =3D=3D -1) return (NULL); return (buf); } memory pad between len and buf is uninitialized. --=20 You are receiving this mail because: You are the assignee for the bug.=