Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp788605ybb; Wed, 25 Mar 2020 09:35:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuH8wWwzlGv0aw//dGCFqZnny55mDveXDCPTN949qQ76H9SK7/fwvClHS/xVm9AKg87pV+f X-Received: by 2002:a05:6830:1d95:: with SMTP id y21mr3217974oti.180.1585154154985; Wed, 25 Mar 2020 09:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585154154; cv=none; d=google.com; s=arc-20160816; b=jUGnMJ3eeOyG2RVpebZ7vtai+mkF6zBjuy2m15YYkXA53A/uhYj0uDmRkG2JdxM3Ml O2onclws1Hmpda+2KbiwQ8tt0otwlFPYFuW+jU1dGm5SsHkYug1YZzcWnZybmv8+pnZr LpoRYbBox/5Sfe/u/gtuy0/766dlSCUXMJASE3ltJMFayorn/o32MZJjh6AXHt9xOSsK DggjTx4ZeeWyFOcslwkN5fjzhSisaDU+ZyuM5TZJKDZ2gNnVgbmJgF2DHYzoTO06jO0L w6uPdWVlbmPEmeoacC0jGRkgXL/lqevgs5OfNYp7g+H/Cd8fuXWvEOC97/RmdHzbydf4 Aw9w== 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=d/mwcS2k49Q8FtkpWy9oWS3FImYCLq2+zg7rNJhSOZg=; b=uwhb1a8PlX9gaNkB9ktle78uedY9K8HNNfqPLfy438N6qo3lveKeDlf6vt+27FIYQf hzyUgZiHE8Yr8XTEvD5HlR5C6i1+YtVWgx8wdJXlshkrtFFGQiKxkW/MRmeQlp0nerFs nZ/O6aEWJ88jOjK5650gxQfHJEw9VN1SUlG5NDjf6Y7FI5+VUWu40OTNePD+Ggxc4VnJ NBV3jsxAzhT7BZlAl9FZB+k+6nSlYQqPYBjRoS1jZufQ8WY+qA2Fh317FnxgavuO0ycS 4sClv8devRHsulDwnCool62KTb1FIzzOLgXHHi1C0hirYI3hH96G+Dzyv0rUqJO74NGz R+1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cCxSv0lU; 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 f19si1175522oos.45.2020.03.25.09.35.40; Wed, 25 Mar 2020 09:35:54 -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=cCxSv0lU; 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 S1727391AbgCYQeF (ORCPT + 99 others); Wed, 25 Mar 2020 12:34:05 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:37284 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727275AbgCYQeF (ORCPT ); Wed, 25 Mar 2020 12:34:05 -0400 Received: by mail-pj1-f66.google.com with SMTP id o12so1227416pjs.2 for ; Wed, 25 Mar 2020 09:34:04 -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=d/mwcS2k49Q8FtkpWy9oWS3FImYCLq2+zg7rNJhSOZg=; b=cCxSv0lUkGe2EkApXp9qAszTvolABAR+7z9AuUMmHhvDbeRZpWR6Q0bYuAPqFUF6Zp jAqjCTAjkGIbSmWBIMSVXhJN66nTO6w4p8bJGqbMGN0RHan4V/rN4nSpCoCZW/+IZ6Lb BapU1uUUBkAzcg6RjyW9DQk9sAa9zz9BVA+3jFW4plA85kvU4GJN2702eW4e7McqWvGD vqNc4jpN6Islq1dfjZ+sI3gFRBxhl9R7Wxh+vHtiJsDfeEADMZK5MKd2zrcYY7mHxonR FLL/P9nRwVdwkoJlihPemv1VYENWVfU4m5DOYZYY4ZipQAOx0dPlpJrEcWA7pK8BdsOj UcwA== 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=d/mwcS2k49Q8FtkpWy9oWS3FImYCLq2+zg7rNJhSOZg=; b=B6dMagGMh2N6kAyYHh0qgOEGhujn337id75oSBxSta7ctJWR2bNw62/WwQiW8oYkz9 QUtKbNo4A5Uw2fHXxftZnPxzy/dv6vcu+qccFbEW1b6PUkazAau6+g4XsyEOwTnYhwW3 epxMDA7fTmol+EEqyogUgK6O0rem5vOvZmcgMuUst7DPpopWyvLNUu3xinh8W5eH097x /fDEi7FcLFrAmi8UyIeXWsuteeCjaEGOMJet5Mu74wCtrgsuJfAAZtlVTurU77ocMzOn 8GvmtFs7zc6to9TGZpu91mJ8pAMpGUyg5tGnO8VbYDjfuu0CvEW8w0Gjr4N+YtF0LMf0 DCfQ== X-Gm-Message-State: ANhLgQ2rLvnHaWOREfn7iP3c/u7ljAfdVTEkOLzuhj1mLhJgzCHCQfsW 8NMzG6St66Rk4Ig88TE+APdceNHXfUje6JS1XxbCtg== X-Received: by 2002:a17:90a:32c5:: with SMTP id l63mr4814987pjb.47.1585154043671; Wed, 25 Mar 2020 09:34:03 -0700 (PDT) MIME-Version: 1.0 References: <20191121235058.21653-1-davidgow@google.com> In-Reply-To: From: Brendan Higgins Date: Wed, 25 Mar 2020 09:33:52 -0700 Message-ID: Subject: Re: [PATCH kselftest/test] kunit: Always print actual pointer values in asserts To: shuah , David Gow Cc: Kees Cook , "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, Mar 24, 2020 at 8:33 PM David Gow wrote: > > 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. Shuah, can you pick this up for 5.7?