From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754887AbdE0IoS (ORCPT ); Sat, 27 May 2017 04:44:18 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38397 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688AbdE0IoQ (ORCPT ); Sat, 27 May 2017 04:44:16 -0400 Date: Sat, 27 May 2017 01:44:14 -0700 From: Christoph Hellwig To: Kees Cook Cc: kernel-hardening@lists.openwall.com, Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 12/20] sgi-xp: Use designated initializers Message-ID: <20170527084414.GC26844@infradead.org> References: <1495829844-69341-1-git-send-email-keescook@chromium.org> <1495829844-69341-13-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495829844-69341-13-git-send-email-keescook@chromium.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2017 at 01:17:16PM -0700, Kees Cook wrote: > 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. > > To avoid casting, this implements dummy functions with full function > prototypes. Can we get this in ASAP? > +static void xpc_notloaded_connect(int ch_number) > +{ } > + > +static void xpc_notloaded_disconnect(int ch_number) > +{ } Also it might be a good idea to just check in the caller if the methods are defined instead of having all these dummys. A branch is usually cheaper than an indirect call, AND it leads to less code, AND is is less fragile.