Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1176821imu; Wed, 9 Jan 2019 13:06:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ZTGls1cruMgkKYMVIxZzIVA2zUUxGhrmur55vnj3OXSQV+BQ5d//elh5M3TRVW1sHjgNJ X-Received: by 2002:a63:334a:: with SMTP id z71mr4710063pgz.400.1547067981937; Wed, 09 Jan 2019 13:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547067981; cv=none; d=google.com; s=arc-20160816; b=mhhj3WVovcamhzSqL8lyTx6o1e91L9EOxk+c3QGmCkLXpcOnsc0IwgQk8bfNUOpixy F4MvlNuxBXXEfyIAPGulENMnGinp30njHJ9GwopwuKHbED3WeJ1kvxxD6d3Iuu6Jvpwe Lpmysqucfz4xyJVKmIrdPVtMeA0+52OuFHYmiagXbZYxbroEUf5/qYP5x4YF8pl+cyip VaCk1ZSYzYMxtDC+dckYy3upMeVb+tOr9Ko0IUiZvCOVOEwGzStEpBiCG5VQ7mSH4QLS +zMN2kFRd/IqZ9yF1yfNvhM/ghV4rZjibi0WHMdIpECtLA7Bq+rUyY+oy9RSgzmGHghX UI/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ir2gy1vI+QuEjLbaEs5X765OOqWePEa4uQXeCPwMJG4=; b=PuRePU3hVtxq8pHdH5nxLheEM9TVCsgzNCHuL9FaWUlCT4gf0dlY2kCouHyGyqcAe7 Pe0FpHwhsNmEbYjNY1Ukf8UxUszrGJ/3PLJyGVYWwKUUI4vG3vomLXeLo9cOvC+AEMvD Hgs4OewM38iR9WqGZwBgH6UcE0gqo3GoNPEItGqp2yQO/6uFxn14YjCnWcDq5HhwLgZc rNWHBKtQwEmjmZXFf5shvu5VU05sngUDPCELE+Ksc80L7H5onkKw6C7svTeb4hTWKlSp eFTietbqH2DqKvuWqX64ypnmK5V/ZPqSb8kxIGdDjnwL4B7d7OBRmFDxe3jaBg9vvMMA 3Y6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lNOw7caF; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si3119567pgm.250.2019.01.09.13.06.06; Wed, 09 Jan 2019 13:06:21 -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=@chromium.org header.s=google header.b=lNOw7caF; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728551AbfAIUFT (ORCPT + 99 others); Wed, 9 Jan 2019 15:05:19 -0500 Received: from mail-vk1-f196.google.com ([209.85.221.196]:39230 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728356AbfAIUFS (ORCPT ); Wed, 9 Jan 2019 15:05:18 -0500 Received: by mail-vk1-f196.google.com with SMTP id s184so1959044vkd.6 for ; Wed, 09 Jan 2019 12:05:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ir2gy1vI+QuEjLbaEs5X765OOqWePEa4uQXeCPwMJG4=; b=lNOw7caFXMuA6Gl7KQBr0CksbMGZLvtGfgLF74Td414lwed/G2VRgCI09yjhM454Dd hbPRb4NaqSNz4MMly3zdrmWJ5kHlN/oOEsKkzSRMkgNVgFoGYOEiFi2pka9FFNu+pvUq ZELyesivcCvJ7LJhPXU2JLBlBDhztkvan2Zjs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ir2gy1vI+QuEjLbaEs5X765OOqWePEa4uQXeCPwMJG4=; b=PQfYXj4Tn6EwWTUMfyH4/xdN6hRppuRLWLoR72tfXEfmoD8z/vy+3PydBIctMtOVTh pNLIyBqqd7Llv9533jUEpdaRiRIh9HXwOD9nAtWJYFfrbytWBacDNp3cyWd9bVjEmZ30 NMq261gXallG1k2R65a7rqAifAoY8+/P0tMqVoBlGSjS9pSyoMz/DI4pNWE5bQEeNAA8 JGOwd4HlgDjj163BMW+7YIXnNCmTd/ulfpwh1QicKXUp4MpP1isj6SNrYBA/72YNLW9R TwB9Ir/k4zmj2tdz2swxsbT1YbsDly+sJR2FkcLKdZ+5SPhmug/PbUeXBK/OP0GhREdz O+lQ== X-Gm-Message-State: AJcUukflcMrkLUL6kwz7503QYDiIIr/EhoD+oRc9o4pwXF/QyDVbQbUC BxDv06whuUuzkyJMqEmrQYfeOB3CXO8= X-Received: by 2002:a1f:a147:: with SMTP id k68mr2766979vke.1.1547064316598; Wed, 09 Jan 2019 12:05:16 -0800 (PST) Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com. [209.85.217.54]) by smtp.gmail.com with ESMTPSA id l197sm22054560vke.18.2019.01.09.12.05.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 12:05:15 -0800 (PST) Received: by mail-vs1-f54.google.com with SMTP id p74so5575916vsc.0 for ; Wed, 09 Jan 2019 12:05:15 -0800 (PST) X-Received: by 2002:a67:e199:: with SMTP id e25mr3106997vsl.188.1547064314501; Wed, 09 Jan 2019 12:05:14 -0800 (PST) MIME-Version: 1.0 References: <8593f7faf89812a9987d44d9ae615d64dca4d77f.1544800744.git.christophe.leroy@c-s.fr> <2d2e8cef-dd12-75e8-4779-fe4437e2169c@c-s.fr> In-Reply-To: From: Kees Cook Date: Wed, 9 Jan 2019 12:05:02 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] lkdtm: Add a tests for NULL pointer dereference To: Christophe Leroy Cc: Arnd Bergmann , Greg Kroah-Hartman , LKML , PowerPC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 9, 2019 at 7:16 AM Kees Cook wrote: > > On Tue, Jan 8, 2019 at 10:31 PM Christophe Leroy > wrote: > > > > > > > > Le 09/01/2019 =C3=A0 02:14, Kees Cook a =C3=A9crit : > > > On Fri, Dec 14, 2018 at 7:26 AM Christophe Leroy > > > wrote: > > >> > > >> Introduce lkdtm tests for NULL pointer dereference: check > > >> access or exec at NULL address. > > > > > > Why is this not already covered by the existing tests? (Is there > > > something special about NULL that is being missed?) I'd expect SMAP > > > and SMEP to cover NULL as well. > > > > Most arches print a different message whether the faulty address is > > above or under PAGE_SIZE. Below is exemple from x86: > > > > pr_alert("BUG: unable to handle kernel %s at %px\n", > > address < PAGE_SIZE ? "NULL pointer dereference" : "pa= ging request", > > (void *)address); > > > > > > Until recently, the powerpc arch didn't do it. When I implemented it > > (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/com= mit/?id=3D49a502ea23bf9dec47f8f3c3960909ff409cd1bb), > > I needed a way to test it and couldn't find an existing one, hence this > > new LKDTM test. > > > > But maybe I missed something ? > > Okay, gotcha. You're getting more complete reporting coverage. Sounds > good to me. Thanks! > > Acked-by: Kees Cook Applied to my lkdtm -next tree. --=20 Kees Cook