From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 22 05:34:03 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2EBB437 for ; Sun, 22 Feb 2015 05:34:02 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D93D2DD5 for ; Sun, 22 Feb 2015 05:34:02 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t1M5Y2DO029965 for ; Sun, 22 Feb 2015 05:34:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 195128] Memory leaks in lib/libpam/modules due to memory handling with login_getcapstr, et al Date: Sun, 22 Feb 2015 05:34:02 +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: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: darius@dons.net.au X-Bugzilla-Status: In Progress X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2015 05:34:03 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195128 --- Comment #8 from darius@dons.net.au --- I fixed some bugs with my previous fix - cap_mkdb would crash processing the termcap file. I pushed them to a branch on github - https://github.com/DanielO/freebsd/tree/cgetstr-leak root@freebsdhead:~ # valgrind --leak-check=full /usr/obj/src/FreeBSD-HEAD/usr.bin/cap_mkdb/cap_mkdb -l -f /tmp/termcap /src/FreeBSD-HEAD/share/termcap/termcap ==95888== Memcheck, a memory error detector ==95888== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==95888== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==95888== Command: /usr/obj/src/FreeBSD-HEAD/usr.bin/cap_mkdb/cap_mkdb -l -f /tmp/termcap /src/FreeBSD-HEAD/share/termcap/termcap ==95888== ==95888== ==95888== HEAP SUMMARY: ==95888== in use at exit: 2,285 bytes in 2 blocks ==95888== total heap usage: 5,131 allocs, 5,129 frees, 6,569,582 bytes allocated ==95888== ==95888== 16 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==95888== at 0x1007293: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) ==95888== by 0x12A1B0F: strdup (strdup.c:47) ==95888== by 0x400D49: main (cap_mkdb.c:120) ==95888== ==95888== LEAK SUMMARY: ==95888== definitely lost: 16 bytes in 1 blocks ==95888== indirectly lost: 0 bytes in 0 blocks ==95888== possibly lost: 0 bytes in 0 blocks ==95888== still reachable: 2,269 bytes in 1 blocks ==95888== suppressed: 0 bytes in 0 blocks ==95888== Reachable blocks (those to which a pointer was found) are not shown. ==95888== To see them, rerun with: --leak-check=full --show-reachable=yes ==95888== ==95888== For counts of detected and suppressed errors, rerun with: -v ==95888== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) root@freebsdhead:~ # valgrind --leak-check=full /usr/obj/src/FreeBSD-HEAD/lib/libc/tests/gen/getcap_test cgetstr_leak ==96919== Memcheck, a memory error detector ==96919== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==96919== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==96919== Command: /usr/obj/src/FreeBSD-HEAD/lib/libc/tests/gen/getcap_test cgetstr_leak ==96919== getcap_test: WARNING: Running test cases outside of kyua(1) is unsupported getcap_test: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4) OK: leaked 0 bytes passed ==96919== ==96919== HEAP SUMMARY: ==96919== in use at exit: 7,267 bytes in 40 blocks ==96919== total heap usage: 3,103 allocs, 3,063 frees, 4,208,879 bytes allocated ==96919== ==96919== LEAK SUMMARY: ==96919== definitely lost: 0 bytes in 0 blocks ==96919== indirectly lost: 0 bytes in 0 blocks ==96919== possibly lost: 0 bytes in 0 blocks ==96919== still reachable: 7,267 bytes in 40 blocks ==96919== suppressed: 0 bytes in 0 blocks ==96919== Reachable blocks (those to which a pointer was found) are not shown. ==96919== To see them, rerun with: --leak-check=full --show-reachable=yes ==96919== ==96919== For counts of detected and suppressed errors, rerun with: -v ==96919== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -- You are receiving this mail because: You are the assignee for the bug.