From nobody Tue Apr 02 11:49:40 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 4V85lV2zHtz5GQKq for ; Tue, 2 Apr 2024 11:49:42 +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 4V85lV170gz4q0m for ; Tue, 2 Apr 2024 11:49:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712058582; a=rsa-sha256; cv=none; b=PFhNZjI0OxI6AeaRm7dTJi8/AAUMLuXwQvsSMcPIV8m4Hss2pvvl2jH93jGqpMKkXSOhhG yVTn4+W2pWW4kl4B4DLN7SaQReaqDd4g3MFa/eV6f71T5Z0gggZSV1A5QrHH/sW/fj/4Fg BQOHWvhkP5I9WF6fqvj1pi+IVfDgDQ7rI8RS9b7oq+vhIgtOxoerP6eAVlNOSSI332ImU0 wpH0yZzwSCmh4pCE8UHDgT9J/SsWxUAV01Q4G1iO2ArHEOxwBeJhAxe0haxqEVE+qyQxKK 2P8k4qQHMpHPORlD1UNcs5aLeF60IT9w4rp98G8zUgzHHWQX0REVcmYEX6DVFw== 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=1712058582; 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=HnfkD4+2unqDdIHTlkzAHjxnlE2ydn2shx2qWBLo5j8=; b=NCyArCKA+pePQlbZ4K2yhKRLVzvbZlMtxw3Ieain5fBNm6/9B+Lhu6KOeB+HvIcwACYO3i Z+Ap24imYuUZiqUWc7tVE8zEx55rqTGPnM4rt6lIjkt4JZLiP0yZjAyoQtSnEuF8BIBh+e 0AaFyC11z56VEMugd8IOiN7/8sNUB88Bj8CiL4QC3WKFcErzFCiDm1KcuEFsn19xty23av o6ySGa4jmn9qatwNYNL1EriYke+XjMSYQoR7EMPhDB+pFz4Xrt95LbWvb5KDK8Peuda9uG XeoNyv0UZ7FPDPkKQyKPJteMrQf91MFctuEcjBVW7SudQA0k+fnK0Zv4BvBu+A== 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 4V85lV0kpzznh3 for ; Tue, 2 Apr 2024 11:49:42 +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 432BnfKv004267 for ; Tue, 2 Apr 2024 11:49:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 432BnflW004262 for bugs@FreeBSD.org; Tue, 2 Apr 2024 11:49:41 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 278128] Use of uninitialized memory in libcam Date: Tue, 02 Apr 2024 11:49:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: pen@lysator.liu.se 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278128 Bug ID: 278128 Summary: Use of uninitialized memory in libcam Product: Base System Version: 13.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: pen@lysator.liu.se While running valgrind on a small tool I noticed a warning/problem it detec= ted in /usr/src/lib/libcam/camlib.c (cam_open_device->cam_lookup_pass->ioctl): =3D=3D61793=3D=3D Memcheck, a memory error detector =3D=3D61793=3D=3D Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward = et al. =3D=3D61793=3D=3D Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyr= ight info =3D=3D61793=3D=3D Command: ./drvlist -v =3D=3D61793=3D=3D=20 =3D=3D61793=3D=3D Syscall param ioctl(generic) points to uninitialised byte= (s) =3D=3D61793=3D=3D at 0x4A0536A: ioctl (in /lib/libc.so.7) =3D=3D61793=3D=3D by 0x206977: cam_lookup_pass (camlib.c:450) =3D=3D61793=3D=3D by 0x206882: cam_open_device (camlib.c:266) =3D=3D61793=3D=3D by 0x204D84: do_device (drvlist.c:398) =3D=3D61793=3D=3D by 0x2059A3: main (drvlist.c:604) =3D=3D61793=3D=3D Address 0x1ffbffee10 is on thread 1's stack =3D=3D61793=3D=3D in frame #1, created by cam_lookup_pass (camlib.c:421) =3D=3D61793=3D=3D Uninitialised value was created by a stack allocation =3D=3D61793=3D=3D at 0x2068A4: cam_lookup_pass (camlib.c:421) The problem is that cam_lookup_pass() doesn't fully initialize the ccb stru= ct before calling ioctl(). Probably not a big issue, but to get rid of that warning a simple memset(&ccb, 0, sizeof(ccb)) before the code that initiali= ze it is needed. --=20 You are receiving this mail because: You are the assignee for the bug.=