Received: by 10.223.185.116 with SMTP id b49csp4136865wrg; Tue, 6 Mar 2018 10:23:36 -0800 (PST) X-Google-Smtp-Source: AG47ELuuqqAw2XfqroOUdk9AvqJVdUVgELLA7/bOyXkE+tKlRK8f6ZJ4MJNlCw02PHPPexxOkWWC X-Received: by 2002:a17:902:b10c:: with SMTP id q12-v6mr1033581plr.197.1520360616663; Tue, 06 Mar 2018 10:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520360616; cv=none; d=google.com; s=arc-20160816; b=nbcYBKzw/Mpoh/6rWj4EGxsPArennRleSj5wX/3XSeu8gn375HGDoA3xDMMaqk0l1H mWhwK9Aw653xbSwXjSPxaqkFGiRYvF9+PzdSe9iuuvtxP8aBg+8J9Sw6DHGOafHdZAkD 3rvGL+yJd6j1G1FxUYeIBRqbUdMqFSYHCf0p6LU1oPJ12a0LGAFRPexeQ58/LsFldjyY alBCry1vPKhk/O0wr0bJcaw4Xl4ze5wQN24W2d0bzpC9QdAa78BZVLPyVQaRuN34dfPX Br4Bir4MJ+PAj9TWm17yv0oX2kNYt/03WaQuF3iEkSAAblBZ3SBLFJ+QeeS6G5yljkSf EAGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=JM93jYLDZiDxExo+QF3Z8LR311288kqqakH5UHy9ekI=; b=QQn5K+cybNM4kDYzfPquT4240D3mOYq7r0gpCjERscNy0xI152+dZLLe6oSmw1jFnZ sjx1Vg3NMdD8KRc/WRBIEFKg8WydBomEfyaXAh7TTk5t1OGSyNy3/os1Ap6NPVqy9Ac2 LyN6xLTBlM2W+B9IXyfA1Bpyam7zcgY85yU+AwaiSahxQFgsxtkkFXAQe9vIy6l+K1qN pxIXgE9tE3aTuLEp/rnFmyU7EkWUz3KltpREAqAwF0eTSHOwqAt+xcc2CoTuhvK4rD20 5JZG2QucWMGP2s66JXNwXQD83qWlz9Om29F9kbkZjOSlwPfDxHOfkp/1whJiFZtkIEpN SpCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jJRSio+v; 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 q18si12534878pfi.105.2018.03.06.10.23.22; Tue, 06 Mar 2018 10:23:36 -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=jJRSio+v; 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 S1754007AbeCFSWY (ORCPT + 99 others); Tue, 6 Mar 2018 13:22:24 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50978 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753920AbeCFSWV (ORCPT ); Tue, 6 Mar 2018 13:22:21 -0500 Received: by mail-wm0-f67.google.com with SMTP id w128so29030wmw.0 for ; Tue, 06 Mar 2018 10:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=JM93jYLDZiDxExo+QF3Z8LR311288kqqakH5UHy9ekI=; b=jJRSio+vtJAg7xOuKLeXM2YNUW7BSW/zskm87k+kJ8+lxr7nNfbjbN2OsNln9vQ5qw tbisiF8Ie3zLlfDyMjC3jGZ7485zFW07H/ck3a7u9as6+t+PI04lBx2KuWVf86qlmUfP SCkmFZztxUSom/0OeL8UmaQhfCEX6Waq5WtwF/4g3uUiAci7l7KEDJ1awv0/7XkcOXHc Mg7lhf6zDsTqUytLtVS9JtFebkxmxBETqGA8RsJjWVbKEwrjL+ksENLEVH0Z5MI3w8nq 8xDfSfx0RUwQmeQA7CtgIMTjQv4wFYIhJLry6aEuHvWptSPHMYYX8a7WMS1NqeimGAJa +IgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=JM93jYLDZiDxExo+QF3Z8LR311288kqqakH5UHy9ekI=; b=XErA+bwddmSybqG+s6+mpFU+uoGuZYC10zz774H7ZEyGvqulvCYgIS7EGUIk3H0JuL hIYMg08Iy6MzqD+/usZXCoedhpcRWUzS/9UcR8XqBb3JMF4aB2+MB1y+r19VmNMsjoXf it+5qdsGA8meHi5EW7G0j1/9gbezr+MQlYfHmCJKRYaWm5fOsePYFQqgT1RGvK03KSBI 8VlcbICJLqC6pcFveRYOy4/amx0d5YNfpHZVMfHo9gFDiMKxGJ74Yeg/rBaSgVTJDY6y 9BPhekCcW+jMYupF5TEMxRytm2KGFD5GPiYRUHRP62ZAmlk2vDaAQgU98YxLZyTK4nrJ 58vw== X-Gm-Message-State: AElRT7GCMmMdGCV/JsWRIpn5WWjUR4FAqiXH2ANjO3+se9rRKdqIRwi2 fRSKCRYVFtNi7rMgTOAww8GY X-Received: by 10.28.61.65 with SMTP id k62mr12427521wma.140.1520360540139; Tue, 06 Mar 2018 10:22:20 -0800 (PST) Received: from avx2 (nat4-minsk-pool-46-53-177-92.telecom.by. [46.53.177.92]) by smtp.gmail.com with ESMTPSA id h197sm14895698wmd.17.2018.03.06.10.22.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 10:22:19 -0800 (PST) Date: Tue, 6 Mar 2018 21:22:17 +0300 From: Alexey Dobriyan To: kilobyte@angband.pl Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] vsprintf: distinguish between (null), (err) and (invalid) pointer derefs Message-ID: <20180306182217.GA3798@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +#define BAD_PTR_STRING(x) (!(x) ? "(null)" : IS_ERR(x) ? "(err)" : "(invalid)") This is getting ridiculous. Instead of simply printing a pointer as %08lx or %016llx, not only glibc (null) stupidity is propagated but expanded and "improved". I assure you reading 0000000000000000 is just as obvious as (null) and reading fffffffffffffffa is just as good as -ENOMEM. In fact printing with hex is more information. Maybe it is important that buggy pointer is small value but it's value is lost. Sure don't dereference a pointer for very small or very erry values but print it without all the bell and whistles.