Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2333070imm; Fri, 7 Sep 2018 14:51:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUUzYwopJ6dC+/+TRlLHjkwF79wgWgUHeQ/5q9lTF11U+ELfPV/Nn9cPL5stRHIew4LSHW X-Received: by 2002:a17:902:29e3:: with SMTP id h90-v6mr10061838plb.215.1536357063137; Fri, 07 Sep 2018 14:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536357063; cv=none; d=google.com; s=arc-20160816; b=lpTznWPKNW5Mtn8wo4+a+kvpFD1Io1TT5dxa93g2WEqlWB/EdktL+y+3AZxcNbioKa rb+skIosta065l4SamwxMn5jyv81sMOtSMPu4kstuysXwWBuBITia6A84MxqJrUcXod5 LE8bqk16GBe4GWf2kWvUnSVQFNfJ5XbY4RW8JMmc6cSQ1+L8u+NytCrduXQx0h93CBDr XOaqUnqp4sVHbR6Vz9yinuduzFTuvKc9gpkJ3tvn1gAov2B9W8PmaKiaIB+12eG/QRvM 13G3UW7EZ14psxoYome7w2E3Ucf0Uojx+V3SW0/DxVF29wQ/uAVy4nOHyBcoBVEJa3m6 S9aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from; bh=lpris73UQqpJl28vbHle86J+1OjP2I4A4nojnuYfQts=; b=VttTM4Uh4QQ6L4U2G3nRMZ2F/vKGHyT4V7cCDTNSkljaMeAvXFMsTC82Yrh7A8HF7M j4VLZnWDMCq8TVueL5A6kas2BUxKCc7ZqAL8a9flSevHEqz3HoO7hqJDRXCbUa/Ybsgq IaJZxzbkT8sZd/BhJpwZCOgU7+9zAWW+ZRcBJrpjs65upduEoq53QsXcAaK59dgu55II IsIPtk2KcC7TwFbGBy06MAbuPwAv/0/EEWajbCjjqy9fsftZZdRriO73WG/mHXc7k8+D SZdwB7d3U8P1NCGOKNWlotlRmQ2HKaBdOu+7CT9LGXxFhUXfNUX64mF2MK65CrzeNKrM qsHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 5-v6si9749104pgf.18.2018.09.07.14.50.46; Fri, 07 Sep 2018 14:51:03 -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; 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 S1729993AbeIHCbs (ORCPT + 99 others); Fri, 7 Sep 2018 22:31:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57470 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730608AbeIHC1H (ORCPT ); Fri, 7 Sep 2018 22:27:07 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 468BA100B; Fri, 7 Sep 2018 21:44:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Eric W. Biederman" Subject: [PATCH 3.18 20/29] userns; Correct the comment in map_write Date: Fri, 7 Sep 2018 23:10:41 +0200 Message-Id: <20180907210910.914702875@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210909.523240901@linuxfoundation.org> References: <20180907210909.523240901@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric W. Biederman commit 36476beac4f8ca9dc7722790b2e8ef0e8e51034e upstream. It is important that all maps are less than PAGE_SIZE or else setting the last byte of the buffer to '0' could write off the end of the allocated storage. Correct the misleading comment. Signed-off-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman --- kernel/user_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -643,7 +643,7 @@ static ssize_t map_write(struct file *fi if (!page) goto out; - /* Only allow <= page size writes at the beginning of the file */ + /* Only allow < page size writes at the beginning of the file */ ret = -EINVAL; if ((*ppos != 0) || (count >= PAGE_SIZE)) goto out;