Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp398911ybn; Tue, 1 Oct 2019 23:21:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW+dn4hDVGFY36qTOALOXE6USPWkZsZ+aIKdsZL3LugXe40FJyIlxvLK1FA/oCOr1P9TFa X-Received: by 2002:aa7:d995:: with SMTP id u21mr2025828eds.271.1569997283273; Tue, 01 Oct 2019 23:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569997283; cv=none; d=google.com; s=arc-20160816; b=UKy7TSuEZyLbqWIyZuZY43SKKWY9+GtG8Nplars7LDvWy2vjMbKB8dKoLiyjfih1jr lMQbtHrekBfFPDGmEK/JaIyG+DTRzzugxrnJCTNFARvCh8dpigVw/1FxxOqOciS5PWGn 1119My1HJtJOPBSEIANGfgIMqQOGj+iJwU8SmbI9MU2GI6n6mS8AFbYV8wLFLFc1Pufu 5GsDimLOpFino/hbBE1p5rIlq8SXhuSGgh8W7UPCyy/O94QdJZEXkwiKKTjmCU42/PhM v/1n8AAJRZ7yA7ic7rCfwpQEMoZgh0MSYAoAXB2U5sCGyPPilWD+kSrDNSi5nD46i6ir O87Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VtOW9l/Mzm4WWzQNjfCTvJ0AhTUTSkblWJhPZb6hfmM=; b=Gl6bsSdqu//3WO1YhhO7g3xCcN+TLKJFSDruG21qQ46tpkD7K3BiCk2mgcSwlih/uV oiXDLLnYIwv+mn7uMHRZjpc+JzGwxWjoJ7ehBljXHyqtbEJrhWDx19Wu6Nw1xoNwNoxz YEeZlyHVPgTwjmzaJCNfkzjz5OCtn33VnUmdeZnC5aXCYe+gQBwi4AB7WSTRHLDZFTBp cytRGZStGqScnW6IL3WgB+KOSZrVjNCr4HC+fpuYRvu7H92mkFEdsHuu+yIUh2gLw0WQ 1gurcbBrSrVA2OMlviwaX9nafoF3KLTThzHmb3fLdDhdYeWyxt/uEt2I+b8Tm0jhsxqT INsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FRo5cLPv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si11226091ejq.243.2019.10.01.23.20.59; Tue, 01 Oct 2019 23:21:23 -0700 (PDT) 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=@google.com header.s=20161025 header.b=FRo5cLPv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbfJBAke (ORCPT + 99 others); Tue, 1 Oct 2019 20:40:34 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:44309 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfJBAkd (ORCPT ); Tue, 1 Oct 2019 20:40:33 -0400 Received: by mail-oi1-f196.google.com with SMTP id w6so16145027oie.11 for ; Tue, 01 Oct 2019 17:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VtOW9l/Mzm4WWzQNjfCTvJ0AhTUTSkblWJhPZb6hfmM=; b=FRo5cLPvmdDcGKerDWzBLxevEUMFsOs95oNwqAA5YnVlRPDuDp82XzZtRMnRIivrt1 6jMYweeiVNv6d+8LctOdqgQuOz1j1je5crIDohHrUnbqv/Mtkc8FaWXIXpATZ8vJf3lA iB+PnAPg+5q6B6eBGFXz9fP8JohTkfisaSniWzc+b/88aUSvWHV4uKN4i0ugcSgyjO8Q kMvBoQa/7mrL24FTI1ZKDlR7MJw0qMXTGSunSEgcc6GXqPvr3EmUVpn2Su1DH3vrki8Q GmJuhOz5UYgv4e0CH87W50Na3TCqeeb1Aiy3K9iV38fqo9wtSYcBbwjEfQThm+mZwWQl iWWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VtOW9l/Mzm4WWzQNjfCTvJ0AhTUTSkblWJhPZb6hfmM=; b=enWpRoukDKCuhgnWOockITHWiUfp1ODO28SjqoYMnlvC+O4BS25sfFdIIjdr4D844U NPXzxpGM+3gPqVKtM9gnvVQH6F3/sj0LMnkbkhJs59iMZyBph76CcFQC65HrnkE4iA+p L5AsyJlkuMu7lCkRhDqgQ2Lu6KRb/KdmagrCP0WpUoEruwW40rTnvj9T7jTTnbI3D5ni SiV5KQIuFLKBP+Ggk9u2huElwV7J1t8EFZg5qq3NBSe2YNo6lTgKxUueCAB0EiyMrH8o Nu85THOzuxKpubFMcgZ3ZSQwmwEgZ7o9scTUOQjuNrqysxMaw+5HCQLEZakM/4YwMTZy kX1A== X-Gm-Message-State: APjAAAV2qVFQoENa6IRrViyaIq+DiFzL0/Kccr2pcsPtJ8x7ctS0XpTF Ea4SVex+GQwgt4VZbk87VZfmO8tDoDv/eOzwmEkEZg== X-Received: by 2002:aca:4406:: with SMTP id r6mr615626oia.175.1569976832302; Tue, 01 Oct 2019 17:40:32 -0700 (PDT) MIME-Version: 1.0 References: <8736gcjosv.fsf@x220.int.ebiederm.org> <201910011140.EA0181F13@keescook> <87imp8hyc8.fsf@x220.int.ebiederm.org> In-Reply-To: <87imp8hyc8.fsf@x220.int.ebiederm.org> From: Jann Horn Date: Wed, 2 Oct 2019 02:40:04 +0200 Message-ID: Subject: Re: [RFC][PATCH] sysctl: Remove the sysctl system call To: "Eric W. Biederman" , Kostya Serebryany Cc: Kees Cook , kernel list , linux-arch , Linux API , Linus Torvalds , Andi Kleen , Andi Kleen , Cong Wang , Luis Chamberlain , Apelete Seketeli , Arnd Bergmann , Chee Nouk Phoon , Chris Zankel , Christian Ruppert , Greg Ungerer , Helge Deller , Hongliang Tao , Huacai Chen , Jonas Jensen , Josh Boyer , Jun Nie , Lars-Peter Clausen , Ley Foon Tan , Linus Walleij , Max Filippov , Olof Johansson , Paul Burton , Phil Edworthy , Pierrick Hascoet , Ralf Baechle , Roland Stigge , Vineet Gupta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Kostya (code owner for LLVM sanitizer_common) as FYI On Wed, Oct 2, 2019 at 12:54 AM Eric W. Biederman wrote: > Kees Cook writes: > > On Tue, Oct 01, 2019 at 01:36:32PM -0500, Eric W. Biederman wrote: [...] > > I think you can actually take this further and remove (or at least > > empty) the uapi/linux/sysctl.h file too. [...] > I would make it a followup that removes uapi/linux/sysctl.h. I don't > see anything in it that isn't about the sysctl system call. I will keep > it a separate patch as I can imagine something silly that needs the > header file to compile. A separate patch would make a revert easier > if we find something like that. Unfortunately, I think that header (or at least parts of it) has to stay around for now: Looking through the search results for linux/sysctl.h (ignoring glibc's sys/sysctl.h, which pulls in linux/sysctl.h, because almost all of those hits are conditional includes for BSD systems) on codesearch.debian.net, I noticed that e.g. the ASAN code that GCC and LLVM use pulls in linux/sysctl.h and uses things from it: https://github.com/llvm-mirror/compiler-rt/blob/124fd5d9aff57cf47bf077df81ad939b289acc6e/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp#L1063 And indeed, after replacing /usr/include/linux/sysctl.h with an empty file, a build of LLVM's runtime library component (compiler-rt) (git HEAD version) falls over with error spew about __sysctl_args: ==================== $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='clang;compiler-rt' -DCMAKE_C_COMPILER=clang-7 -DCMAKE_CXX_COMPILER=clang++-7 -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_USE_LINKER=lld-7 -DBUILD_SHARED_LIBS=Off ../llvm [...] $ ninja -j64 FAILED: projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cpp.o [...] [...]/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1063:17: error: use of undeclared identifier '__sysctl_args' CHECK_TYPE_SIZE(__sysctl_args); ^ [...]/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1064:23: error: use of undeclared identifier '__sysctl_args' CHECK_SIZE_AND_OFFSET(__sysctl_args, name); ^ [...]/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1064:1: error: expected expression CHECK_SIZE_AND_OFFSET(__sysctl_args, name); ^ [...]/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1438:34: note: expanded from macro 'CHECK_SIZE_AND_OFFSET' sizeof(((CLASS *)NULL)->MEMBER)); \ ^ [...]/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1064:23: error: unknown type name '__sysctl_args' CHECK_SIZE_AND_OFFSET(__sysctl_args, name); ^ ====================