From nobody Fri Feb 18 23:21:06 2022 X-Original-To: dev-commits-src-main@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 028B019CE4BE; Fri, 18 Feb 2022 23:21:06 +0000 (UTC) (envelope-from git@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 4K0nkV6D9Pz3j3m; Fri, 18 Feb 2022 23:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645226466; 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=hVzECXaXjr3tvlzG/TJKIkcC1ZA2Z/PsFpBEc8JZtQ0=; b=eDNe6PeQpGhJH74U4PRPvGf+A09AYO5OqNQtdhoF2O1hkPNotG0okU6Tr9CwJM0q8UQ3aa QaDseOsdqdF+DJSnRuPsaqJXxVtN2sVAOGAoLghhPH/kVxeTu8K5GaF3C/5FnJUzQLQC/0 J0MeSGCzQhv3xw6DyZCQeJY0CRZzQkw6PByD5Y+EVLecvY+mqLH/uTKvsAja9GVnOmZIwk W7gQgBrjrx7eB+rPJuOcX3nusrfyDq2x8KoaELaw3PjfdfWaKdGalnmkM/byWhmfYjlmHg R2f7WOAalU1xL6rZeBo3QAPfXunFnmxIfPSUzbiyYHh2duSN25CzT/LQ6J3ZFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 B6F2526138; Fri, 18 Feb 2022 23:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21INL6u5061019; Fri, 18 Feb 2022 23:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21INL62T061018; Fri, 18 Feb 2022 23:21:06 GMT (envelope-from git) Date: Fri, 18 Feb 2022 23:21:06 GMT Message-Id: <202202182321.21INL62T061018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: bd6e8729d6f6 - main - ctl ramdisk: Free compare buffer after a compare I/O request. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd6e8729d6f6d42102b0359b56b7e3c89edd0ec9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645226466; 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=hVzECXaXjr3tvlzG/TJKIkcC1ZA2Z/PsFpBEc8JZtQ0=; b=fSq1eaIJJM+BqFs2xnKxRvE2szi8M4mGnUtBDpbglHCOtkxlbmjmK6Mg7qN9t7r0m0sU4O YH0wgblZ1T3VjxqVa/F4fK2Speet5DyJTUgw9Q7sjCBL4A4f8nlgLTH62jaXS8RWIVjV5Z xtoTzBzjpkjnbSri7HS1OCoR5cXCl8TWtgbFkP+XFt9/46sJ2QMV/za/8kX2obl7msywyr 2fzDw5N8xNG2P0RowQGb2TFyZjA5rgshXetLecGfrEHufq4Bh1RXe6qZy/Y81aMBJFV+B9 HyzqMrR6HFVBNyTQwACGWUdfW0+5PNCw4A2XDKIuDdu8/2ve7UGPagw3I9nPAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645226466; a=rsa-sha256; cv=none; b=lu6/XeJl+KiIRy3AHmM//5Ke2luqRvU5SfuIArlm4OlsYATT4dHRhJPm269n7DEoIBpzfK h242oB3JGnQO96aXeoEzuQXUGOJe9gyU249rtfDe26EmvCDjvd1Fccq03j9GSAglBaWz52 RZ7FNrzlxEvSyEDXU4qORywCZ5oMX486PDtWSlFlEZGgwWlJJylIySMVG42Y2IrfZRZ7V3 7dLylFinf+VuRTMG3Otf6xjkC0SFIdwQKNSSsAbrbyjmaMNoi1mnPQCh38Xz8GSqCbHqb4 fCVvhmbZO95WYDF6bqddVnJ5CY77h6DhM8NleP2VKprtnE54DkiuqxYrneTu/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bd6e8729d6f6d42102b0359b56b7e3c89edd0ec9 commit bd6e8729d6f6d42102b0359b56b7e3c89edd0ec9 Author: John Baldwin AuthorDate: 2022-02-18 23:20:14 +0000 Commit: John Baldwin CommitDate: 2022-02-18 23:20:14 +0000 ctl ramdisk: Free compare buffer after a compare I/O request. For a compare request, the ramdisk backend allocates a temporary buffer to hold the I/O data and then compares it against the LUN's pages in ctl_backend_ramdisk_cmp after the data has been filled. However, the tempory buffer was leaked when after the comparison was complete. Fix this by freeing the buffer after the comparison. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D34316 --- sys/cam/ctl/ctl_backend_ramdisk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/ctl/ctl_backend_ramdisk.c b/sys/cam/ctl/ctl_backend_ramdisk.c index 6febdd469bdd..9ddee1814aa1 100644 --- a/sys/cam/ctl/ctl_backend_ramdisk.c +++ b/sys/cam/ctl/ctl_backend_ramdisk.c @@ -386,6 +386,7 @@ ctl_backend_ramdisk_cmp(union ctl_io *io) if (res < cbe_lun->blocksize) break; } + free(io->scsiio.kern_data_ptr, M_RAMDISK); if (lbas > 0) { off += io->scsiio.kern_rel_offset - io->scsiio.kern_data_len; scsi_u64to8b(off, info);