Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp769346ybg; Tue, 9 Jun 2020 12:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7/dDpMw+QCbC560o2pmWy5qoR5IgxqHlGpVuHY+jKgLAOj962uXfltm6f5rk7pk4P9w1T X-Received: by 2002:a17:906:48d8:: with SMTP id d24mr19510111ejt.369.1591730395125; Tue, 09 Jun 2020 12:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591730395; cv=none; d=google.com; s=arc-20160816; b=gMIqJbWX9S52XDjrkg7/6P0sdjMeqENGkr2S/1LodhKbTpzT3WzFTm5b0uwU5GaUYz Wz/FX+gAuJQ6oa9YvO1yly+K5HfCz+tBkCRRoZcYaWmJf0GI8RqtxOTbdMhsFTuaKtE2 DWtWwoPoOxUseqsMLyXneR34esJkUAQG4Rx+UStZCIP+XTs/MuxzOYB8QKMyR3w/soFX vDmHJnAZobbjIhgSmBY/75CKDs0biX5c3dk5Tj96n2LD81lZg2eLkk5dFMaT3WvLqJgo SyEEQTqbMA8cVcMnEsbJX5j01ZT6dZP4rmgMPf5aHP/jDLGET9jk02bCAqJxXI8T35GZ RvHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JhuprND+jQiTm8+uL0T5IxvcnEQrqGWifzKP0d4qVkA=; b=yzk/oVIZTynumHj4XwC5hQYYJwQwn/LpYIBCHAdGH6dRLZ4ac44t+e77JIpW7FvXZc cadYvVglVgUGv84W37jykC9y0cUEnnz81ehWRRy421Me/f1mF6T8CtB0YhI8FI0tsF9q e9XuM8NDM5/HflZfnP2FVLsZyu5fBEXS8bl0MfuXSy/zoY442k5v0DEugkyd9dDSCOmY 2KDHUP3lOqr8IzXNWy4Cd/xW8vm9GcPgDa5t6iMe7duWvTzU14UPLZJkGolR8zM5BTCY MLxlpXrZ9zuCdc7el58TJZ9QVX85fNbHFZCPi8dhTTR9UkzvVRhqEujvzUN57jpbLXeH Mxgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gGlTwgs4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si11256059ejt.712.2020.06.09.12.19.31; Tue, 09 Jun 2020 12:19:55 -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; dkim=pass header.i=@chromium.org header.s=google header.b=gGlTwgs4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730803AbgFIPkl (ORCPT + 99 others); Tue, 9 Jun 2020 11:40:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727945AbgFIPkk (ORCPT ); Tue, 9 Jun 2020 11:40:40 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE3A0C05BD1E for ; Tue, 9 Jun 2020 08:40:38 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id h95so1571058pje.4 for ; Tue, 09 Jun 2020 08:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JhuprND+jQiTm8+uL0T5IxvcnEQrqGWifzKP0d4qVkA=; b=gGlTwgs4RnRI980s5nUdvbSJSvupkhz1v2MySy7SoxfZ3MT9KzqwKvFnwMUNFW1ge/ pk2hLsc/i8QoVgK9pQpc7YDgNX+GeRaigk4Cyn92MCqJxh4mIUzXawnI3DeVxgVDrw3T uZJjJ8Tm3gW3jwo3l2/aIEUvHB7oBIL9Un8lQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JhuprND+jQiTm8+uL0T5IxvcnEQrqGWifzKP0d4qVkA=; b=FrLrw77qkUd5jrcQgtbL6ZSIzkhVekAEHz39gULY++HC4TT9WC+HLiN8kLqFptbyJE ZS+KlM2rsI5i+5yO/Jck4kCiyfUq0zTFxiNqAqiQjlNTM8H21nMZW/cCDwY7wjUabRpP UyAlb2LZigZUH/U9dOTuGj4bwraBL/CogPl+46q99lOH614qx6cTBVccZmmHqv9fHJqw AjagZSiKtYSMxGIAzPp2CmvryBbm/qKrnSfMsvlZwJm0IbajiyOy/PXmIiRyiK1ZZjuK ymSVFzJkWZyrQfJ5EFcnjw6hk/ctIHyIWkSAE0Bhb2Idh0y0bsda13p2HsS5pqdxxtoB u3VQ== X-Gm-Message-State: AOAM533mTS+6pduxyqEJoYVK1LK5LxV8XDAHxh7wf0VmlS1KnTjxA7W9 +vpL4iTE7VdOrEEAN+JLUsre/w== X-Received: by 2002:a17:90a:9d82:: with SMTP id k2mr5496082pjp.224.1591717238322; Tue, 09 Jun 2020 08:40:38 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z23sm8532845pga.86.2020.06.09.08.40.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 08:40:37 -0700 (PDT) Date: Tue, 9 Jun 2020 08:40:36 -0700 From: Kees Cook To: Xiaoming Ni Cc: ebiederm@xmission.com, ak@linux.intel.com, alex.huangjianhui@huawei.com, linzichang@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sysctl: Delete the code of sys_sysctl Message-ID: <202006090839.6EDB4BA@keescook> References: <1591683605-8585-1-git-send-email-nixiaoming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591683605-8585-1-git-send-email-nixiaoming@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 09, 2020 at 02:20:05PM +0800, Xiaoming Ni wrote: > Since the commit 61a47c1ad3a4dc ("sysctl: Remove the sysctl system call"), > sys_sysctl has lost its actual role: any input can only return an error. > > Delete the code and return -ENOSYS directly at the function entry > > Signed-off-by: Xiaoming Ni Looks right to me. Reviewed-by: Kees Cook Should this be taken a step further and just remove the syscall entirely and update the per-arch tables with the ENOSYS hole? -Kees -- Kees Cook