Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp50215ybf; Thu, 27 Feb 2020 15:51:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyCUhbh4WQabNkzNBNfydp5ettDAwfgc8vjzMOeh2JDcHAqvrH5JLNW7MZNs35Zie1DouF6 X-Received: by 2002:a54:4805:: with SMTP id j5mr1214894oij.29.1582847496673; Thu, 27 Feb 2020 15:51:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582847496; cv=none; d=google.com; s=arc-20160816; b=E/YVzmiN90FhSR2BUoVnI7H2VmPzTPHMHQqhNbzwrTlEbSGFdP0u4T6qkq9H0EJC/J qkuOvDGL+dGbOeSLymOGqpYCs/uhNBjuZGoLn8z02DIQY9bNixX66cx3j4/qnNQI4I3Q ZrYg5kW9n2WnVUB/gjZamhnuk6st+a+8EHuKoJcai3VOaIlR0vgN+W3A+EytivNBaACg crCdhoyZzkHRRkcKEsk0Qc7asP+ibeEA3JdHYV5wh3BD3l9RROTOkxS+g5L/eDKgoFo0 jgsh89pU3k5sLRqQxcZtyRk3Dw5XrmYsOzqu9Z7dkS4EOYCt0edJPQFM+eaJguhwtetC bQQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=voq4AFbGLoJaLwILK78n9USNIr2B9fMN776ggMuIHko=; b=faDoBz/lyM9gtjBJQb6eMolVQzgOtbAV51T/AbvRirdnS4y/xzyVbJ8poNzNfHpyDi xX+uWb4Fs9MmYfXOjkMMIPYkgWxG0LCtmhI3WH3iMIym7W0RpAw3ngj2lk4nGjCgVcqp f6gcn+Tgb8bHFEd0fSJQNUc9a5BqkATicqkZcNJBobJDGsYjU8M5OYLJ7z/wkhnXI/bh b3TA/tUKfsp4XHUnowOrC5/ZNkmotxRCLkY0tH9YJGt5ykJh+vNUw0PrbWA92w8mTZDY QChavPcFmRCn0+QLkLPk+/buepbI+Gmq81LyPwCS0EJPvLmfTPguD5omrjSCtm2+6N+p QJlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=BzdLtYFZ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si520171otq.76.2020.02.27.15.51.24; Thu, 27 Feb 2020 15:51:36 -0800 (PST) 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=@broadcom.com header.s=google header.b=BzdLtYFZ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730013AbgB0Xtm (ORCPT + 99 others); Thu, 27 Feb 2020 18:49:42 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40075 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729982AbgB0Xtm (ORCPT ); Thu, 27 Feb 2020 18:49:42 -0500 Received: by mail-pf1-f194.google.com with SMTP id b185so686511pfb.7 for ; Thu, 27 Feb 2020 15:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=voq4AFbGLoJaLwILK78n9USNIr2B9fMN776ggMuIHko=; b=BzdLtYFZmrbXcvLmMVD95jbyfyAzEY2NDoGBqjx7UWbhXwZfjoPtFIPx7oeWZspHu7 mYEBjwLCg1jkXqIoOjobTJfzaocFvkLmPU3tu68hswiSJwtu3sIQBfw+mNwdeqXC0WfP 1dc0d6QTEA08H3F0ZfHJERF/S1V9ZRyDtOc2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=voq4AFbGLoJaLwILK78n9USNIr2B9fMN776ggMuIHko=; b=XjPWH0C6muk0qMmvw3cOzZNR3EQk2E763E1MTy18qdflkd7BEMxCuQi5TPG8aQ1IMB J5prP8cJLVGLDTe7NLcKI9IAsHViccNU0BvPmlbed98C5t8wjy9prIob+uOzJJ4BetGI loVNNQHt7USU6vO+wtizjAnSXikweovkSuAz/KOMDPlSnUuNVr1pereaOJa3mrd8Icc3 EKglGjJ+PseLv3Rp2Jsqet4jzQwvCiCaCD1LTukfyMJgcC6mqsiLOUXmITQV8X/98SoO N23RW3wofehjx3fPLudh5y1yjsTG9uWVu3KO/ekqWkfalw8WnWkjRB1pwvS9w8b0F/0a g/PQ== X-Gm-Message-State: APjAAAX3Izf8UayuvNVSkHQfkpAimCv4bY0pVUXO3tQEokUejS0o3KBu ZLixpxHaEzKgUlkXQpOK6OQivVzHAVWojdm0 X-Received: by 2002:a63:ed16:: with SMTP id d22mr1867585pgi.314.1582847381191; Thu, 27 Feb 2020 15:49:41 -0800 (PST) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id x190sm8640465pfb.96.2020.02.27.15.49.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Feb 2020 15:49:40 -0800 (PST) Subject: Re: [PATCH] exec: remove comparision of variable i_size of type loff_t against SIZE_MAX To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com References: <20200227233133.10383-1-scott.branden@broadcom.com> <20200227234055.GF23230@ZenIV.linux.org.uk> From: Scott Branden Message-ID: <588cad53-0099-b95a-d228-f2523774956a@broadcom.com> Date: Thu, 27 Feb 2020 15:49:38 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200227234055.GF23230@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-27 3:40 p.m., Al Viro wrote: > On Thu, Feb 27, 2020 at 03:31:33PM -0800, Scott Branden wrote: >> Remove comparision of (i_size > SIZE_MAX). >> i_size is of type loff_t and can not be great than SIZE_MAX (~(size_t)0). > include/linux/types.h:46:typedef __kernel_loff_t loff_t; > include/uapi/asm-generic/posix_types.h:88:typedef long long __kernel_loff_t; > > And boxen with size_t smaller than long long do exist. Anything > 32bit will qualify. Pick any such and check that yourself... Thanks for the immediate responses.  I'm glad I sent this patch out to understand the check is as such. Is there some attribute we can add so such issues are not reported against static analysis tools such as coverity?