From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752679AbbKJBeb (ORCPT ); Mon, 9 Nov 2015 20:34:31 -0500 Received: from r00tworld.com ([212.85.137.150]:35316 "EHLO r00tworld.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343AbbKJBe1 (ORCPT ); Mon, 9 Nov 2015 20:34:27 -0500 X-Greylist: delayed 513 seconds by postgrey-1.27 at vger.kernel.org; Mon, 09 Nov 2015 20:34:26 EST From: "PaX Team" To: Julia Lawall , Kees Cook Date: Tue, 10 Nov 2015 02:24:54 +0100 MIME-Version: 1.0 Subject: Re: [kernel-hardening] Re: [PATCH] video: constify geode ops structures Reply-to: pageexec@freemail.hu CC: Emese Revfy , "kernel-hardening@lists.openwall.com" , Dan Carpenter , Joe Perches , kernel-janitors@vger.kernel.org, LKML Message-ID: <56414766.18876.2B8A87D7@pageexec.freemail.hu> In-reply-to: References: <1447018493-20631-1-git-send-email-Julia.Lawall@lip6.fr>, , X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.12 (r00tworld.com [212.85.137.150]); Tue, 10 Nov 2015 02:24:46 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, Nov 9, 2015 at 1:55 PM, Julia Lawall wrote: > >> > What happens if some structures cannot be made const because there is a > >> > reassignment somewhere? Is there any feedback about the problem? the constify plugin basically simulates what a source level 'const' would do (sets a specific flag on the 'tree' structure representing the so-called main variant of the ops type, see my h2hc13 presentation for details) and since this happens early in the frontend, the const violations will be reported by the compiler just like as it would otherwise report such source level problems. this way one can simply put a do_const attribute on a type, recompile the tree and see if the compiler ever reports an error to know if the given constification attempt is viable for the given type or not (and by finding the 'bad' assignments one can see where to consider rewriting the code perhaps, we did this a lot in PaX for example to achieve the current level of attack surface reduction). cheers, PaX Team