From patchwork Sat Dec 17 01:04:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9478837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A423760827 for ; Sat, 17 Dec 2016 01:07:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95A1F2866B for ; Sat, 17 Dec 2016 01:07:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88C0D28724; Sat, 17 Dec 2016 01:07:09 +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 1A13A2866B for ; Sat, 17 Dec 2016 01:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932961AbcLQBEc (ORCPT ); Fri, 16 Dec 2016 20:04:32 -0500 Received: from mail-pg0-f49.google.com ([74.125.83.49]:35341 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935526AbcLQBE0 (ORCPT ); Fri, 16 Dec 2016 20:04:26 -0500 Received: by mail-pg0-f49.google.com with SMTP id p66so37723798pga.2 for ; Fri, 16 Dec 2016 17:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=fNbrMuOsZcnYimmE/Vw2O6ZW3xj3oMRS2h3sssyecQ0=; b=nlN2r/XXyBwNL8PlL1eAadAOrAYUitMSufuuqdXVUFi2SKxVqZCdmFYGbhqynsJICs I1D3rpGuKi9v16nFs4ovpBLwqFvvGLO2DmURxOP5S8RSBZXvIU5r2WIFoe3shFdSnc3P WVw7sXrET//orxfUVcwRjiZ4tlC9RaJosk3M8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=fNbrMuOsZcnYimmE/Vw2O6ZW3xj3oMRS2h3sssyecQ0=; b=E1iAo9MDWu5hY8Q5NEn+puCU83kdJ6FwMmrnDPzRRKpp09crawxQi+vFjkKMd6qJbj IvngZQeuwFQ80pirQ7x3+LbYLgL6PXCsL+v5BhK4nXrQx8F9MOaiV+LvoDmghqZL1V34 xTCCqo+HFWcn44Ah8Njpuk6e/fo2uQ84NxPS4p8Xc67BgwePSsCYvMRt6c1gFFV1JkhS CepoAUCGQFiOQHGPoZJvJDidkMag+fa9P5pztuALJQuViOVtdKTk8U2xBDcgt6Qnk3WB f7oHsfJZt8cD+o6b4rS5C3GtQhc8YJ+NCO1/wtC3Ns3/GCw8NDpwaz0wuEmMw8CLPxPZ kY4w== X-Gm-Message-State: AKaTC02fA12FuR73g01QGoVVEWMCE6t2gIdiSpip1Fj/1RlBMFHa41N2dq7PgaWx5PglW8Nt X-Received: by 10.98.78.88 with SMTP id c85mr5830979pfb.138.1481936666112; Fri, 16 Dec 2016 17:04:26 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id t125sm3810750pgb.4.2016.12.16.17.04.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 17:04:25 -0800 (PST) Date: Fri, 16 Dec 2016 17:04:25 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Robert Moore , Lv Zheng , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH] ACPICA: use designated initializers Message-ID: <20161217010425.GA140581@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity. Signed-off-by: Kees Cook --- drivers/acpi/acpica/hwxfsleep.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c index f76e0eab32b8..25cd5c66e102 100644 --- a/drivers/acpi/acpica/hwxfsleep.c +++ b/drivers/acpi/acpica/hwxfsleep.c @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id); /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ static struct acpi_sleep_functions acpi_sleep_dispatch[] = { - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), - acpi_hw_extended_sleep}, - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), - acpi_hw_extended_wake_prep}, - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake} + { .legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), + .extended_function = acpi_hw_extended_sleep }, + { .legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), + .extended_function = acpi_hw_extended_wake_prep }, + { .legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), + .extended_function = acpi_hw_extended_wake } }; /*