Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1206023ybs; Mon, 25 May 2020 09:41:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzegLwn1Qrx3kVnxJeaooe9NM0h/Yq14MhRY+dwIF/rr0tjbIosvjKDLgDgFBr6Ua/abZJG X-Received: by 2002:a50:f182:: with SMTP id x2mr16125516edl.336.1590424893261; Mon, 25 May 2020 09:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590424893; cv=none; d=google.com; s=arc-20160816; b=I6XenCYovfxd8sPXk1ZXfmQjQqXT7pKeVgtw8mRFQncNgcUdcz4bD4NGmABKmCBPaj wzY3bXBGnEUHcZwB2xmKYiFYnYf5wzWXENBuLCJXzWvjedVkpmnexNkTvQVu2vdvhogX h85cxG4m2KMGHMZVB9UNQb/en0bLVDLTxfm0mFh8O1Bo1evIac3fTZrXtU6J7K/FyRzk Gfdzo+jDARPERZPGoabhuTi6RHsJq/p15QGymcVWgP+IcC0IXEq3n+oAdIKetW4hq7cD c2uqDNrN5aggUx5lXvQlRZgv43TIQv5dNzDERjXVt7nGn/N1mjpOcCk+ik7FkyK5yikg Ur/A== 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=4r0lwsVRl4S0vhS+fSHZmivQY20nyQaqhWtNxq+9aiA=; b=AbRPQr/LLTCn13LOfke8kKfr5Gw4lQxqIMnKI5dn6sLgVe/P4aMRC2nFXH4sLrk8jk kFQRn5NzF9QYXg0HdjazFu4Lj+YH9bY+SwkH5kbCk4FbOxt8Advon2QTm8UMRiApBbqS 1OzbcpqPK72ZITxZDZm98Vo18Pu/4kGuzV1C/Sq9LvJ5roPtUy+tfceMMF90NIsSqhQ9 ygLbvVIvodv82RpDdtpRDe+U/5uaJ5cAsIT8wfSYIx4kOE7eR+FtSxeoZtQMfS3Va6+4 7XmV1h0+nlOBghQMl9rQSpJuM9T4w/8NQPj5Ada/7g564YxunOi7+m0+oqIusD3REp0L JX5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lJoI8UB5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l4si1405480edi.128.2020.05.25.09.41.10; Mon, 25 May 2020 09:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lJoI8UB5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2389135AbgEYHim (ORCPT + 99 others); Mon, 25 May 2020 03:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388947AbgEYHil (ORCPT ); Mon, 25 May 2020 03:38:41 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA29C061A0E for ; Mon, 25 May 2020 00:38:41 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id z1so1133150qtn.2 for ; Mon, 25 May 2020 00:38:41 -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=4r0lwsVRl4S0vhS+fSHZmivQY20nyQaqhWtNxq+9aiA=; b=lJoI8UB5F5IHZE338Rs+oubjNR4y3WBw+PR57/IyeWUy2JWXJy0Usyyb4UN04T9fif lt+biIAibSoPeD7cfXpvc4eXs1MIALUnZkGoacVfkYgSdsS6kQWSkFYH4V2smpQdolGK 6ng5hzAUwEZNvMxrZRfWFpHQbGyOYVarZcOqL+5+BwgGbCyVNbyOfGHbaBgHXWam6Hkh swCdKBGJux5L39Egt0dfPOtsJN753j9CnofjI0/fPPDrga+JTf3/0DNwhFKjmrUKOXpp Eb6aU8qeDwEpvUsG0nT78cwDFKHiGa38AppSEJIvi8dHhZb/waHJ2aaz9ILbvSjoSvOp fGXg== 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=4r0lwsVRl4S0vhS+fSHZmivQY20nyQaqhWtNxq+9aiA=; b=AXGmpu18OjKIRzwg5qAE2UsY2B/h5WzDDlcguSIVlwGeloUV3cHpSbX/+dqeP34dwv th0ehJvIEydhr46JuRJZOVMeYS1YrLOf1AHk5xwXvT14xBbSFqzjvw7GxEEiWtTxvgjQ klp8J0d88K8Gn+3Qxb+XmM4APXESFNij3xfAHXCUbzHwo/nbMOWR/oFbRK/0eHPTNghL oJocZSXHvfts6m7xTbkKDjeUKonmu6NRxryqtw2rUMpyGGQezuaBR2ubXXiO+mOP4yT8 lODX3+MBYce2rONzewYa1e9KcvrcJV8ptd2Dona6/helHuSt1R7vtjOTTSf+Uhx//lSu 11nw== X-Gm-Message-State: AOAM530yMz0RM3QHG8aBunQvAXMyUUspWpQWpNBD6HTj2jN+M3Ddacby m3qfqF66PMX1TJr1Mrjyj8h1vineEe+XyAmBM6qBOg== X-Received: by 2002:ac8:74d9:: with SMTP id j25mr1356921qtr.257.1590392320250; Mon, 25 May 2020 00:38:40 -0700 (PDT) MIME-Version: 1.0 References: <20200524145034.10697-1-penguin-kernel@I-love.SAKURA.ne.jp> <94f7ce4f-74fb-bccc-2e87-749e0c8da92c@i-love.sakura.ne.jp> In-Reply-To: From: Dmitry Vyukov Date: Mon, 25 May 2020 09:38:28 +0200 Message-ID: Subject: Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG) To: Joe Perches Cc: Tetsuo Handa , Ondrej Mosnacek , Andrew Morton , Linux kernel mailing list , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , syzkaller 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 Mon, May 25, 2020 at 8:07 AM Joe Perches wrote: > > On Mon, 2020-05-25 at 14:03 +0900, Tetsuo Handa wrote: > > On 2020/05/25 4:18, Ondrej Mosnacek wrote: > > > I'm also not sure if this is really worth it... It would help localize > > > the bug in this specific case, but there is nothing systematic about > > > it. Are there that many debug print statements that dereference > > > pointers that are later passed to functions, but not dereferenced > > > otherwise? Maybe yes, but it seems to be quite an optimistic > > > assumption... I don't consider it such a big problem that a bug in > > > function X only manifests itself deeper in the callchain. There will > > > always be such bugs, no matter how many moles you whack. > > > > There are about 1400 pr_debug() callers. About 1000 pr_debug() callers seem > > to pass plain '%p' (which is now likely useless for debugging purpose due to > > default ptr_to_id() conversion inside pointer()), and about 400 pr_debug() > > callers seem to pass '%p[a-zA-Z]' (which does some kind of dereference inside > > pointer()). Thus, we might find some bugs by evaluating '%p[a-zA-Z]'. > > > > > > > > On Sun, May 24, 2020 at 7:38 PM Joe Perches wrote: > > > While I think this is rather unnecessary, > > > what about dev_dbg/netdev_dbg/netif_dbg et al ? > > > > Maybe a good idea, for there are about 24000 *dev_dbg() callers, and > > 479 callers pass '%p[a-zA-Z]'. But we can defer to another patch, in > > case this patch finds crashes before fuzz testing process starts. > > There are a bunch more than that. > Some use other macros, some are functions. I think this is a good idea overall and I don't mind enabling it on syzbot. It's not only about %p, even %d can crash kernel or leak sensitive info (if it happens after-free/out-of-bounds/uninit). Overall it increases code coverage and allows to catch more bugs earlier. That was the reason for enabling dynamic debug, but I wasn't aware that debug level is not included.