From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70DA3C004D3 for ; Mon, 24 Sep 2018 21:40:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B95B20867 for ; Mon, 24 Sep 2018 21:40:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B95B20867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=namei.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728614AbeIYDo2 (ORCPT ); Mon, 24 Sep 2018 23:44:28 -0400 Received: from namei.org ([65.99.196.166]:32786 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbeIYDo2 (ORCPT ); Mon, 24 Sep 2018 23:44:28 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id w8OLe6DI032354; Mon, 24 Sep 2018 21:40:06 GMT Date: Tue, 25 Sep 2018 07:40:06 +1000 (AEST) From: James Morris To: Greg KH cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells , Linus Torvalds Subject: [GIT PULL] Keys: fix C++ reserved word issue Message-ID: User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please pull this revert and update, from David Howells: "Here's a pair of fixes that need to go upstream asap, please: (1) Revert an incorrect fix to the keyrings UAPI for a C++ reserved word used as a struct member name. This change being reverted breaks existing userspace code and is thus incorrect. Further, *neither* name is consistent with the one in the keyutils package public header. (2) Fix the problem by using a union to make the name from keyutils available in parallel and make the 'private' name unavailable in C++ with cpp-conditionals." --- The following changes since commit 02214bfc89c71bcc5167f653994cfa5c57f10ff1: Merge tag 'media/v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media (2018-09-24 15:16:41 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git fixes-v4.19-rc5 for you to fetch changes up to cae081e4d49ac9be127c4e1b876bb685c2c04159: keys: Fix the use of the C++ keyword "private" in uapi/linux/keyctl.h (2018-09-24 13:51:12 -0700) ---------------------------------------------------------------- David Howells (1): keys: Fix the use of the C++ keyword "private" in uapi/linux/keyctl.h Lubomir Rintel (1): Revert "uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name" include/uapi/linux/keyctl.h | 7 ++++++- security/keys/dh.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/keyctl.h b/include/uapi/linux/keyctl.h index 910cc4334b21..0f3cb13db8e9 100644 --- a/include/uapi/linux/keyctl.h +++ b/include/uapi/linux/keyctl.h @@ -65,7 +65,12 @@ /* keyctl structures */ struct keyctl_dh_params { - __s32 dh_private; + union { +#ifndef __cplusplus + __s32 private; +#endif + __s32 priv; + }; __s32 prime; __s32 base; }; diff --git a/security/keys/dh.c b/security/keys/dh.c index 3b602a1e27fa..711e89d8c415 100644 --- a/security/keys/dh.c +++ b/security/keys/dh.c @@ -300,7 +300,7 @@ long __keyctl_dh_compute(struct keyctl_dh_params __user *params, } dh_inputs.g_size = dlen; - dlen = dh_data_from_key(pcopy.dh_private, &dh_inputs.key); + dlen = dh_data_from_key(pcopy.private, &dh_inputs.key); if (dlen < 0) { ret = dlen; goto out2;