Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5237782imm; Fri, 18 May 2018 20:34:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZraQ6qjeQmc0iz78VH80cQRxzL8i4vprQQBH9WJQxrFrjQB3i/mlSiA2ZqHuBW4hfj/OlZH X-Received: by 2002:a62:f58b:: with SMTP id b11-v6mr11870993pfm.113.1526700868351; Fri, 18 May 2018 20:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526700868; cv=none; d=google.com; s=arc-20160816; b=bUfIaCxyaI6ktFVNbGVdzaEqAQyqEKTMdec+w3IQa4moawQOqyQ1ddoADmmwRWxtPC OoLIdPPw3Gi60B3OKl9RZik0DiBkv67jPk9FUtVgxwI+wdQV8fZjP4YGKm0MrnIDgUPY M6njGYMOjVy5DgzpAcnKDSVx5iTiHSziMe50Z2k2gMY6iWq1q2JjmnndpITZASJJaN8+ F/cPzYWXw8i7CHv0DlFEvTwyfqcdZBbn1sLsFtJVqy4z7GGvDE3VCVtrwew4KNxe0unc OXytw2K8WEiNVTHdTUXGPZPg2J0pkDEzTN2QpydqJVn72Bv8gqjyJ0ox7bVUod3TzfJ2 7K1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Qcb5CLLul7bJzKDOVYUhxvAbnjhRKSIop2BzTZ7gp6c=; b=cOunLvrQ5g+Vim/twSSMmxkOw0OzRNZ7rI+oKkqBkaLgtrSEppWdven22VmUKZgoAy dLhKL0dWk3xcDTSX44drzr3pikP4Ygi986wfZIcQ3BzxGu6XW7DBosKEayh1h3A8wcuL D+cxVq8Bqk8+A8HOh2O5AoScMgR6ErClQ+d2zy4Y6br+X3aCRpWI+xzzsh86tWVETnru mBao+n79Wp24ei2vMDXi1suePQNPmvYvcOvyG0TEpcmFWiVTJKf5Tzl5LMf44UIzQgen IneR2OUMa7LN9AbanI7bv9Mq/g0qx0UfD4OaIIMidPRSrYW98AzOCrIz+eWiwGj6MDZB 8bjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=geLM5BlA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19-v6si3023892pgo.539.2018.05.18.20.34.00; Fri, 18 May 2018 20:34:28 -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=@linux-foundation.org header.s=google header.b=geLM5BlA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbeESDdv (ORCPT + 99 others); Fri, 18 May 2018 23:33:51 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:37274 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbeESDdt (ORCPT ); Fri, 18 May 2018 23:33:49 -0400 Received: by mail-it0-f67.google.com with SMTP id 70-v6so15541610ity.2 for ; Fri, 18 May 2018 20:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qcb5CLLul7bJzKDOVYUhxvAbnjhRKSIop2BzTZ7gp6c=; b=geLM5BlAJQxR3ZjjjN7GMW3B66cX5oHAZ8eQBQGiPls1Olea7vo+U4qMWejuXtBVIc rw5398VbwhyE2rEU8YQUZlL7FiVZxP4OXEL6UQu+qS0EBC01UVWgiwBi4rRdKzGyLmzE BPXOl9rY+TXWTV2BHTk4DDmUqruYD3fQK/Vj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qcb5CLLul7bJzKDOVYUhxvAbnjhRKSIop2BzTZ7gp6c=; b=E6XW/ZfieyYlT01uPY6G8xt6jvyQkiVexB1IBXg9ttByHkpbRocBtOllj8b4atRwak +k/pKB58/+C+LZ03Bd8tK6NsKnvXhuii9Zamk1pDLiFknvPOgvZTxu3bcEa1RiAn3Tr5 DM3ZVNGxh1TG/HdMbGq7fCsv0Q7xPM7DVQaisOQQhrcW9ok/ARhrcPBsrqx8hbIPXWhV jPE6F/rJcsMycdC5daK46ucLYeP+kqU/eezVEgaGsM2RCUxLQi1wiE2/r7130P/TfGiC NlBaR5ylzvAsCTtHdwcxSqgzlGPqSThhcBa9zOzevMHQedpdo8w7nQaPM8nQFhmyh5zT F7Jw== X-Gm-Message-State: ALKqPwdwrSn6KyEDZzs/jzR107yO2eODdu2Y1DIc3llpn562ke0u8zVl Au4uwNDr576nHMZzT0cQ0cvF6RuquT1HczggtqBUaUD0 X-Received: by 2002:a24:c408:: with SMTP id v8-v6mr9652692itf.100.1526700828610; Fri, 18 May 2018 20:33:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Fri, 18 May 2018 20:33:37 -0700 Message-ID: Subject: Re: [PATCH] procfs: fix mmap() for /proc/vmcore To: gor@linux.ibm.com Cc: Andrew Morton , Al Viro , Linux Kernel Mailing List , Heiko Carstens Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 18, 2018 at 8:20 PM Linus Torvalds < torvalds@linux-foundation.org> wrote: > I'd *much* rather just set FMODE_UNSIGNED_OFFSET for /proc/vmcore _only_, > rather than open up all proc files to issues with 4G+ offsets. Hmm. I was going to point to the s_maxbytes check in rw_verify_area() and ask you how that ever worked for that file, but it's not there, the s_maxbyte checks are only in lseek and in do_splice(). So apparently we protect against llseek + read/write, but we don't protect against pread64/pwrite64 having offset overflows.. That's crazy. That makes all the s_maxbytes protection much less effective than it should be. Filesystems that don't get the 64-bit case right will screw up pread64 and friends. Al, I'm missing something. Did we always have this gaping hole where we didn't actually check s_maxbytes against read/write, only generic_file_llseek? Apparently. Linus