Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp211896ybb; Tue, 24 Mar 2020 20:34:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsiUDzQ8zeb/mxuNr8zU0O6w2PfCzGNkNGa/at5py53J9wV77blHfJr663gV2yd7z3mqmBx X-Received: by 2002:a9d:c69:: with SMTP id 96mr1063202otr.77.1585107261739; Tue, 24 Mar 2020 20:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585107261; cv=none; d=google.com; s=arc-20160816; b=lVYORqkyGWZPXxX7hr5yN2i7UX/d9akkSfEUeSEGM6xfSGd3txQRaHpTYVVklCzEgY zug8VLaSXq36xHD3atbRdHS2Gr/atCLbvrx59hoeQbGWgexegvVRBmIFzEB12m9AlsqJ NZUuyT2PLxfSo8GpsiAkYErwxDdEzXI0bGQaoeOZsB7I3bngw4mFLgiMk6a/bXr24hum JVNdAaR3w6gF/HPPW+5kcHHpTlqB+TFaILFGeCQpB91Tyt2L2gZuecFwYHZU1O8XddQV /MY2PQGKsKlDahD5JkxGOCGAbSgQKjE2z4LqiAycIM1Pbp5fgB+w2cxCvNFP4TZIX5Fd NpVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KxuOmdAysRZGEQNx/Dz1PYBDsyTNUNG3yM0/E844o6Y=; b=HO9gkykH4G2lFHfmKEfUzyk/4zQyuZsKejdY0I8grbi3SXnXVT01x4AWMVLG/ocjGD rtHskmVM1TjFaiTPlLUW4xFRS87OSXHWD+JoxGRhDySe/BOWDaUDMmi/ynexfsz058JX pupIigVrNNYD7BjVm+OZtcQiz1aszmJzH+qV1YOiZB/hoXNrQYQ0S9q1OLXHYZxol686 GOJcZdZHIDd2A5FckhI21QRSUu2tvkXyekOYmINyICOpmRS7/mThKNk50OjOXD2F96dG tYf0HvL1L0a9YIhcR4ldymofNv6W42D/FXSKFiGaqCaZ6tKCbBOwQzOCrJtQE/fLukcK 5GPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="c/J6KOmO"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si2383094ots.224.2020.03.24.20.34.09; Tue, 24 Mar 2020 20:34:21 -0700 (PDT) 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=@google.com header.s=20161025 header.b="c/J6KOmO"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbgCYDds (ORCPT + 99 others); Tue, 24 Mar 2020 23:33:48 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35134 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727253AbgCYDdr (ORCPT ); Tue, 24 Mar 2020 23:33:47 -0400 Received: by mail-wm1-f67.google.com with SMTP id m3so981421wmi.0 for ; Tue, 24 Mar 2020 20:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KxuOmdAysRZGEQNx/Dz1PYBDsyTNUNG3yM0/E844o6Y=; b=c/J6KOmODiexLZ6eE+Q7byqMIyfu4FnkpMeZwi5gE9T+/EA75ajNsvHCRlueB8QnOi UPH8CyFpthAFT1RAn+oSq/Laqhiwe6iz0lX7V2b42ZkgmNolMn/u3meMsGuTQbge2lpp ECvXCaPxDG6m+v5esskixVqrVPEIYAA7iS7p6u2FfOzeUw4mG9fZRAgqwXG7LtrrCpGT 3lVVkWYDpuelkVF2ocK7K8t4uYPDASeO4vKQx1HN65+vgysWC1Z1hF/d5f4Hvk9IVzCI fDsV+k3bXspeMm+Vn3P0QQY0qDG0TY9jDmp0e9+0x/8iM7qlf0cGS4OOoOI+iNa8Qkjj fSWQ== 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; bh=KxuOmdAysRZGEQNx/Dz1PYBDsyTNUNG3yM0/E844o6Y=; b=gzK/VPkbE3gnsWeWxu3qD11UevYJu78i14P0/tk13momjcFoT0rpntndD+y8aiKKbl hrD5s/0vyF03gZdwuOJmASvd1i4IptxXRFgwbg7DY/mYbyJAfI3Cc3qzcdQzES7wbGPu 2sT8ea5KJx2X3CCSjlU2pDUoUbHOlT/wjhKzo3zreFiEYRegDG6oquNJxAyspCb5R2He +QbEM5JAH8fhOqnNpPE3LHsIjUGAp7D1WngGRAYiqzOM7ph5HnGy7MVeNnPZikFJUD5/ h+EG88VRMbBCna0mhnBDf5bwkWvYRioKsQqXuu+ijF507PEMtKKdTjGgoP5WMvoMYt6E aKDQ== X-Gm-Message-State: ANhLgQ30T46C1vA/BUGpLWswZydBAclhkAoISf0D42jTqLE3QQfVDlAd X6F9w4m021tP0uVy5aWzeF7B1tAAmXPKPZHKDUqFoQ== X-Received: by 2002:a1c:dc8b:: with SMTP id t133mr1147213wmg.99.1585107225177; Tue, 24 Mar 2020 20:33:45 -0700 (PDT) MIME-Version: 1.0 References: <20191121235058.21653-1-davidgow@google.com> In-Reply-To: From: David Gow Date: Tue, 24 Mar 2020 20:33:33 -0700 Message-ID: Subject: Re: [PATCH kselftest/test] kunit: Always print actual pointer values in asserts To: Brendan Higgins Cc: Kees Cook , shuah , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 3, 2019 at 3:44 PM Brendan Higgins wrote: > > On Thu, Nov 21, 2019 at 3:51 PM David Gow wrote: > > > > KUnit assertions and expectations will print the values being tested. If > > these are pointers (e.g., KUNIT_EXPECT_PTR_EQ(test, a, b)), these > > pointers are currently printed with the %pK format specifier, which -- to > > prevent information leaks which may compromise, e.g., ASLR -- are often > > either hashed or replaced with ____ptrval____ or similar, making debugging > > tests difficult. > > > > By replacing %pK with %px as Documentation/core-api/printk-formats.rst > > suggests, we disable this security feature for KUnit assertions and > > expectations, allowing the actual pointer values to be printed. Given > > that KUnit is not intended for use in production kernels, and the > > pointers are only printed on failing tests, this seems like a worthwhile > > tradeoff. > > I agree. However, I also remember that others in the past yelled at me > for assuming that KUnit would not be built into production kernels. > > I feel like +Kees Cook would have a good opinion on this (or will at > least CC the right people). > I'm tempted to take the silence as a sign that no-one is upset by this. Otherwise, consider this a gentle reminder to file any objections you may have. :-) Otherwise, I've confirmed that this still applies cleanly to the latest linux-kselftest/kunit branch, so -- assuming there are no last-minute objections -- this ought to be ready to go. Cheers, -- David