Re: linux-next: runtime warning after merge of the cel-fixes tree

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

 



On Thu, 7 Apr 2022 11:42:41 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> Actually, I found an issue with the above that will not fix it, but the fix
> to that is not that difficult (currently testing it this time).

Take two:

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index e11e167b7809..55d3ed6656ac 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -392,12 +392,6 @@ static void test_event_printk(struct trace_event_call *call)
 			if (!(dereference_flags & (1ULL << arg)))
 				goto next_arg;
 
-			/* Check for __get_sockaddr */;
-			if (str_has_prefix(fmt + i, "__get_sockaddr(")) {
-				dereference_flags &= ~(1ULL << arg);
-				goto next_arg;
-			}
-
 			/* Find the REC-> in the argument */
 			c = strchr(fmt + i, ',');
 			r = strstr(fmt + i, "REC->");
@@ -413,7 +407,23 @@ static void test_event_printk(struct trace_event_call *call)
 				a = strchr(fmt + i, '&');
 				if ((a && (a < r)) || test_field(r, call))
 					dereference_flags &= ~(1ULL << arg);
+			} else {
+				/* Check for type casts */
+				if (fmt[i] == '(') {
+					while (fmt[i] && fmt[i] != ')')
+						i++;
+					if (fmt[i])
+						i++;
+					while (isspace(fmt[i]))
+						i++;
+				}
+				/* Check for __get_sockaddr or __get_dynamic_array */;
+				if (str_has_prefix(fmt + i, "__get_sockaddr(") ||
+				    str_has_prefix(fmt + i, "__get_dynamic_array(")) {
+					dereference_flags &= ~(1ULL << arg);
+				}
 			}
+
 		next_arg:
 			i--;
 			arg++;



[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux