Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1007230ybb; Sat, 28 Mar 2020 15:57:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv4tDuYV30IDVd/93lXdLl2ZQMjlJ0FSyzexjcn2HfZLP1dZFcEjBtwbjf7FaCLfB62+nj6 X-Received: by 2002:a4a:e047:: with SMTP id v7mr4672589oos.49.1585436279461; Sat, 28 Mar 2020 15:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585436279; cv=none; d=google.com; s=arc-20160816; b=ZhBSjrSPCTYNl0de7x7fjy77TnjLRMywmaEVqubKP9jb3AeKgyLP8W5S43y8JSFOMQ +aAP47MNieuEQ25Uidlpr5VqhmlpIU07JSbJs9nm6Lvh49LuT0ShGsS1rNlXi+6DMim1 a1y8x3ahZKnLkDPWy1a4w6qFzstM6gTA7+hyP6PqElBLuVcL/KEos/GKF4YWlyDulasD 1AB7ocntCI2ReMxZc3vSCdYw6SYUPUO9FTZZm3UwFB8fM1CFIS8sb1cmpMrxnw+baxJ+ wUfz3D+Vw4uSaJoZpLULhHbuEzYnN2jCfMrsmmyEo9gAeZ1ji4u3E38sBTss5Rk+sb2s Rjqg== 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; bh=//1wvawmQALzc0Vbxemfd5vTyK4mlW/KEoz6xXABR88=; b=mRHO0cyybKirxreQ9A9tveOc72/qlHMijUX+U3fZ6gZX7my1yj2cR8VV6Jm8yZjmUs IGp/b+3RGOYljVh4DoUREMlxkfXMrerncyAl0NrHBFzgtpymrT36YstgkrfKcIz44Z9Q NNlxUVyqHkQ8NZwvotVvp3RvffVLIBPUoU8wVRqgLz4MddzGjzwdH1wEVWpSQEz2YJSN ieB53pVMwzp6AgoDHK7HsN9b81uZvL60IPPtAZt5Fg4JEP5CxVRdSslXghmovZrNyj3m A+EQ4igitdSLd7PsC4hTfMUg/LjcYTSkCCnvnToiPuXJ1qIBXJFL/kpX1JIWjpkUAlnN zOgQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si1768140otp.191.2020.03.28.15.57.46; Sat, 28 Mar 2020 15:57:59 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727797AbgC1Wyq (ORCPT + 99 others); Sat, 28 Mar 2020 18:54:46 -0400 Received: from raptor.unsafe.ru ([5.9.43.93]:39284 "EHLO raptor.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727716AbgC1Wyp (ORCPT ); Sat, 28 Mar 2020 18:54:45 -0400 Received: from comp-core-i7-2640m-0182e6 (ip-89-102-33-211.net.upcbroadband.cz [89.102.33.211]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by raptor.unsafe.ru (Postfix) with ESMTPSA id B3BD8209BD; Sat, 28 Mar 2020 22:54:41 +0000 (UTC) Date: Sat, 28 Mar 2020 23:54:36 +0100 From: Alexey Gladkov To: Kees Cook Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , "Eric W . Biederman" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Linus Torvalds , Oleg Nesterov Subject: Re: [PATCH v10 8/9] proc: use human-readable values for hidehid Message-ID: <20200328225436.m3f72nutyq352i2w@comp-core-i7-2640m-0182e6> References: <20200327172331.418878-1-gladkov.alexey@gmail.com> <20200327172331.418878-9-gladkov.alexey@gmail.com> <202003281321.A69D9DE45@keescook> <20200328211453.w44fvkwleltnc2m7@comp-core-i7-2640m-0182e6> <202003281451.88C7CBD23C@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202003281451.88C7CBD23C@keescook> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.1 (raptor.unsafe.ru [5.9.43.93]); Sat, 28 Mar 2020 22:54:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 28, 2020 at 02:52:55PM -0700, Kees Cook wrote: > On Sat, Mar 28, 2020 at 10:14:53PM +0100, Alexey Gladkov wrote: > > On Sat, Mar 28, 2020 at 01:28:28PM -0700, Kees Cook wrote: > > > On Fri, Mar 27, 2020 at 06:23:30PM +0100, Alexey Gladkov wrote: > > > > [...] > > > > + if (!kstrtouint(param->string, base, &result.uint_32)) { > > > > + ctx->hidepid = result.uint_32; > > > > > > This need to bounds-check the value with a call to valid_hidepid(), yes? > > > > The kstrtouint returns 0 on success and -ERANGE on overflow [1]. > > No, I mean, hidepid cannot be just any uint32 value. It must be in the > enum. Is that checked somewhere else? It looked like the call to > valid_hidepid() was removed. The valid_hidepid() is called after parsing the hidepid parameter value. Yes, it can be called inside this condition. -- Rgrds, legion