Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4291934pxf; Tue, 16 Mar 2021 09:52:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQq/DX7+TFzfC1Sj8O1pvHhbalVbPB9NKHiAbRhjSBrLjHHNJhRpOK92e+G0Z8STTqDE/V X-Received: by 2002:a17:906:d8d3:: with SMTP id re19mr30948899ejb.440.1615913536709; Tue, 16 Mar 2021 09:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615913536; cv=none; d=google.com; s=arc-20160816; b=iYi6f6mdgevWlWfr8JUUkWidkuKSEiLV4e1kLIHSw8z9/mvg/IFlsxz/6b8HPOo+/U fE82gfQNz0Dek67cRHHHy9Usu8gVMWhije7oSVRVgocwJgOQtOdpG3UWOdJ0+U6Ek2DH BX3j5rVfdLavx/8nj9981fsINTKFTt54hUZN9Fqcd5QVBxIDlhN1gcBjzueARCWtpJUa r7hsUv3vURdKes7xDCTkhyo1/3rdRGNH39BEkmkZPFjbXqLz1ZGgB9BhoTqZQz1m/Nlw A0cJKNcJHRoL3yeBkzn17BwFd+Zk+qaOG+SX3N8wC6XZH4uCFiw1D0un+28G+nsSrblU fkrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=XWMS+hUyuE6L1zm6H8PyNb0x+/VRMkvk/9mPyWHrpe8=; b=bOgupXyCExPvdIdMJXYukwPtcudXZeK+RMVGYkU97vzquZ9EvomWjYKTMib/Wr4awH g91IxW3FkBg76bJ2qqo0J65aUoWb5+aH8OPvQ5+ZPpzGv2XAppz5gUPVEJdotzJUIc+m GgAyOA3+ilN5Ahd/KYeqs6eNTPlvWWIyQy0LQViU3D7/99y+2ateEnNOYaMrHXVUvJ7o 4kfxp3TwjPlGcTgTfswB8vaUpi6ZGM2V7Ly1s1d178+BsAZIg0BrO79s5I76mrpBo3h7 74MFCj1YfPyhLXkFwXFZEpYNtCcc0S4UWly0gmEHNujCwR3IUSdkMEFL4mRqQo3ycKvY 6hgw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si13846888ejc.1.2021.03.16.09.51.50; Tue, 16 Mar 2021 09:52:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbhCPPiJ (ORCPT + 99 others); Tue, 16 Mar 2021 11:38:09 -0400 Received: from gate.crashing.org ([63.228.1.57]:40896 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234675AbhCPPhz (ORCPT ); Tue, 16 Mar 2021 11:37:55 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 12GFXL1m029361; Tue, 16 Mar 2021 10:33:21 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 12GFXL3d029359; Tue, 16 Mar 2021 10:33:21 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 16 Mar 2021 10:33:20 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Alexander Potapenko , Marco Elver , Andrew Morton , Dmitriy Vyukov , Andrey Konovalov , Jann Horn , LKML , Linux Memory Management List , kasan-dev Subject: Re: [PATCH mm] kfence: fix printk format for ptrdiff_t Message-ID: <20210316153320.GF16691@gate.crashing.org> References: <20210303121157.3430807-1-elver@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 09:32:32AM +0100, Christophe Leroy wrote: > +segher I cannot see through the wood of #defines here, sorry. > Still a problem. > > I don't understand, gcc bug ? Rule #1: If you do not understand what is happening, it is not a compiler bug. I'm not saying that it isn't, just that it is much more likely something else. > The offending argument is 'const ptrdiff_t object_index' > > We have: > > arch/powerpc/include/uapi/asm/posix_types.h:typedef long > __kernel_ptrdiff_t; So this is a 64-bit build. > include/linux/types.h:typedef __kernel_ptrdiff_t ptrdiff_t; > > And get: > > CC mm/kfence/report.o > In file included from ./include/linux/printk.h:7, > from ./include/linux/kernel.h:16, > from mm/kfence/report.c:10: > mm/kfence/report.c: In function 'kfence_report_error': > ./include/linux/kern_levels.h:5:18: warning: format '%td' expects argument > of type 'ptrdiff_t', but argument 6 has type 'long int' [-Wformat=] This is declared as const ptrdiff_t object_index = meta ? meta - kfence_metadata : -1; so maybe something with that goes wrong? What happens if you delete the (useless) "const" here? Segher