Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2522190rdb; Wed, 4 Oct 2023 04:04:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkGss90MhKUfVnn3BOWVEAW0qzTObUan6El9Hsn018tl+94dU1bpqgB+P8f3rXH41y0Dt9 X-Received: by 2002:a17:90a:d985:b0:273:83ac:5eb9 with SMTP id d5-20020a17090ad98500b0027383ac5eb9mr8294616pjv.4.1696417483101; Wed, 04 Oct 2023 04:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696417483; cv=none; d=google.com; s=arc-20160816; b=XKBJVEUPGqqNdUbw+BNhtv3/1EoHGKyoOtp56/exdcDrVv7fsAE+5cvaVY/gChxVXx Dh6jKhcz8HmLKOCH1j1PwfL3kNM9+cTgVFJtbOVKJRJHbt41Wqfpuf0Jb2GiOKT3Spd+ t2F75ShFy4oZXTmbvSN+Uz2UbGd8P1MyAJ+cJtFBdhrrEwhr0H70+OQQIRavkyJzKvOK Nh7SOgPSVKqorobwk2yBsQ45e31uH9QFYSXFkV0593kyoYncgeOZYzAXDQHmaU80CADB qgEV82cOexv8vn8WSy+r4GKJNlcFbIn5vdU6xGdf6DKbfAOz/Jk0vBh9ulizpGZz7N/5 upyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zRhSS7wk9FTmalEubvLUDVwtf2/asg3ilhWt+/WRka0=; fh=+NbtuYH6otq0U70TG8MGmAzxvN7skoC6ZKXBtfNsZ4I=; b=bI4NqBPhypqx76fEHSO26+LiubFaGE7zr+7SXCnVfTh50u6oQWfyuYVjE21Amvvd3Q SJYLr1xP7l/fzHvPwVNNMBk4MdoXeds+/cqwR0fo3Md7RWiyM4wsqU/nrjBJjibPgr2u 1B9/I/7oRLUE7udB8H5/MByHnPncmTwqzpqKpX70ZTCj8vkesR1QB5KRudzhImVSI/aP lWe+I4hYvXmKwSKYJS1t1Egt7ICNAOTvtlgPZZ2hLcAtio84GpNOiOrczjVMml0DmP0u ryHXWchj/GcVvyKrwxVpZarAQs2iY0ZF9dOLx/wvwwx7/ReIZyY73r+ryG3Mjs3qtqnn CUIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=aGm6yXkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id k129-20020a636f87000000b0057e0c5a34f1si3383705pgc.239.2023.10.04.04.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 04:04:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=aGm6yXkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5738381FDB82; Wed, 4 Oct 2023 04:04:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233132AbjJDLEZ (ORCPT + 99 others); Wed, 4 Oct 2023 07:04:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242214AbjJDLCU (ORCPT ); Wed, 4 Oct 2023 07:02:20 -0400 Received: from smtp-190c.mail.infomaniak.ch (smtp-190c.mail.infomaniak.ch [IPv6:2001:1600:4:17::190c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D74EC4 for ; Wed, 4 Oct 2023 04:02:16 -0700 (PDT) Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4S0sGG5VqQzMqBgl; Wed, 4 Oct 2023 11:02:14 +0000 (UTC) Received: from unknown by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4S0sGD2t0SzMppKM; Wed, 4 Oct 2023 13:02:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1696417334; bh=ykMu7wUYzgFvuDZ0CG84JZTWl5H2yiOE35Ezb8Q8IBQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aGm6yXkxSlt7Dsy/LA1bJBD9HJ16gTSzg2aXKERwe1o0CJGBcfVv6Qe6CMp6Addnm pw5b8tVBCrsxyutWFQjlfsrb1Oe26L2qfjjQkp+NM7iZ/rFM5dRy71KkNEZkyd5TYJ sBuVUTjM5z0l9lqBJZNnSVZDjICADSuVibhMC+JE= Date: Wed, 4 Oct 2023 13:02:15 +0200 From: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= To: Arnd Bergmann Cc: Stephen Rothwell , Konstantin Meskhidze , Linux Kernel Mailing List , linux-next , Willem de Bruijn , gnoack3000@gmail.com, linux-security-module@vger.kernel.org, Netdev , netfilter-devel@vger.kernel.org, yusongping@huawei.com, artem.kuzin@huawei.com, Geert Uytterhoeven , Randy Dunlap Subject: Re: linux-next: build warning after merge of the landlock tree Message-ID: <20231004.ieZ2eekae5Ch@digikod.net> References: <20231003.ahPha5bengee@digikod.net> <0174c612-ed97-44f3-bec5-1f512f135d21@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0174c612-ed97-44f3-bec5-1f512f135d21@app.fastmail.com> X-Infomaniak-Routing: alpha X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 04 Oct 2023 04:04:36 -0700 (PDT) On Tue, Oct 03, 2023 at 03:40:23PM +0200, Arnd Bergmann wrote: > On Tue, Oct 3, 2023, at 15:15, Mickaël Salaün wrote: > > PowerPC-64 follows the LP64 data model and then uses int-l64.h (instead of > > int-ll64.h like most architectures) for user space code. > > > > Here is the same code with the (suggested) "%lu" token on x86_86: > > > > samples/landlock/sandboxer.c: In function ‘populate_ruleset_net’: > > samples/landlock/sandboxer.c:170:77: error: format ‘%lu’ expects > > argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ > > {aka ‘long long unsigned int’} [-Werror=format=] > > 170 | "Failed to update the ruleset > > with port \"%lu\": %s\n", > > | > > ~~^ > > | > > | > > | > > long unsigned int > > | > > %llu > > 171 | net_port.port, > > strerror(errno)); > > | ~~~~~~~~~~~~~ > > | | > > | __u64 {aka long long > > unsigned int} > > > > > > We would then need to cast __u64 to unsigned long long to avoid this warning, > > which may look useless, of even buggy, for people taking a look at this sample. > > > > Anyway, it makes more sense to cast it to __u16 because it is the > > expected type for a TCP port. I'm updating the patch with that. > > Konstantin, please take this fix for the next series: > > https://git.kernel.org/mic/c/fc9de206a61a > > > > > > On Tue, Oct 03, 2023 at 02:27:37PM +1100, Stephen Rothwell wrote: > >> Hi all, > >> > >> After merging the landlock tree, today's linux-next build (powerpc > >> allyesconfig) produced this warning: > >> > >> samples/landlock/sandboxer.c: In function 'populate_ruleset_net': > >> samples/landlock/sandboxer.c:170:78: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type '__u64' {aka 'long unsigned int'} [-Wformat=] > >> 170 | "Failed to update the ruleset with port \"%llu\": %s\n" > > I think defining the __SANE_USERSPACE_TYPES__ macro should take care of this, > then __u64 has the same type as it does in the kernel. Thanks! I didn't know about this macro. We'll use that and print the full 64-bit value. > > Arnd