From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753539AbcEMUp3 (ORCPT ); Fri, 13 May 2016 16:45:29 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51166 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753496AbcEMUp2 (ORCPT ); Fri, 13 May 2016 16:45:28 -0400 Subject: Re: [PATCH] x86/boot: Refuse to build with data relocations To: Kees Cook References: <20160512203104.GA7425@www.outflux.net> Cc: Ingo Molnar , Borislav Petkov , Baoquan He , Yinghai Lu , Thomas Gleixner , Ingo Molnar , "x86@kernel.org" , Andrew Morton , Josh Poimboeuf , Andrey Ryabinin , "H.J. Lu" , Dmitry Vyukov , LKML From: "H. Peter Anvin" Message-ID: <8bc4f1fd-c6f8-4643-becf-4f84be378807@zytor.com> Date: Fri, 13 May 2016 13:45:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/12/16 15:54, Kees Cook wrote: >> >> It would be far better to warn on the *type* of relocations rather than in which section they feel. > > I'm open to specific changes. What's the best way to detect what you want here? > Use readelf -r and look for inappropriate relocation types (which are basically the same ones that we should have to muck with for the main kernel in relocs.c.) -hpa