From nobody Sun Feb 12 07:47:39 2023 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 4PF01m0J9gz3q0YW for ; Sun, 12 Feb 2023 07:47:40 +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 4PF01l5Sbpz3Jct for ; Sun, 12 Feb 2023 07:47:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676188059; 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=JHUVG7ZGavxVE11xrhC43FVqUw2rOQRtGDb24pn3ZC4=; b=SnpGFfqbw6fd3p9hS9SdzUNO1lfm4zf+E5Ttac6Ppz13dInN457mo8muj3KwNmubLnXGNE +Ek0uwnMr9hoETkDNX2yyyANhGqMqZfulBu7XP91xi5kpXQTLFweb0y1YpCs8itgyBVV/S hZ+DDKsZrcln0+mEO8FukGjAEQSjYjmHtWZSDHcr17oBN4fiFyrp5yPlbIkqpY9hwTpMLK Z4Vg83xtL3x+5ijCHbQdjg6sJa4xogj5FflYyJmyg7XO9iy6CWsVFC57jCjezfoLuZ2UFg k413hc3wpb0+/3Gy2DUX9glL8wg2W1VJx9151HZNmjeZa1sKYJNbX3AQk3TXCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676188059; a=rsa-sha256; cv=none; b=x4VBvTnqszljGcdcSqRd5k/u8AeEaF37cwneySvEwj1XiVxu6rjgtPDuR+JcUpw7/RCeoU M2RU3HUExBpxYzq9kPbFOCpWz966zFvKTE69ur2OH4LM86DEdxypXTi44TZbY7J/aGCjyH Zrq1cVxAQjZ9lIY/bDjseErIF6/vpbz/MEK7iBFVC0qKDhQtAVZZbw5+LRFjXhedbjj++N PlrLeeKt/0zdWv2LiiNYH9NvuX+l9n3lQ8KFIiWCIxif6j7HpogzSewB6XxGQQeBMuHhd8 l/8wX+ZDbw66Jl3Pk5M3Y+3k98db6IgnlQb3qQh/vEoxNhYnp0mClZcmJKVaZg== 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 4PF01l4WxwzWLZ for ; Sun, 12 Feb 2023 07:47:39 +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 31C7ldt1046725 for ; Sun, 12 Feb 2023 07:47:39 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 31C7ldoS046724 for bugs@FreeBSD.org; Sun, 12 Feb 2023 07:47:39 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 269509] Memory leak in ofwbus Date: Sun, 12 Feb 2023 07:47:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: jarek@jpelczar.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 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269509 Bug ID: 269509 Summary: Memory leak in ofwbus Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: jarek@jpelczar.com The ofwbus_attach function (in sys/dev/ofw/ofwbus.c) performs iteration over nodes. for (node =3D OF_child(node); node > 0; node =3D OF_peer(node)) { if (ofw_bus_gen_setup_devinfo(&obd, node) !=3D 0) continue; simplebus_add_device(dev, node, 0, NULL, -1, NULL); } ofw_bus_gen_setup_devinfo allocates memory to temporary buffer, however this memory is never freed, so the change should probably look as follows: for (node =3D OF_child(node); node > 0; node =3D OF_peer(node)) { if (ofw_bus_gen_setup_devinfo(&obd, node) !=3D 0) continue; simplebus_add_device(dev, node, 0, NULL, -1, NULL); + ofw_bus_gen_destroy_devinfo(&obd); } --=20 You are receiving this mail because: You are the assignee for the bug.=