From nobody Sun Feb 8 17:37:37 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1CB33BFE47 for ; Thu, 15 Jan 2026 17:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498029; cv=none; b=b5SpidU4hAJsFRdTtv366s9DnxuXBadFcJc9+zIz9SN/DSgIcZj8Rn447qPR074bAc01/vGJ/NqHiAeL3H5YlwrzfFxeB3Rf0jYmpIlgejYwOGUSaKgGtAOkZ798IY9SNw+vai6bZoij6gs0slfXCWW/hvv0VBJ+R7abLUUf5cI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498029; c=relaxed/simple; bh=tJLt5B2DZji/ml4Afp0udSPkcIunpC8Iq9d4OE08FUY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lizzLS7O0P5aZ0eb0ImjwNKfPypVExpAYemp28d8qbsxvX5mqi83WYn7Q4+x973OeB7O/azyRO7EKVs69tpq4qYH+XDPO6494+9GVC/mzQy2jtwPxYJVBd0g/ZuZYQI8J7XhgedQb0SU+RKTL9L0/pttPvN86c0dZz8lJWiBJQE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=d1hIHypz; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d1hIHypz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FkBXskbl+1yjIDirDDZ66gzhrdCqszVJfA3kLEp28sU=; b=d1hIHypzaLLrmbliBVxg6xoEyrAT/PSZJcwCV52sL/JoTP1+mV2UJnIjRCHdUCNyoE9Rrm ZD9zt9ronfgbXPf49MzuRkOhAsFILGi35TGLxhNn/Up/lFteFE7kOArzhskppu/d+uSMd7 ZZzTFWLQwviYwOYmcHEddGEH0tjFn4Q= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-zEVz8VLlNKOeoLOTAr2Ztw-1; Thu, 15 Jan 2026 12:27:03 -0500 X-MC-Unique: zEVz8VLlNKOeoLOTAr2Ztw-1 X-Mimecast-MFC-AGG-ID: zEVz8VLlNKOeoLOTAr2Ztw_1768498022 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 45BB7180047F; Thu, 15 Jan 2026 17:27:02 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.64.87]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E7F318004D8; Thu, 15 Jan 2026 17:26:57 +0000 (UTC) From: Wander Lairson Costa To: Steven Rostedt , Tomas Glozar , Wander Lairson Costa , Ivan Pravdin , Crystal Wood , Costa Shulyupin , John Kacur , Tiezhu Yang , Haiyong Sun , Daniel Wagner , Daniel Bristot de Oliveira , linux-trace-kernel@vger.kernel.org (open list:Real-time Linux Analysis (RTLA) tools), linux-kernel@vger.kernel.org (open list:Real-time Linux Analysis (RTLA) tools), bpf@vger.kernel.org (open list:BPF [MISC]:Keyword:(?:\b|_)bpf(?:\b|_)) Subject: [PATCH v3 08/18] rtla/timerlat: Add bounds check for softirq vector Date: Thu, 15 Jan 2026 13:31:51 -0300 Message-ID: <20260115163650.118910-9-wander@redhat.com> In-Reply-To: <20260115163650.118910-1-wander@redhat.com> References: <20260115163650.118910-1-wander@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Add bounds checking when accessing the softirq_name array using the vector value from kernel trace data. The vector field from the osnoise:softirq_noise event is used directly as an array index without validation, which could cause an out-of-bounds read if the kernel provides an unexpected vector value. The softirq_name array contains 10 elements corresponding to the standard Linux softirq vectors. While the kernel should only provide valid vector values in the range 0-9, defensive programming requires validating untrusted input before using it as an array index. If an out-of-range vector is encountered, display the word UNKNOWN instead of attempting to read beyond the array bounds. Signed-off-by: Wander Lairson Costa --- tools/tracing/rtla/src/timerlat_aa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_aa.c b/tools/tracing/rtla/src/= timerlat_aa.c index 30ef56d644f9c..bc421637cc19b 100644 --- a/tools/tracing/rtla/src/timerlat_aa.c +++ b/tools/tracing/rtla/src/timerlat_aa.c @@ -417,8 +417,8 @@ static int timerlat_aa_softirq_handler(struct trace_seq= *s, struct tep_record *r taa_data->thread_softirq_sum +=3D duration; =20 trace_seq_printf(taa_data->softirqs_seq, " %24s:%-3llu %.*s %9.2f us\n", - softirq_name[vector], vector, - 24, spaces, + vector < ARRAY_SIZE(softirq_name) ? softirq_name[vector] : "UNKNOWN", + vector, 24, spaces, ns_to_usf(duration)); return 0; } --=20 2.52.0