From patchwork Tue Aug 28 23:34:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10579289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A49B45A4 for ; Tue, 28 Aug 2018 23:34:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 936382A804 for ; Tue, 28 Aug 2018 23:34:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 851AE2A8D1; Tue, 28 Aug 2018 23:34:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5FF22A804 for ; Tue, 28 Aug 2018 23:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727342AbeH2D2K (ORCPT ); Tue, 28 Aug 2018 23:28:10 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47730 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727146AbeH2D2K (ORCPT ); Tue, 28 Aug 2018 23:28:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Cc:To:Subject:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ch37FjB/2HtlITQvCWYTMQcaJohMsL9lzagYvks6G7w=; b=WxTMF9qFDRGjcx4lvljsW1zCjz JTqyjC0wGNSAJckjb2h1sJY8lrV8GjlRNuztRu8aYo2RmER8DDJBmCTFQp2zji0XzTLacwYJtLVtv KCi5zgAln4W90kulixm0vvmfwNxoFzHwS1OTxzIUo/UqMbg+LzhtxVvBfX0YPzFuqtRsMZvrkvoLk MGv+lNdFu3Lot3H0n5Ia0X0D8hL/czvaUrF1SFS9SdNEyNsuS3AZ8nifwQtBYzEJnCQUTl2Jfnhgn Wbqgci1toGAYZrg9tneUECMPHe88ucypx+SjMWsx8uLD/tsS7ZSMmb4WQ9ANPff4xcYGOJLPKwLLF san3d+xg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1funUt-0005gK-2O; Tue, 28 Aug 2018 23:34:07 +0000 From: Randy Dunlap Subject: [PATCH resend] uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name To: LKML Cc: David Howells , James Morris , "Serge E. Hallyn" , keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, Mat Martineau , stable , Andrew Morton Message-ID: <0db6c314-1ef4-9bfa-1baa-7214dd2ee061@infradead.org> Date: Tue, 28 Aug 2018 16:34:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap Since this header is in "include/uapi/linux/", apparently people want to use it in userspace programs -- even in C++ ones. However, the header uses a C++ reserved keyword ("private"), so change that to "dh_private" instead to allow the header file to be used in C++ userspace. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=191051 Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command") Signed-off-by: Randy Dunlap Cc: David Howells Cc: James Morris Cc: "Serge E. Hallyn" Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: Mat Martineau Cc: stable@vger.kernel.org --- include/uapi/linux/keyctl.h | 2 +- security/keys/dh.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- lnx-416.orig/include/uapi/linux/keyctl.h +++ lnx-416/include/uapi/linux/keyctl.h @@ -65,7 +65,7 @@ /* keyctl structures */ struct keyctl_dh_params { - __s32 private; + __s32 dh_private; __s32 prime; __s32 base; }; --- lnx-416.orig/security/keys/dh.c +++ lnx-416/security/keys/dh.c @@ -307,7 +307,7 @@ long __keyctl_dh_compute(struct keyctl_d } dh_inputs.g_size = dlen; - dlen = dh_data_from_key(pcopy.private, &dh_inputs.key); + dlen = dh_data_from_key(pcopy.dh_private, &dh_inputs.key); if (dlen < 0) { ret = dlen; goto out2;