From patchwork Sat Dec 17 01:03:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9478797 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 7256860827 for ; Sat, 17 Dec 2016 01:03:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6164C2866B for ; Sat, 17 Dec 2016 01:03:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52F7D28724; Sat, 17 Dec 2016 01:03:56 +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 C992F2866B for ; Sat, 17 Dec 2016 01:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935238AbcLQBD3 (ORCPT ); Fri, 16 Dec 2016 20:03:29 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:33645 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934527AbcLQBDS (ORCPT ); Fri, 16 Dec 2016 20:03:18 -0500 Received: by mail-pg0-f54.google.com with SMTP id 3so37721831pgd.0 for ; Fri, 16 Dec 2016 17:03:18 -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=b/8VMake0JIFEVCqRc2U6uNwy0yKPXap7mvhmebUcwo=; b=iqYkjaItP9hswIkrtqhIiA3ecVw412Bhsu3OKwNYIrJuH1ssIShd3uYVKrnLTODw3i RKSZi0KEMZC+yR+oPVQoH79rUNgOdEZFb3UgpvI4yRVBMR+mvuV/Orh7/ON8VjPw1/jh aA9dX6eGNJN7JSBUbDUQyT1QhTDwIh9Ir82wE= 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=b/8VMake0JIFEVCqRc2U6uNwy0yKPXap7mvhmebUcwo=; b=cbUUaD+bLh9qwnge82CuHamULk88fzjgZcsIl4HNnT5FTmzpHmr2xhzrjOW8wxDn7F Az5XdWAt7BYMJbKoWZM9qMZBHC/mWQuV+jNMSF7juKc8ECYYZEo2PoWAR33d4BVduKEc 0BUT+8nedPaFQID9tg48dC5Q1P9bK5PRciXhLbCO9YrAV21UTn0KtkpJCHDJ4boghnEJ h6uPk9WieTH+cDneI9Grw0euAFwT+VF4H0tjCuKA8tRdFli6E4dANuu4ijqlij138dFf xyVQJTm1TOq9blmWOP8pXnYb3qfZa2USavZEIzcd5Lb/Svkd2cVn80VrQMtzdZC+XdLW rgnQ== X-Gm-Message-State: AIkVDXJJOORquQ1hlg3U+AELhXydewta819TVP+sJWv6x3LndoL165wmd9KAxunAdoPoLKTz X-Received: by 10.99.139.200 with SMTP id j191mr4100196pge.162.1481936598018; Fri, 16 Dec 2016 17:03:18 -0800 (PST) Received: from www.outflux.net ([2002:ada4:7085:0:8454:20a8:3cd7:bcbf]) by smtp.gmail.com with ESMTPSA id q26sm14327138pfk.94.2016.12.16.17.03.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 17:03:17 -0800 (PST) Date: Fri, 16 Dec 2016 17:03:16 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Faisal Latif , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/nes: use designated initializers Message-ID: <20161217010316.GA140509@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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/infiniband/hw/nes/nes_cm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 8e703479e7ce..fb983df7c157 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16); /* instance of function pointers for client API */ /* set address of this instance to cm_core->cm_ops at cm_core alloc */ static const struct nes_cm_ops nes_cm_api = { - mini_cm_accelerated, - mini_cm_listen, - mini_cm_del_listen, - mini_cm_connect, - mini_cm_close, - mini_cm_accept, - mini_cm_reject, - mini_cm_recv_pkt, - mini_cm_dealloc_core, - mini_cm_get, - mini_cm_set + .accelerated = mini_cm_accelerated, + .listen = mini_cm_listen, + .stop_listener = mini_cm_del_listen, + .connect = mini_cm_connect, + .close = mini_cm_close, + .accept = mini_cm_accept, + .reject = mini_cm_reject, + .recv_pkt = mini_cm_recv_pkt, + .destroy_cm_core = mini_cm_dealloc_core, + .get = mini_cm_get, + .set = mini_cm_set }; static struct nes_cm_core *g_cm_core;