All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <iwj@xenproject.org>
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Subject: [WIP PATCH 08/16] tools/xl: Fix potential deallocation bug
Date: Thu, 10 Dec 2020 15:09:06 -0800	[thread overview]
Message-ID: <3433bf049b9d626282e49824a744c9264a6db215.1608663694.git.ehem+xen@m5p.com> (raw)
In-Reply-To: <cover.1608663694.git.ehem+xen@m5p.com>

There is potential for the info and info_free variable's purposes to
diverge.  If info was overwritten with a distinct value, yet info_free
still needed deallocation a bug would occur on this line.  Preemptively
address this issue (making use of divergent info/info_free values is
under consideration).

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/xl/xl_list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xl/xl_list.c b/tools/xl/xl_list.c
index 8b391a9056..e30536fd9a 100644
--- a/tools/xl/xl_list.c
+++ b/tools/xl/xl_list.c
@@ -200,7 +200,7 @@ int main_list(int argc, char **argv)
                      info, nb_domain);
 
     if (info_free)
-        libxl_dominfo_list_free(info, nb_domain);
+        libxl_dominfo_list_free(info_free, nb_domain);
 
     libxl_dominfo_dispose(&info_buf);
 
-- 


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





  parent reply	other threads:[~2021-01-04 22:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 19:01 [WIP PATCH 00/16] Addition of formatting options to `xl list` subcommands Elliott Mitchell
2020-12-09 22:34 ` [WIP PATCH 14/16] WIP: tools/xl: Enhance "list" command Elliott Mitchell
2020-12-09 22:34 ` [WIP PATCH 07/16] tools/xl: Sort list command options Elliott Mitchell
2020-12-09 22:45 ` [WIP PATCH 06/16] tools/xl: Split list commands off of xl_info.c Elliott Mitchell
2020-12-10 23:09 ` [WIP PATCH 09/16] WIP: tools/xl: Implement generalized output formatting for `xl list` Elliott Mitchell
2020-12-10 23:09 ` [WIP PATCH 10/16] WIP: tools/xl: Implement output format option Elliott Mitchell
2020-12-10 23:09 ` Elliott Mitchell [this message]
2020-12-12  6:18 ` [WIP PATCH 11/16] WIP: tools/xl: Replace most of list_domains with use of format() Elliott Mitchell
2020-12-13  4:42 ` [WIP PATCH 12/16] WIP: UNTESTED: tools/xl: Replace remaining options with format() Elliott Mitchell
2020-12-13  5:14 ` [WIP PATCH 13/16] WIP: tools/xl: Purge list_domains() Elliott Mitchell
2020-12-18  1:42 ` [WIP PATCH 04/16] tools/xl: Rename printf_info()/list_domains_details() to dump_by_...() Elliott Mitchell
2020-12-18  1:42 ` [WIP PATCH 05/16] tools/xl: Merge down debug/dry-run section of create_domain() Elliott Mitchell
2020-12-18 21:32 ` [WIP PATCH 03/16] tools/xl: Mark libxl_domain_config * arg of printf_info_*() const Elliott Mitchell
2020-12-18 21:37 ` [WIP PATCH 01/16] tools/libxl: Mark pointer args of many functions constant Elliott Mitchell
2020-12-18 22:45 ` [WIP PATCH 02/16] tools/libxl: Tiny optimization of libxl__mac_is_default() Elliott Mitchell
2020-12-19  7:23 ` [WIP PATCH 15/16] WIP: tools/xl: Implement output format option for "vm-list" command Elliott Mitchell
2020-12-20  7:43 ` [WIP PATCH 16/16] WIP: tools/xl: Enhance " Elliott Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3433bf049b9d626282e49824a744c9264a6db215.1608663694.git.ehem+xen@m5p.com \
    --to=ehem+xen@m5p.com \
    --cc=iwj@xenproject.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.