From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: BPF uapi structures and 32-bit Date: Tue, 27 Nov 2018 14:25:10 -0800 (PST) Message-ID: <20181127.142510.717161104715347913.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: daniel@iogearbox.net, ast@kernel.org, john.fastabend@gmail.com To: netdev@vger.kernel.org Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:41912 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbeK1JYe (ORCPT ); Wed, 28 Nov 2018 04:24:34 -0500 Sender: netdev-owner@vger.kernel.org List-ID: In the linux/bpf.h UAPI header, we must absolutely avoid any non-fixed-sized types. Otherwise we have serious problems on 32-bit. Unfortunately I discovered today that we have take on two such cases, sk_msg_md and sk_reuseport_md, both of which start with two void pointers. I hit this because test_verifier.c on my sparc64 box was built as a 32-bit binary and this causes a hundred or so tests to fail, and many if not all are because of the changing struct layout. I could built 64-bit but this absolutely should work properly. But for fully native 32-bit it is even worse, this will really need to be resolved because llvm/clang is always going to build the BPF programs with 64-bit void pointers. I would strongly suggest we try and fix this now if we can.