Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp978748ybb; Sat, 28 Mar 2020 15:08:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsoKca7lnV2u7ECR/vkEvaxIG1emQ1rA3wZKRpHNjDtH8betx4W0ZuHujzYop+x4K5k1r/E X-Received: by 2002:aca:bac1:: with SMTP id k184mr3474494oif.157.1585433309618; Sat, 28 Mar 2020 15:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585433309; cv=none; d=google.com; s=arc-20160816; b=okEmz5n6ky65tzKjGo0dvCYMfRpTzw1+1ZoCt0d4ZHkDwXYyx1FKqFLj2Ho/wGzgKV 0O+7pOLU/TjWleywF5YtDSbTJx7Zq/sWiKz8tTk0iqy5L7myCKql+JZrMrPPo6vutG+V C7fxTmUQ6L9uPV7tLIldrDNFeRMFxnum2i6Ar8HNHc3kkNtD4jaBVLlAqOx51vxJNc6g qQau8gbo8rB3yHEXmfYmHkwj8+4Rt2r78V5coWtj5Nlrf43lvHXAHbaeIJjfztx5exVH qp/MPTwL+KTe03rD6qSlj8rdBJDxSQiojfCjQhW9rTByjXfri0WoOk/vXbBmFgZFrKQE wuhQ== 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=NCEn6jiYkuBInipnn6zCj3DDSQcSKN3aqUSzXbErLKE=; b=N9N14ByjzOJyTKTIjGdeIn7Suv56ynP752f5A6ifoRsFraF/FEaDKYd66G5hFrZm9l z6qKZzJ055dXhxYgaoVFGutR7Tka8IcLwFucGYED5kCG5qC3rL9vwAOaYaq419rJsboe m3i/Cx2aX2O4g2i31g+0/EghGn+56lgstnYo3sHO813SNTnJXaNQyKHBo7xHsI+d1LFB sfqAcnUzrbo5c2IxyzZIUHq38zsm5mC6xSsIU6EhC4hQXFn3yMPP1LYO7sZRF+IMmboj cjPMnBYCsjU85tX9n3Q9lOvdUe37U/zIAzPr6OMIG+tfN2B/l+p7R/ILn83RGZRnJQQU KxSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Rq3TMeuP; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si2387860otp.258.2020.03.28.15.08.16; Sat, 28 Mar 2020 15:08:29 -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=@chromium.org header.s=google header.b=Rq3TMeuP; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727813AbgC1Vw6 (ORCPT + 99 others); Sat, 28 Mar 2020 17:52:58 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:52961 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbgC1Vw6 (ORCPT ); Sat, 28 Mar 2020 17:52:58 -0400 Received: by mail-pj1-f68.google.com with SMTP id ng8so5680565pjb.2 for ; Sat, 28 Mar 2020 14:52:57 -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=NCEn6jiYkuBInipnn6zCj3DDSQcSKN3aqUSzXbErLKE=; b=Rq3TMeuPbUxxPHxnu2HIoc61sTFjgLQaNuXNOiePL7aKZf69jQ+dFmmXivkyriybNW vgQPzAGLknpxdaaBjXnKSMKfGascpAM2sveRdm1tiga7RQ5eBW5zwWegcXEF3OuBmBHO GYik2IFuQR2m0KTYbl2FbSa8Eqyejs4hrgep4= 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=NCEn6jiYkuBInipnn6zCj3DDSQcSKN3aqUSzXbErLKE=; b=oV5JndJK0qBFh77H2slfNXV+VvSf+Vo7i03XS+lQ/WSV91brwLgqbfKRVbwOJHQ684 K8nnxSyPW7LkKb5mQ7oDrEJtC6ZSg89iuuFHIRO6+wA2C5a7fIzYzibc18NFNdQ8eCHY vSSr/wBFlpuswWldQ5HF6Fv1XHGFOaLZIwlgL+WoEpCnfgxBJdMOnfY9BLhmgb2Kdhtl A3k/luwH+GQ4yq0Pt9S1AGnUl1wZ/+ZhqvS10fEYS/9tS+OlXoBT8jnFnNKG/kfLuGkY XMPDAf/PIEwnYqBw/fUGUfH5BsbNFdSqDYKwzRRJpQoZMtaolh5DVjatpHZapNBTeW36 O0+g== X-Gm-Message-State: ANhLgQ15feEQq6RmXaFzl/F4BYv+5nLlbwjpBGa6SnraHFwNuSs111mQ jnz4v+95djXBHiipyjJiJaYLzg== X-Received: by 2002:a17:90a:368f:: with SMTP id t15mr7297208pjb.23.1585432376997; Sat, 28 Mar 2020 14:52:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i189sm6840804pfc.148.2020.03.28.14.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2020 14:52:56 -0700 (PDT) Date: Sat, 28 Mar 2020 14:52:55 -0700 From: Kees Cook To: Alexey Gladkov 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: <202003281451.88C7CBD23C@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200328211453.w44fvkwleltnc2m7@comp-core-i7-2640m-0182e6> 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 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. -- Kees Cook