From nobody Fri Oct 14 13:52:56 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 4Mpns43mnHz4fWKN for ; Fri, 14 Oct 2022 13:52:56 +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 4Mpns41XXMz40l4 for ; Fri, 14 Oct 2022 13:52:56 +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 4Mpns40Zqxznqw for ; Fri, 14 Oct 2022 13:52:56 +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 29EDquhV072323 for ; Fri, 14 Oct 2022 13:52:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 29EDqufS072322 for bugs@FreeBSD.org; Fri, 14 Oct 2022 13:52:56 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 267050] free(buf) in libbsm/bsm_io.c should be free(*buf) Date: Fri, 14 Oct 2022 13:52:56 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665755576; 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=UHB0cTjSOEYLkfm8dSjXFwGo1+lzcaAGYyVkGA6CjZ4=; b=f5jLzyI7/cOqZKtoaTwJhSKS/OsQKcsechGT4jpd6oUL3X8AViP2yeXa4pN7SvYfdYTtPn AUPjmj4EtEH43auUNNn1mMhbS3g8rt8J+5A4rD2wZF/ge2/V7YZGEeDCk0G3li10we4f1n oM1rsGUl34tiVkNBTncx7bXbNYCBbrjPO+rfMZf+5G1OHpJ4yayR6CaqYKEEaFvFqOReLc mrCLbApK4a81Gx2GCg7SSL4+uqerLI6wcHRKWH/BDwiToFo24lv4He3sI444O+SEbaQ1f9 I4Mwicdl7uCXQgz7hjXO4BTrAjDRzEg/c2CdNSCgO1xvALGmCdBg+ipRz8fWNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665755576; a=rsa-sha256; cv=none; b=aPY8B8JxNAEjxJaGTlDMIxia98UFu6rI6hLdxY6n8J1rOgP1jnunmggW5LoBE3ecYfb2Nr 3HSimAdy/mYyzets43FLvOYh66/o2m3GBdpJGjQ1BUgK7HQ1mywYibDQFzL5i3Sf1rhxWS wORlxJ/cCL/CocoZW+rV4sfGbZ6VRLZJNC5Tyzs4+ZUAgOTJoVuCbUJl9MS+1Lk+v9yyhv 5FmUxiA74G2jNbRqZkgB7VtrK49dvYuAWcWXAynld0W0qXscdODkSs6Z3wNImj+WAO//an 9pjKIwHVyV1dWLGa4o7vN8nOG+EBn3aYdz4qgv5aBdZXFaZu5isHmCm+ESI1yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267050 Bug ID: 267050 Summary: free(buf) in libbsm/bsm_io.c should be free(*buf) Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Created attachment 237300 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D237300&action= =3Dedit auditreduce input that causes a segmentation fault in free() au_read_rec() in /usr/src/contrib/openbsm/libbsm/bsm_io.c says: *buf =3D malloc(recsize); ...; free(buf); The free(buf) should be free(*buf). I've attached a demo: % auditreduce < auditreduce1a.dat Segmentation fault Thread 2.1 received signal SIGSEGV, Segmentation fault. Address not mapped to object. [Switching to LWP 100451 of process 16127] 0x000000080120ad11 in ?? () from /lib/libc.so.7 (gdb) where #0 0x000000080120ad11 in ?? () from /lib/libc.so.7 #1 0x0000000801084680 in au_read_rec (fp=3D0x80127c6c0, buf=3D0x7fffffffde= 28) at /usr/src/contrib/openbsm/libbsm/bsm_io.c:4600 #2 0x0000000001024851 in select_records (fp=3D0x80127c6c0) at /usr/src/contrib/openbsm/bin/auditreduce/auditreduce.c:532 #3 0x0000000001024384 in main (argc=3D, argv=3D) at /usr/src/contrib/openbsm/bin/auditreduce/auditreduce.c:829 This is on 13.1-RELEASE-p2 as well as a recent CURRENT. --=20 You are receiving this mail because: You are the assignee for the bug.=