From: "Jerome Marchand" <jmarchan@redhat.com>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Jerome Marchand <jmarchan@redhat.com>
Subject: [PATCH 00/38] trace-cmd: fix misc issues found by static analysis
Date: Wed, 5 Jun 2024 15:40:15 +0200 [thread overview]
Message-ID: <20240605134054.2626953-1-jmarchan@redhat.com> (raw)
A number of issues were found by running static analysers on the code
of trace-cmd with openscanhub[1]. Mostly ressource leak, but some are
more serious like memory corruption.
[1] https://fedoraproject.org/wiki/OpenScanHub
Jerome Marchand (38):
trace-cmd listen: close ofd before exiting process_client()
trace-cmd msg: prevent a memory leak in get_trace_req_args()
trace-cmd lib: prevent a memory leak in read_header_files()
trace-cmd: call dlclose() in the error path of load_plugin()
trace-cmd lib: prevent possible memory coruption in add_plugin_file()
trace-cmd lib: prevent a memory leak in handle_options()
trace-cmd lib: prevent a memory leak in regex_event_buf()
trace-cmd lib: prevent a memory leak in create_event_list_item()
trace-cmd lib: prevent a memory leak in read_ftrace_printk()
trace-cmd: don't print a NULL string in append_pid_filter()
trace-cmd record: prevent possible memory coruption in
get_pid_addr_maps()
trace-cmd hist: close tracecmd handle when trace_hist() exits early
trace-cmd record: prevent a memory leak in show_error()
trace-cmd record: prevent memory leak in update_pid_filters()
trace-cmd lib: check the return value of do_lssek() in
trace_get_options()
trace-cmd lib: don't double close a file descriptor in
read_header_files()
trace-cmd lib: prevent memory leak in ptp_clock_server()
trace-cmd lib: remove useless code in tracecmd_plog()
trace-cmd record: prevent memory leak in add_all_instances()
trace-cmd lib: check for a negative return value of read in
tracecmd_compress_copy_from()
trace-cmd record: prevent memory leak in clear_func_filter()
trace-cmd dump: prevent buffer overrun in dump_clock()
trace-cmd lib: prevent buffer overrun in read_string()
trace-cmd: close file descriptor in trace_vsock_make()
trace-cmd lib: prevent memory leak in glob_events()
trace-cmd record: don't print a NULL string in get_temp_file()
trace-cmd lib: prevent a possible file descriptor leak in
set_proc_kptr_restrict()
trace-cmd lib: remove unused tracecmd_parse_cmdlines() function
trace-cmd record: prevent memory leak in setup_network()
trace-cmd listen: prevent memory leak in communicate_with_client()
trace-cmd listen: prevent a infinite loop in communicate_with_client()
trace-cmd lib: prevent memory leak in tracecmd_create_event_hook()
trace-cmd record: prevent memory corruption in parse_record_options()
trace-cmd mem: prevent a memory leak in trace_mem()
trace-cmd: move the initialization of found_pid at the beginning of
stop_trace_connect()
trace-cmd record: check the length of the protocol version received
trace-cmd record: close socket fd before retrying to connect
trace-cmd lib: prevent a memory leak in tracecmd_tsync_proto_getall()
lib/trace-cmd/trace-compress.c | 4 +--
lib/trace-cmd/trace-hooks.c | 1 +
lib/trace-cmd/trace-input.c | 17 +++++++------
lib/trace-cmd/trace-msg.c | 13 ++--------
lib/trace-cmd/trace-output.c | 39 +++++++++++++++++++-----------
lib/trace-cmd/trace-plugin.c | 8 +++---
lib/trace-cmd/trace-timesync-ptp.c | 4 ++-
lib/trace-cmd/trace-timesync.c | 2 +-
lib/trace-cmd/trace-util.c | 26 ++------------------
tracecmd/trace-dump.c | 2 +-
tracecmd/trace-hist.c | 4 ++-
tracecmd/trace-listen.c | 13 +++++++---
tracecmd/trace-mem.c | 3 ++-
tracecmd/trace-read.c | 2 +-
tracecmd/trace-record.c | 19 +++++++++++----
tracecmd/trace-vm.c | 2 +-
tracecmd/trace-vsock.c | 8 ++++--
17 files changed, 87 insertions(+), 80 deletions(-)
--
2.44.0
next reply other threads:[~2024-06-05 13:41 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 13:40 Jerome Marchand [this message]
2024-06-05 13:40 ` [PATCH 01/38] trace-cmd listen: close ofd before exiting process_client() Jerome Marchand
2024-06-05 13:40 ` [PATCH 02/38] trace-cmd msg: prevent a memory leak in get_trace_req_args() Jerome Marchand
2024-06-05 13:40 ` [PATCH 03/38] trace-cmd lib: prevent a memory leak in read_header_files() Jerome Marchand
2024-06-05 13:40 ` [PATCH 04/38] trace-cmd: call dlclose() in the error path of load_plugin() Jerome Marchand
2024-06-05 13:40 ` [PATCH 05/38] trace-cmd lib: prevent possible memory coruption in add_plugin_file() Jerome Marchand
2024-06-05 13:40 ` [PATCH 06/38] trace-cmd lib: prevent a memory leak in handle_options() Jerome Marchand
2024-07-17 20:27 ` Steven Rostedt
2024-06-05 13:40 ` [PATCH 07/38] trace-cmd lib: prevent a memory leak in regex_event_buf() Jerome Marchand
2024-06-05 13:40 ` [PATCH 08/38] trace-cmd lib: prevent a memory leak in create_event_list_item() Jerome Marchand
2024-07-17 20:31 ` Steven Rostedt
2024-10-29 6:26 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 09/38] trace-cmd lib: prevent a memory leak in read_ftrace_printk() Jerome Marchand
2024-06-05 13:40 ` [PATCH 10/38] trace-cmd: don't print a NULL string in append_pid_filter() Jerome Marchand
2024-06-05 13:40 ` [PATCH 11/38] trace-cmd record: prevent possible memory coruption in get_pid_addr_maps() Jerome Marchand
2024-06-05 13:40 ` [PATCH 12/38] trace-cmd hist: close tracecmd handle when trace_hist() exits early Jerome Marchand
2024-06-05 13:40 ` [PATCH 13/38] trace-cmd record: prevent a memory leak in show_error() Jerome Marchand
2024-07-17 20:51 ` Steven Rostedt
2024-10-29 6:31 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 14/38] trace-cmd record: prevent memory leak in update_pid_filters() Jerome Marchand
2024-06-05 13:40 ` [PATCH 15/38] trace-cmd lib: check the return value of do_lssek() in trace_get_options() Jerome Marchand
2024-07-17 21:10 ` Steven Rostedt
2024-10-29 6:31 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 16/38] trace-cmd lib: don't double close a file descriptor in read_header_files() Jerome Marchand
2024-06-05 13:40 ` [PATCH 17/38] trace-cmd lib: prevent memory leak in ptp_clock_server() Jerome Marchand
2024-06-05 13:40 ` [PATCH 18/38] trace-cmd lib: remove useless code in tracecmd_plog() Jerome Marchand
2024-06-05 13:40 ` [PATCH 19/38] trace-cmd record: prevent memory leak in add_all_instances() Jerome Marchand
2024-06-05 13:40 ` [PATCH 20/38] trace-cmd lib: check for a negative return value of read in tracecmd_compress_copy_from() Jerome Marchand
2024-06-05 13:40 ` [PATCH 21/38] trace-cmd record: prevent memory leak in clear_func_filter() Jerome Marchand
2024-06-05 13:40 ` [PATCH 22/38] trace-cmd dump: prevent buffer overrun in dump_clock() Jerome Marchand
2024-07-17 22:55 ` Steven Rostedt
2024-10-29 6:31 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 23/38] trace-cmd lib: prevent buffer overrun in read_string() Jerome Marchand
2024-07-18 0:08 ` Steven Rostedt
2024-06-05 13:40 ` [PATCH 24/38] trace-cmd: close file descriptor in trace_vsock_make() Jerome Marchand
2024-06-05 13:40 ` [PATCH 25/38] trace-cmd lib: prevent memory leak in glob_events() Jerome Marchand
2024-06-05 13:40 ` [PATCH 26/38] trace-cmd record: don't print a NULL string in get_temp_file() Jerome Marchand
2024-06-05 13:40 ` [PATCH 27/38] trace-cmd lib: prevent a possible file descriptor leak in set_proc_kptr_restrict() Jerome Marchand
2024-06-05 13:40 ` [PATCH 28/38] trace-cmd lib: remove unused tracecmd_parse_cmdlines() function Jerome Marchand
2024-06-05 13:40 ` [PATCH 29/38] trace-cmd record: prevent memory leak in setup_network() Jerome Marchand
2024-07-18 0:25 ` Steven Rostedt
2024-10-29 6:34 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 30/38] trace-cmd listen: prevent memory leak in communicate_with_client() Jerome Marchand
2024-06-05 13:40 ` [PATCH 31/38] trace-cmd listen: prevent a infinite loop " Jerome Marchand
2024-06-05 13:40 ` [PATCH 32/38] trace-cmd lib: prevent memory leak in tracecmd_create_event_hook() Jerome Marchand
2024-07-18 1:16 ` Steven Rostedt
2024-10-29 6:36 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 33/38] trace-cmd record: prevent memory corruption in parse_record_options() Jerome Marchand
2024-07-18 1:50 ` Steven Rostedt
2024-06-05 13:40 ` [PATCH 34/38] trace-cmd mem: prevent a memory leak in trace_mem() Jerome Marchand
2024-07-18 1:53 ` Steven Rostedt
2024-10-29 6:38 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 35/38] trace-cmd: move the initialization of found_pid at the beginning of stop_trace_connect() Jerome Marchand
2024-06-05 13:40 ` [PATCH 36/38] trace-cmd record: check the length of the protocol version received Jerome Marchand
2024-07-18 2:11 ` Steven Rostedt
2024-10-29 6:40 ` Jerome Marchand
2024-06-05 13:40 ` [PATCH 37/38] trace-cmd record: close socket fd before retrying to connect Jerome Marchand
2024-06-05 13:40 ` [PATCH 38/38] trace-cmd lib: prevent a memory leak in tracecmd_tsync_proto_getall() Jerome Marchand
2024-06-05 16:17 ` [PATCH 00/38] trace-cmd: fix misc issues found by static analysis Steven Rostedt
2024-10-29 8:01 ` [PATCH 0/8 v2] " Jerome Marchand
2024-10-29 8:01 ` [PATCH 1/8] trace-cmd lib: Prevent a memory leak in handle_options() Jerome Marchand
2024-10-29 8:01 ` [PATCH 2/8] trace-cmd record: Prevent a memory leak in show_error() Jerome Marchand
2024-10-29 8:01 ` [PATCH 3/8] trace-cmd lib: Check the return value of do_lseek() in trace_get_options() Jerome Marchand
2024-10-29 8:01 ` [PATCH 4/8] trace-cmd dump: Prevent buffer overrun in dump_clock() Jerome Marchand
2024-10-29 8:01 ` [PATCH 5/8] trace-cmd record: Prevent memory leak in setup_network() Jerome Marchand
2024-10-29 8:01 ` [PATCH 6/8] trace-cmd lib: Prevent memory leak in tracecmd_create_event_hook() Jerome Marchand
2024-10-29 8:01 ` [PATCH 7/8] trace-cmd mem: Prevent a memory leak in trace_mem() Jerome Marchand
2024-10-29 8:01 ` [PATCH 8/8] trace-cmd record: Check the length of the protocol version received Jerome Marchand
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=20240605134054.2626953-1-jmarchan@redhat.com \
--to=jmarchan@redhat.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.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.