Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3856286pxb; Sun, 24 Oct 2021 12:57:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHcvUfijwgy31P7EbRyP3ufYm5QT7So/XxhVwshQVR7YYQQi0kijrK+bq1rV3r3itwKRPi X-Received: by 2002:a17:90a:4fc5:: with SMTP id q63mr30566214pjh.148.1635105439662; Sun, 24 Oct 2021 12:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635105439; cv=none; d=google.com; s=arc-20160816; b=R1AlR9AIlxwg5N26UP+GYjIqzmUCunFnMvy1yVcXqaWF+DEb34L4YiT8cK9Xm7C2NO dHY5PrwxYqpShqb/A5Bbp/EamhP/e3i6oEeSjIsPHX24tpKpHw8rnYAc0eH6G+vIQxuy INfEpJkkZ5UAaZ+jXmkMWLQ56hRBiazu2MMkz1pdLEwqG8Svy/kUPSJohthV3Ms0uNmu b/UUvtB/MqmjRxYk+r7Mloen9KfRICgXwTjec7YObRhh8GqDni5Ro5kNku0+TzHNrsDS r3u52BdFpnp12bEsMJXGi4rnrNb8tOriYioA63MBdNTQ0/5r8VSnuhFamacZAi+GhWB9 jLKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YJu0Mxyii58MkxpAp4stYwVQr+JWQPPDXyojKIavpRY=; b=Nt1i9D5wCqObXnwdNYEdRZqBNEt87VIFOQrWg2j3hBy7CBZUGD7ZnktVskIkdIupqU 6ajh4cCOdupkDW2M42a6OTOZ3gC56WnRayPoiFJ8nHDQtF7qy3ExRgFjEJHKDtt7eSH0 0+IWkSJ8mz69LRMA574gBXY1Rz7Ff1yxNDt6weHZLsZSsQBc2Ra1GIJCyFFSvQkAJ3U5 BUlFB0RPN1L23N9gZiA1PJ48RAgDakf9F4RodFl+5/aCSegCDU/qkOWw2NJ2two0Sh+5 AXUm+ZVoUgjLUwrtoV9msUVnq6++r6Wou1FgsGwuhJURXfa/ig3LUbQ4q8mEaxrCWtDe 2xgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DkdIJtZq; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d64si22146071pgc.280.2021.10.24.12.57.07; Sun, 24 Oct 2021 12:57:19 -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=@kernel.org header.s=k20201202 header.b=DkdIJtZq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231786AbhJXSwB (ORCPT + 99 others); Sun, 24 Oct 2021 14:52:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:59824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbhJXSwA (ORCPT ); Sun, 24 Oct 2021 14:52:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BABF60E74; Sun, 24 Oct 2021 18:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635101379; bh=1kqycnVC8fukz0uELJHiRc1ElEC5mtlD4Z21MQOaCco=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DkdIJtZqofdqkgfp44isp63Hs/p6GmYy/OVlz2jYbdX9DtNnpEhQ84pk0kfliUfXh 3lGMnSbuxWiuGr06uhbplT8vnuQpRKpDx8aVYWWr2oghba7ctjVtc4L1g1OPkSJWIP teS7nOSmsFLHrz/bLZGySaCh4SkwyytVTiYFJJWhqh1/pIoF4Ma0OY+7ViAUogvUH4 6qZ12pqSCctLUmEp0uJEOKJg8LwJdTpPgR9av092gP8vfOGnr5GGKVfFrbFRxTKNrh PWdqF35Ai6bEufKD2mqjJ6TnJz2XDYfyCOiJaeQJb2WBZAp4zwR/RrkBtleQe/iikN 4yVfSrJbFQZ/A== Date: Sun, 24 Oct 2021 13:54:27 -0500 From: "Gustavo A. R. Silva" To: Matthew Wilcox Cc: Len Baker , Kees Cook , Luis Chamberlain , Iurii Zaikin , linux-hardening@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2][next] sysctl: Avoid open coded arithmetic in memory allocator functions Message-ID: <20211024185427.GA1420234@embeddedor> References: <20211023105414.7316-1-len.baker@gmx.com> <20211024091328.GA2912@titan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 24, 2021 at 06:55:13PM +0100, Matthew Wilcox wrote: > On Sun, Oct 24, 2021 at 11:13:28AM +0200, Len Baker wrote: > > I think it's better for code to be understandable. Your patch makes > the code less readable in the name of "security", which is a poor > justification. I agree with Matthew. Those functions seem to be a bit too much, for now. Let's keep it simple and start by replacing the open-coded instances when possible, first. Then we can dig much deeper depending on each particular case, taking into consideration readability, which is certainly important. Thanks -- Gustavo