Received: by 10.223.185.116 with SMTP id b49csp5302391wrg; Wed, 7 Mar 2018 09:28:39 -0800 (PST) X-Google-Smtp-Source: AG47ELv4XrGaR4NqcZvgUnW8cmZ10Bs/XvhZ3//ns3MRSLSr46aeZIj28kSXyjWGj2CJ0Pv6XZ// X-Received: by 10.98.231.26 with SMTP id s26mr23380247pfh.210.1520443719222; Wed, 07 Mar 2018 09:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520443719; cv=none; d=google.com; s=arc-20160816; b=Oz8SqyJcM6rpwJ0B6VHaUxK75x8WF/9sBU5XK4+QyH0etvWUx3O2cowaRTiHdoWoDJ V2tgMniTbBF/KQ1TEspGoRx8BSCl0DLj9EnlxGhMLTt4F2frynQeiDf9piBfZTQ1w/EM us8V3vjW3Ox7U2cctDN+sZ4nTmXfc7zwfzi4WvAMNr44z0v53DcZAgBV4UWWzPKy9Rb+ +eFKpNbE+f4/fGJCWfkuE4kyVx52QzurIU5jPell3ejsJOehUbu0msSOFZj9Om1kmk4C NWaGrxLFlFO+m/GQbxqsopgNKizOAa7z4aUQh5Ur4DGGHNhzEFkBcg/2AZZeuZY2pggN BfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=6iXAzdYsNrJDgpiedIBXyFIVKkq7L06HmS92649iOXI=; b=vfYpA33E4EVBCUbyxzu7o/FAFRoKii7TJ5exuowglWXPXpbj/W8uqdfxF6vCqnfzMF X/VECPCVpPLwm6nZX/zimMjRc7upYfK7EqetZydGBcWUkLDikyuRunyCpP1ZdU/X2ITW We/ho5gu8dpezxykIk6auvfKF1hDpI86zvRMc2Jy83xYIidVqVyXMdeoJqEbDSF256Ea JHfmaMSl0w3W+1O2nt27l2y44BhHLQNIJ/4ca+6TmGehfw1uWt/ZUqMjRamTTTw4X4IN y6SFEvZWlWKigQa1xMbLhDOFLnamA0gkHyANMzpo212/t48X3n5HhP5sxUknGgdP3N7V uYpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ppRt5H8e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si12962619pfi.39.2018.03.07.09.28.24; Wed, 07 Mar 2018 09:28:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ppRt5H8e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754667AbeCGR1C (ORCPT + 99 others); Wed, 7 Mar 2018 12:27:02 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:38272 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754248AbeCGR1A (ORCPT ); Wed, 7 Mar 2018 12:27:00 -0500 Received: by mail-pl0-f65.google.com with SMTP id m22-v6so1701531pls.5; Wed, 07 Mar 2018 09:26:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=6iXAzdYsNrJDgpiedIBXyFIVKkq7L06HmS92649iOXI=; b=ppRt5H8eWTQpMO4Ful0HCQ3BXBeZaiBpH4YaEsplOvXdm2VKB8s4c9o5YzdNjkztvp zhkDVyCR0+jiIg7dAiDHMp5ciXP5hKA9vl8R+Uu3pO3gUR4kYSArq8nlr16ObLRq5b/q d8pvUYyy3mXGazt2Uk49677Ls6LUQ8EXUfuHxN5oz7Yu1hQs3kee/t6V0Ii4Elcyq/oY X0nrn9KXccotkNsUknVIYSt/iTz73Fff8zdF00EYLG0e533MtaWBX8x0XwLaWRqEmoU4 xQCnbUay7uevsa6jhgW+a/lJS5UDef3QTTX/wDC+biG55AEXQ6zAzS8xzeq3oRmY+dH/ 6gUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6iXAzdYsNrJDgpiedIBXyFIVKkq7L06HmS92649iOXI=; b=FKmNfAZPx/K20fIrmzfJYfZ7ODEBrHcsf/f1i+No91NL9mKp1z0xjwsB7gYy7dptLG rqlgKeRL1Brzt0pZZugDCLoscP1WSbN+nVzbgwHhrhPaWTVYdZghC/LF766jVKUaO6Dh xGSJh3IbCcgHF02bjkVIGKLMB9GuUxnafu//DO2Z/Dj+2bv5/hPFoLAMPGuMSkZjRb12 kGhE8NejJ8D55SkI+0niWupqIeehGem1GlB39BZ1knQMDMvig+DEm43pWeeYqJPS5fHm YhWObEXnUlyongLRL7BxoxRTQADqIhuh1sb6CniKieYpa0Jt8qqY0KyBh6RQ6dZsfeud 2sFg== X-Gm-Message-State: APf1xPAxusqiVwRHKFWeBky5R7/dEg5CNTultg+bnJDhlJ0TJVvoRYcV tIHfHqdyHT0YRMgSDrbELTWolo/e X-Received: by 2002:a17:902:24c1:: with SMTP id l1-v6mr21158137plg.281.1520443619525; Wed, 07 Mar 2018 09:26:59 -0800 (PST) Received: from JF-EN-C02V905BHTDF.tld ([12.111.169.54]) by smtp.gmail.com with ESMTPSA id q15sm12515087pgv.49.2018.03.07.09.26.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 09:26:58 -0800 (PST) Subject: Re: [PATCH 6/7] lkdtm: crash on overwriting protected pmalloc var To: Igor Stoppa , david@fromorbit.com, willy@infradead.org, keescook@chromium.org, mhocko@kernel.org Cc: labbott@redhat.com, linux-security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com References: <20180228200620.30026-1-igor.stoppa@huawei.com> <20180228200620.30026-7-igor.stoppa@huawei.com> <1723ee8d-c89e-0704-c2c3-254eda39dc8b@gmail.com> <6378e63e-174f-642e-d319-1d121b74d3d7@huawei.com> From: J Freyensee Message-ID: <2664691b-4d48-1701-8dae-774ec7733f61@gmail.com> Date: Wed, 7 Mar 2018 09:26:55 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <6378e63e-174f-642e-d319-1d121b74d3d7@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/18 5:18 AM, Igor Stoppa wrote: > > On 06/03/18 19:20, J Freyensee wrote: > >> On 2/28/18 12:06 PM, Igor Stoppa wrote: > [...] > >>> void __init lkdtm_perms_init(void); >>> void lkdtm_WRITE_RO(void); >>> void lkdtm_WRITE_RO_AFTER_INIT(void); >>> +void lkdtm_WRITE_RO_PMALLOC(void); >> Does this need some sort of #ifdef too? > Not strictly. It's just a function declaration. > As long as it is not used, the linker will not complain. > The #ifdef placed around the use and definition is sufficient, from a > correctness perspective. > > But it's a different question if there is any standard in linux about > hiding also the declaration. I'd prefer hiding it if it's contents are being ifdef'ed out, but I really think it's more of a maintainer preference question. > > I am not very fond of #ifdefs, so when I can I try to avoid them. > >