From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbdB0KL0 (ORCPT ); Mon, 27 Feb 2017 05:11:26 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:49936 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbdB0KLG (ORCPT ); Mon, 27 Feb 2017 05:11:06 -0500 Date: Mon, 27 Feb 2017 13:09:48 +0300 From: "Dmitry V. Levin" To: Alexey Dobriyan Cc: Andrew Morton , "Eric W. Biederman" , Linux Kernel Subject: Re: + uapi-fix-linux-sysctlh-userspace-compilation-errors.patch added to -mm tree Message-ID: <20170227100948.GA16920@altlinux.org> References: <58af65cf.uNXK5zzvUJ4F6QpG%akpm@linux-foundation.org> <20170224143533.GA6820@avx2> <20170224223551.GA12533@altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=x-unknown; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 27, 2017 at 12:38:16PM +0300, Alexey Dobriyan wrote: > On Sat, Feb 25, 2017 at 1:35 AM, Dmitry V. Levin wrote: > > On Fri, Feb 24, 2017 at 05:35:33PM +0300, Alexey Dobriyan wrote: > >> On Thu, Feb 23, 2017 at 02:44:31PM -0800, akpm@linux-foundation.org wr= ote: > >> > /usr/include/linux/sysctl.h:38:2: error: unknown type name 'size_t' > >> > size_t *oldlenp; > >> > /usr/include/linux/sysctl.h:40:2: error: unknown type name 'size_t' > >> > size_t newlen; > >> > >> > --- a/include/uapi/linux/sysctl.h~uapi-fix-linux-sysctlh-userspace-c= ompilation-errors > >> > +++ a/include/uapi/linux/sysctl.h > >> > @@ -26,6 +26,10 @@ > >> > #include > >> > #include > >> > > >> > +#ifndef __KERNEL__ > >> > +#include /* For size_t. */ > >> > +#endif > >> > >> There is __kernel_size_t for cases like this. > > > > No, __kernel_size_t is not for cases like this because size_t differs > > from __kernel_size_t on x32 and mips n32. > > > > Fortunately, there is no sysctl syscall entry on x32, but on mips m32 > > it is there with number 6152, implemented using compat_sys_sysctl. > > The latter operates with argument of type struct compat_sysctl_args* > > where newlen is of type compat_size_t. > > > > If you change it from size_t to __kernel_size_t, you'll break mips n32. >=20 > You're gluing kernel interface to an userspace header > which kernel doesn't control. Are you sure it's me who does the gluing? As no uapi header provides a definition of size_t, they are essentially relying on size_t being provided elsewhere. For this reason, inclusion of is the most conservative fix. > How can this fix anything? For example, AC_CHECK_HEADERS([]) doesn't work, one has to use AC_CHECK_HEADERS([], , , [#include ]) instead. The same issue arises with other autoconf checks. I think that every uapi header file should be standalone, i.e. it must include, directly or indirectly, every definition it uses, so that no user should have to guess header dependencies. --=20 ldv --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYs/rsAAoJEAVFT+BVnCUI0BEQALIJ62GFWoit6JNeVKaMfJ9s y2cNtEpMLRXajYWF19ExYe9eREfKLiVcoiYdiVdn9LlEpDb5zMtpIKaWGSazGQ98 by6N4PHlI99GYTnVD73XJfHbTIGoX6stVBiXsKooxzOPbYnlVVC1CZdlwN7otEU7 RbqlpzIPYlon7zjzW0RnptFQvAlfIr5UbOhGYEyMobyy8e0sL9P+Z9gsBvzQPU1a 3BOMaev8KVB5Lfc35MBrC8f8B2XdhnCIFU5BA/nrObEBvKJNBD0iM5x0Hz8XyWQb nXTpIkRK6RY9AtYgsM/659we8yYK7ljiTXUojg6mzMjN7adzUpipJy3sl890fLdW IJZKX6UhhST8toPeA1h+Oqw/coTo+/AcGSt85ubDYR6Gj1eFA/cbUSSFGFzcVY/M tMhQ4VAge3GQOKOWL8dWPen6s/zdq3nd/8TceYIhf5N9s2vNL/cCMZQFGQkO6Xx8 NYSvCwJ4CTE+1HpyT66+uvR/rOLg+1wrVqa9wcAbFnQ7TlJ7gGw1VgucSJ18w8fN eagAKY83dyE/nwmAJr/kIATFnbPCqhpO7NuQQatKFHwsMBSKZVCoIZsXSo6IYQ2X cyTSzKqf5CQAgbLEq2qvieuCm6iESqPvqTctFTXCZwpeQKmpyfZKcKLEWLf2LqKr 9UCy+JhW1FuSQIyX8aJr =pplJ -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--