From patchwork Thu Apr 6 21:18:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9668467 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 591B1602B3 for ; Thu, 6 Apr 2017 21:21:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95810285E8 for ; Thu, 6 Apr 2017 21:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A6DF285EA; Thu, 6 Apr 2017 21:21:11 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id BF35B285E8 for ; Thu, 6 Apr 2017 21:21:10 +0000 (UTC) Received: (qmail 32629 invoked by uid 550); 6 Apr 2017 21:19:43 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 29868 invoked from network); 6 Apr 2017 21:19:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qW6grtpx22J50nlYXnke5zCNNmDBX/ISuLGlvPL+t/M=; b=Igt/twAw/HMzM34z/U49feEnrtECjYAnY3QEOLW06rEklAkKR9gWcYWCG2w9kGyWyc 64tIF5H0trL4qWSd5qjcUvOeWIWqKBTZli/kGA6WLR96c8YKyZQ2lIvcqJlvHhsOLGwG s5aZJ7pPzJVAOIG8+2Yy3fz8tVpjwcFcgRUZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qW6grtpx22J50nlYXnke5zCNNmDBX/ISuLGlvPL+t/M=; b=V5dfzmRuhIQ613W8EQcTiY1tol48lqIGMQqVC5GalaQPPnHxfPG/DhbeetROMyhNYp NSuAD0Bq9MI6wxh2UQDK+uNj/Ik8Z1N5uccpxPcy4H9VJ3QvwZOWeVWdSWv51r1LzukL 9lxz5lLzSHJQ300jCrm/5cJb6meTd1/TcgS/3ou4/TQ6KOTGKJap9DovIWWpUX83Dd1A zo75L2Y7IKtu9EuVtHaiWRiCmqZLoeOZNpVJow+YxyzAs3SM+13Oc912V4uvtE1dsHDk IiUdCbXZaAKlYxC/e34OB3g5JMRZqaPGHUY99NNa+sNz6ApkUA8zRwK7tzig7uZi/Oqc djag== X-Gm-Message-State: AFeK/H1+MldeT381thsirAu0HsG+PqBbPvt6Wm3iJ5V3UOJZjpPvIlgumCrUO1srDvYfMNKq X-Received: by 10.99.115.68 with SMTP id d4mr37867558pgn.146.1491513550660; Thu, 06 Apr 2017 14:19:10 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Michael Leibowitz Date: Thu, 6 Apr 2017 14:18:30 -0700 Message-Id: <1491513513-84351-16-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491513513-84351-1-git-send-email-keescook@chromium.org> References: <1491513513-84351-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH 15/18] randstruct: Enable function pointer struct detection X-Virus-Scanned: ClamAV using ClamSMTP With prior patches landed that clean up structure initialization, it is now possible to enable CONFIG_GCC_PLUGIN_RANDSTRUCT's detection and randomization of structures that contain only function pointers. Signed-off-by: Kees Cook --- scripts/gcc-plugins/randomize_layout_plugin.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index cbde695e392a..716bb877b3fd 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -420,9 +420,6 @@ static int is_pure_ops_struct(const_tree node) gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE); - /* XXX: Do not apply randomization to all-ftpr structs yet. */ - return 0; - for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) { const_tree fieldtype = get_field_type(field); enum tree_code code = TREE_CODE(fieldtype);