From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 152A3199FAB for ; Thu, 16 Apr 2026 13:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776345461; cv=none; b=UIoeLIWQF2Yg2RsQTg4p4yCG1lAzKpovzEwjiCQUXdMTbyNxexYU9EYlmiGZOnvvbMcffVHC/sVmZYUkb9hn27M8U1gGXZx9pjSbniJ03hoqLAVCE8gwhc2/2lq2LlN534ZJRrOO4rrrVAgI3j1VvDNbqvtmnLSCN7sgeTIL6dw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776345461; c=relaxed/simple; bh=KhFW0S7+B+BcgHfsB+XZahSH88X5m7q3B/nYp2+legk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gRGqZgryKG12d0MR4ElJ7+CqY/Rw4C7OMUl8OAte176Dfqt2zN8CPdmSzRuEHgU1zkdMiioW3gzZyIvsGQFtsbeUs9q/QNRxk9W3XfTR7yJZRDFteipC6dl/QKfZepqnZWJYEE+l2rULaAThjMdTLbnW9NKk+j/rvTNgnDq/Fyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TPmBRCc4; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TPmBRCc4" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-488afb0427eso94295265e9.1 for ; Thu, 16 Apr 2026 06:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776345458; x=1776950258; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cuzKgEinBx7T9lBlbBf/nAloxv8a3OQ8uRp19PW3Uvs=; b=TPmBRCc4gqHA4ma0n9lsPpeo72T5jRqtpdfkoN1igAH3lj6jARQ2CCCYYsDvfvOM6F IDFghPdmjHkbGd2KGtChN2KrXUJv5N3sBcSKddD4Q58JRqI7kAI7o2T1MOlXKRzPWsPB A2oJ7UZGnqe5WRa5vcnydz7/lWEylWn3n0lwkdT84xMSLlWC1AR4avuWVheL6+1wvACw PPYgXOPz+q7YwZp5wt6qajfPDA2FhgqIGIzUvSFQPdrgcEF/yxayZ2OYwxRC2RXFpLOW +VtrEu9fVntsBx1eRxfvZBseCFERVXk1ZzNrLs52M1QDdgyb7dklRCyZZ9xzCPKa8Z1p 2K7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776345458; x=1776950258; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cuzKgEinBx7T9lBlbBf/nAloxv8a3OQ8uRp19PW3Uvs=; b=BKS6wSq0JlvvTdPXjPueUgWr0U3wZ1aYGi6reHLkOlTrbhlUKO5dQtULjs+AZ8kmfp wuKxi7nQJdnygFno4aqkJrLu+VWBK6ycncqnv2eeO3oQ1cJNuFiOgpYeuA6IgZl8VhuE +mqhG2UL650b7CKUThBWz30iLbKIyoXtxHQp/La2vEKniZKl0dHzSBwVgaX0B2Rw5YkV QGoApz23CtgGqpvMr0bLSGQtRTBRGAzK07yz5he+YEW0tXZ64kzaY1wWOm6rs819Kxei KXL4WEPC0IxXX1+VaNJyl0nNbkBFWAPOZi+9QJNhSkoZfspmbgIRJN5FhJM/kA//GnpU /lSA== X-Forwarded-Encrypted: i=1; AFNElJ/fJIIM07S73UY9KB3pE/4CH0QcnJa6a0f7H0GWQ2tZvXqLhZn3vftZ1brSbIjyTQzHOZwjlquSvDjkOt8=@vger.kernel.org X-Gm-Message-State: AOJu0Yzb4yMGBF1L5/C2W+sDJUZSB3hm4FVvXQLs2T2GN/UJtDxa1zWc JTcQKaZ3eoVsBN/aDHklpEWREKo18BODmdZoQTZse8guPed3ZWisOXES/vr6W0jlYho= X-Gm-Gg: AeBDiev8t2oI5XnzOcVXVVREkGiK4RWEWZZj4ru5lyCgZfVdStm+pWXEuSXVGXB2Jxe rIH9kzxJRQTgOHaQgsBr6CIPm5PtoM91ZgJX4oydE4znPB+Cyhutv5bTUPKuyeyfp/eg0guoKc6 BfoTWeo7E9wEnhzQPU5WVLY10MLx9DAUsYqigB0Wttl/qrJqytcpJa7qlE07kBHb58aU9bOzuDZ YhMCBN1lA7k5MCnzTGA9QpmXXVtU8OLLBa2oGFZKRKSivOZvyO8iedxpZ11CiskQ5swQrhAr0Yv 8PfPkmf9KwA5pPB0+8lzxAMSJT1NXpHV95DcnmzpEm87YXdWMph0wDXbIFMLmeuSX81ZUPwxUxp DXN4IZ7la/bEjma+LfE+bAV7ekXShpmRoFsnSBo+B0ck86wywz3ElMCRo2UntCALZH+1FxRyeq5 TRfPOaVsw5gzWDrOuTwsWtNsW372tpFIVGij1VUGs+WLHIrjRKwejhjw== X-Received: by 2002:a05:600c:4443:b0:485:3a03:ceca with SMTP id 5b1f17b1804b1-488d686c044mr354005635e9.23.1776345458347; Thu, 16 Apr 2026 06:17:38 -0700 (PDT) Received: from [192.168.178.64] ([84.246.200.167]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488f0eaffaasm44690165e9.23.2026.04.16.06.17.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Apr 2026 06:17:37 -0700 (PDT) Message-ID: <2231f14c-0467-41d7-8774-5f720edc0e18@linaro.org> Date: Thu, 16 Apr 2026 14:17:37 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHES 0/5 v2] More perf.data header validation To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Thomas Gleixner , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Namhyung Kim References: <20260416001424.362797-1-acme@kernel.org> Content-Language: en-US From: James Clark In-Reply-To: <20260416001424.362797-1-acme@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/04/2026 01:14, Arnaldo Carvalho de Melo wrote: > Hi, > > This is picking up from what was reported in the previous > series, pre-existing lack of perf.data file validation, processing files > and buffers in header.c in a similar fashion. > > There is more to process in the trace data, but that is a > different can of worms that needs to be dealt with in a similar, > upcoming patch series, > > This is probably 7.2 material, but if feeling this can still > sneak into 7.1, feel free to do it :-) > > Now lets see what Sashiko discovers while I still don't have it > running locally right after Claude, before submitting it publicly, which > will soon happen :-) > > - Arnaldo > > v2: Addressed sashiko comments, adding a patch to the series. > > Arnaldo Carvalho de Melo (5): > perf header: Add section bounds checking to the fd read path > perf header: Validate string length before allocating in do_read_string() > perf header: Sanity check HEADER_EVENT_DESC > perf header: Validate bitmap size before allocating in do_read_bitmap() > perf header: Fix 32-bit incompatibility in bitmap serialization > > tools/perf/util/header.c | 57 +++++++++++++++++++++++++++++++++------- > 1 file changed, 48 insertions(+), 9 deletions(-) > Reviewed-by: James Clark