Patch "tracing/probes: fix error check in parse_btf_field()" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tracing/probes: fix error check in parse_btf_field()

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tracing-probes-fix-error-check-in-parse_btf_field.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 819f5b8d630b464f6c66244187bbe198ffb34951
Author: Carlos López <clopez@xxxxxxx>
Date:   Mon May 27 11:43:52 2024 +0200

    tracing/probes: fix error check in parse_btf_field()
    
    [ Upstream commit e569eb34970281438e2b48a3ef11c87459fcfbcb ]
    
    btf_find_struct_member() might return NULL or an error via the
    ERR_PTR() macro. However, its caller in parse_btf_field() only checks
    for the NULL condition. Fix this by using IS_ERR() and returning the
    error up the stack.
    
    Link: https://lore.kernel.org/all/20240527094351.15687-1-clopez@xxxxxxx/
    
    Fixes: c440adfbe3025 ("tracing/probes: Support BTF based data structure field access")
    Signed-off-by: Carlos López <clopez@xxxxxxx>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 34289f9c67076..ae162ba36a480 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -553,6 +553,10 @@ static int parse_btf_field(char *fieldname, const struct btf_type *type,
 			anon_offs = 0;
 			field = btf_find_struct_member(ctx->btf, type, fieldname,
 						       &anon_offs);
+			if (IS_ERR(field)) {
+				trace_probe_log_err(ctx->offset, BAD_BTF_TID);
+				return PTR_ERR(field);
+			}
 			if (!field) {
 				trace_probe_log_err(ctx->offset, NO_BTF_FIELD);
 				return -ENOENT;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux