Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4083297ybg; Fri, 25 Oct 2019 13:04:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVXlo50/f+5L85oNRCLQZL5yvLwekHfcZUpmWwRMW6sC/hVt2Ptsh7lihZ8SS4JRNdw6KO X-Received: by 2002:a50:f010:: with SMTP id r16mr6101013edl.187.1572033885463; Fri, 25 Oct 2019 13:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572033885; cv=none; d=google.com; s=arc-20160816; b=bOH5dkMbXy0ApIpwzY7V9j8vW7W/mj8PAvjsaWxTfP7BxO8gY+9ELBsmAKQ85fxwOt f8zSaC8sYmDVuiP6UabuQNuuGZeIx5RUmUdxU5A6XaBsMTd2kiI4wNxOxde8lSeUDnmq aIUrm13lrcYjcrSmUBSq7w90/ynTpUmzUsw03MVVAhsRNyDWX7BYj7WI4bnidNHfkY43 yC8Ohp/79NC0kOuk68MRDesc92OPaTVWCUfVwryBxbb+CCusOk21GwfHV+gs3bUId3N4 hFawj8mGxa6i+nRbsktaDtPzlsbTk89Eu/g5BC1U5ZCSlLguoAhfNFGmJaAf88wVopPs OF0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=b8im90ipL9kTAMU9aAXXXnZGiZ9by8kPewM5a77EYdI=; b=iWVhx6w5qB84qnc5l9JyNVVhnOhprqah1JiTgcxqKTL3Y/iMlylobA7Plu2heNWeH0 JhCKep0uaH2DooHtfzri8Ah+vaGPqjRD5NGZDV1a2ILDrVGII9Omq+fqj7wKs0RXAAbc Ngh82OGy8oxku5xtwmhscblwxwD1RTZI5tvhJt13BaOv032Gi5gdqXidJh5BO1hZ4jVl Wz1POKfFCDRUsowHUtnqbPhxdLn8bK42c95JJuAeL7eEj90FgM9ifXVHaZM/59a566EP 5kdmiCN+lQb1cEe2TGb4W10P/Hbd7Hykow2q3qHEeJbiLojcwcHfBF8zXm9zUfnK9m/Z +xRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z37si1912574edz.281.2019.10.25.13.04.21; Fri, 25 Oct 2019 13:04:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504437AbfJYMQy (ORCPT + 99 others); Fri, 25 Oct 2019 08:16:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:1573 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504406AbfJYMQx (ORCPT ); Fri, 25 Oct 2019 08:16:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2019 05:16:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,228,1569308400"; d="scan'208";a="210705827" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 25 Oct 2019 05:16:51 -0700 From: Alexander Shishkin To: Peter Zijlstra Cc: Arnaldo Carvalho de Melo , Ingo Molnar , linux-kernel@vger.kernel.org, jolsa@redhat.com, adrian.hunter@intel.com, mathieu.poirier@linaro.org, mark.rutland@arm.com, Alexander Shishkin Subject: [PATCH] perf: Start rejecting the syscall with attr.__reserved_2 set Date: Fri, 25 Oct 2019 15:16:36 +0300 Message-Id: <20191025121636.75182-1-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 1a5941312414c ("perf: Add wakeup watermark control to the AUX area") added attr.__reserved_2 padding, but forgot to add an ABI check to reject attributes with this field set. Fix that. Signed-off-by: Alexander Shishkin --- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 77793ef0d8bc..0940c8810be0 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -10660,7 +10660,7 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr, attr->size = size; - if (attr->__reserved_1) + if (attr->__reserved_1 || attr->__reserved_2) return -EINVAL; if (attr->sample_type & ~(PERF_SAMPLE_MAX-1)) -- 2.23.0