Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2545086pxb; Thu, 3 Feb 2022 08:47:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCOBtbaW3v/FKX4QDTmUULdijjDxjE5p8z4HiBJWlH2an1ZaaYxoRjxCsYlxgznKr6jF/R X-Received: by 2002:a17:902:eacc:: with SMTP id p12mr36601256pld.123.1643906859879; Thu, 03 Feb 2022 08:47:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643906859; cv=none; d=google.com; s=arc-20160816; b=pL6gf/uVdHnnACT6slHTzjX3pz+EKAUlIOubzCvRsUKBgxSnuC45/UqFo+rDJr7HSA ujzFXjouswH4+FtSaUNYoi3NnmTCGj8YUMbygMJpeL9oZEk5hlixu5rNC5M8Vs+KB8NI AvbdZ+cngJjj6moTfRUbTDAtZLma4w+RL6WDeRJb801rKUcNKPbYZqIgPoY6T/+UWuH5 8OEr9/6hMg4CstpUZ13ECFZYGySbHux4n9bhUeWB+FKRce89pBbN4IhjCMfIW2JwGASe +CFFMHp2AiVy0knQfCZd/PfYjL3Ye/Jz1AksZ/lUECC/BlPCUPDdiOMUSwbzOooW5O1I t7lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Fv2xrT6sCg1OX/niRBfx/0/7zd87QN/xf0hYX+pZoro=; b=zSCEiKGH+BhVU/LiAl2voxJrcGotg9BEf4AAeWGIcj0e2GdfULj343hesxPYnKVQbL i9D1afO8A3Fr1pL+Q5DqbAQCZioywDo551ty1Sq10homwQwvjfdLBQyZtOLRupqfLtGr RqzirMJsDPhpfsqP3wmslpOv6aXXTAmy7MB+xffVATaa7zsLWwQw9v/ywaJaG5UHIAkM L4uUe5M6nz/ne1OPuXSdO2y5H4ibZCeHi5fHkplmLrHINd+tHkCRFYjqHcWjwiB1HFme qP4xYtdKvzpGErDfdOffRqvEAao/1ZsQKsCL9cw9YEXMhpTaZ+K7jZ9k4Yyk5JwAwc+w 8uIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yzmW8lyc; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Uymo9TF2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf9si9339579pjb.125.2022.02.03.08.47.16; Thu, 03 Feb 2022 08:47:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yzmW8lyc; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Uymo9TF2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351503AbiBCOeZ (ORCPT + 99 others); Thu, 3 Feb 2022 09:34:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351318AbiBCOdk (ORCPT ); Thu, 3 Feb 2022 09:33:40 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A37FFC06175A; Thu, 3 Feb 2022 06:33:34 -0800 (PST) Date: Thu, 03 Feb 2022 14:33:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643898813; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fv2xrT6sCg1OX/niRBfx/0/7zd87QN/xf0hYX+pZoro=; b=yzmW8lycClyjXVeo1Rs2krHU1D3SYR03NQG3Ob2yFXduQp3tq3LGFidms0g5qYcIMmCbX8 pfWsLXMF1YLvcnQdqE7k8mCY7wLleEvLfzygNEx7wkMwrqLz7uZP0hAHXlneYqf9U48eOz vEZvR76TL9RoAdft/AARVA5FBSc3EP/QfsZS/HbwyjHnsupUIER/kjdY3f3pogHUHP6cIw 3VkS1jKipEKv1bg3rH+uDtNLRCChbShnnlKSRk8GzTSEFjMDFeN+Oz3ucsSG87v/m4Ts/j DCjEEqcLe/yk+muFRjuTA2FJ/MSqDuBKvyuY/DK/o9ZwEDRj5ToOJM0+bSCruA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643898813; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fv2xrT6sCg1OX/niRBfx/0/7zd87QN/xf0hYX+pZoro=; b=Uymo9TF28AV99YKc0xB5pba1rA5geg973QxK3WHfX9WatYkTraCQSX/vb8tJ6OQq4Qog+b B81ArDyLp31d87DQ== From: "tip-bot2 for Marco Elver" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures Cc: Dmitry Vyukov , Marco Elver , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220131103407.1971678-3-elver@google.com> References: <20220131103407.1971678-3-elver@google.com> MIME-Version: 1.0 Message-ID: <164389881239.16921.12788730223046077815.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: ddecd22878601a606d160680fa85802b75d92eb6 Gitweb: https://git.kernel.org/tip/ddecd22878601a606d160680fa85802b75d92eb6 Author: Marco Elver AuthorDate: Mon, 31 Jan 2022 11:34:07 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 02 Feb 2022 13:11:40 +01:00 perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures Due to the alignment requirements of siginfo_t, as described in 3ddb3fd8cdb0 ("signal, perf: Fix siginfo_t by avoiding u64 on 32-bit architectures"), siginfo_t::si_perf_data is limited to an unsigned long. However, perf_event_attr::sig_data is an u64, to avoid having to deal with compat conversions. Due to being an u64, it may not immediately be clear to users that sig_data is truncated on 32 bit architectures. Add a comment to explicitly point this out, and hopefully help some users save time by not having to deduce themselves what's happening. Reported-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Link: https://lore.kernel.org/r/20220131103407.1971678-3-elver@google.com --- include/uapi/linux/perf_event.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 1b65042..82858b6 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h @@ -465,6 +465,8 @@ struct perf_event_attr { /* * User provided data if sigtrap=1, passed back to user via * siginfo_t::si_perf_data, e.g. to permit user to identify the event. + * Note, siginfo_t::si_perf_data is long-sized, and sig_data will be + * truncated accordingly on 32 bit architectures. */ __u64 sig_data; };