Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp36976ybf; Thu, 27 Feb 2020 15:32:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzobNmaLacMbdLjsrOh3lBY+wvR1NqjRrknBUvY9KDoWUTTR2ibHm65TUkY3taA+nFbpIxM X-Received: by 2002:aca:1c09:: with SMTP id c9mr1165247oic.85.1582846334637; Thu, 27 Feb 2020 15:32:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582846334; cv=none; d=google.com; s=arc-20160816; b=VnlHBy0TFFdr30bYLMLlnFCjctxIi4rALZCHPhYZYtyK+x3KkcI/JdSL7tTJ+xgn/f AShmLUjvw1YmbiXeyrmkcOHbXjeSuLPUrh/rOK31z8PUFh9IFqn8pVG/REq/92NUonM3 euLWp/5ucG42IPWRw9BxyKfZthfmkb1mIAjMt3gmy1mqLd1aJqrgKY3w9H0Y8jKock48 6fz2TpdzJaG7Q5WQT73bK/dhLoREfyUQyryoSEE23xVewACctejrl9JiPgwBXGaNmiIH 7slaml8pn5ZuW/7AAkJfFvqhFnrBp4fN8Z9zgbqa8akHLt86wXCdwjFJj7jCeR745c9s pkuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=vTq1zaq3w8Ey6IwphJFu7diB+CHCXa5rJo8d7um3eyc=; b=X5GTGjVq6qLbRF2PNKf7fU5h83AlzL/x4tQvT61f/U3BprE8eJRekIbw3mlBp2tAL/ ToiOuxw8vWUaV27THAmFHKhEvZLV+OEr2hUUhRYJ4hR3ScVB99/QAXxDtakLuqV5MEOM yarpoMEcKW1dtTcynPMxwgBUJEFSwsyYO5py6OembnwQQFQOVQQwComQzAfz5XoZ4KeV defg4hqOb83s9/owy/PwdrFsak1GEzwKQbxOtttJvWMWFcNF8lQWdbNdw+HKuOYS3cyE HyuLkznjVX/Zkdlw+nh5D6k+iCoQvE0hUum4q+R6vMWUFdx9kcainBwQbCFwatdBDsZf RSZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=bCPsH6yE; 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 l4si776898oib.170.2020.02.27.15.32.01; Thu, 27 Feb 2020 15:32:14 -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=bCPsH6yE; 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 S1729838AbgB0Xbq (ORCPT + 99 others); Thu, 27 Feb 2020 18:31:46 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:36580 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbgB0Xbq (ORCPT ); Thu, 27 Feb 2020 18:31:46 -0500 Received: by mail-pj1-f66.google.com with SMTP id gv17so460595pjb.1 for ; Thu, 27 Feb 2020 15:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=vTq1zaq3w8Ey6IwphJFu7diB+CHCXa5rJo8d7um3eyc=; b=bCPsH6yEV8hJb/Ba4aHx8v1uGGmP02xuAjwb//xfBW6ZzW/wROl8Exi/EqQRUIGIaM yLJbkdDCS6AruH8qOLFd+4NhLYC7IBZCOt/NaGUE8TnXztnq8HHfS4a2HD0zNDa0QNax RZ+0D8OY/3StZCHhuEgIpXCh+/Q9jtDL4VVD4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vTq1zaq3w8Ey6IwphJFu7diB+CHCXa5rJo8d7um3eyc=; b=FquwQPQ1jHT3nxicgMtcJJ2ESiXKMRbrPNXdj+XgQQnYvlhoExeGzl0vEa6LCkGRWz zkwswY7ZGZXY4jMywm8ZkjfwtbK+k4/wehgXJEqci2gD2BzYWcIpI6sn7gEeD1JkQ8/S BYvzlLUr257hWhyQIn2djp/FqUuM9cln6KUeAjHEnnJqYnwL7MskZcmnO2BbdnNY3U9w Pek4dcRKkAI2SpSA2B4Jp3UnTZfFeTaPntD6v8YJNF4WevPaIEAdRsu8QQpfltHK12l2 goLgDZ4Ir0P7T68qiPcD5Q5qoeEA587lXFBxGZ/5av67j+ZcYaAdO2NKvfT6Z+QZymhX Gbwg== X-Gm-Message-State: APjAAAXqQUhfBoKTSkcPlvsDmOsUX4ljLTdNT6Nbm6S2wrBNSiC4yLWa EjqbbikfTFGV6GoC/qXO4/gSJA== X-Received: by 2002:a17:902:9a08:: with SMTP id v8mr1094642plp.251.1582846305185; Thu, 27 Feb 2020 15:31:45 -0800 (PST) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id d69sm9223820pfd.72.2020.02.27.15.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 15:31:44 -0800 (PST) From: Scott Branden To: Alexander Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Scott Branden Subject: [PATCH] exec: remove comparision of variable i_size of type loff_t against SIZE_MAX Date: Thu, 27 Feb 2020 15:31:33 -0800 Message-Id: <20200227233133.10383-1-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Signed-off-by: Scott Branden --- fs/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exec.c b/fs/exec.c index db17be51b112..16c229752f74 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -919,7 +919,7 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size, ret = -EINVAL; goto out; } - if (i_size > SIZE_MAX || (max_size > 0 && i_size > max_size)) { + if (max_size > 0 && i_size > max_size) { ret = -EFBIG; goto out; } -- 2.17.1