Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp593547imm; Fri, 22 Jun 2018 01:50:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIeCcAcuiefVT2uUnKFVpt48WoIUbRgaHxehyK8Dh8KQ8DxjTQZHEnx39flvYCf6/2AdDuL X-Received: by 2002:a65:4841:: with SMTP id i1-v6mr593215pgs.75.1529657443977; Fri, 22 Jun 2018 01:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529657443; cv=none; d=google.com; s=arc-20160816; b=AEGKpB33nrprVZUT7muFeucmBX7uN/tpRi0jN7sN7q3968N00AWV2LtP0WeJr7a+4k +BiAeeLelIniBAFAB0HHLE5tA/KJ+0kUcmGNOx/yOqLHd+jB7a0oCmR55WB9RafQM22r /O9g9Jtxz01SXtqWrkvFUYJtJ8AfLmkrQTp4KpRgYsz7qldzb0aPmaKOPznkyFxHX4HY DtxQmRSa1oPc4OoeHJANAyKDtvGKFXIkCP3xmyT2+peWExnpfcC2RuWk3a88EngOyyC2 RtbLRlHYZYYJRPig75VGrtnEh/PgWt8hc+/NVV3ms5DRjLw8DJQew+hFpmZyobAqCgep mU9A== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=TYZ0sHkkriaPb0Nz7y/VYBcI9cTCYncUNwoFDQK8/Eg=; b=rryqKf9JnUo+aKDN34S1FxsblqlAMLAH8trt24vtxFBdX2c9ZhvmKfSdtdzavl62tC pJJfhzDTkH3LP14lHBB3tieKQLSwRkIcaG6mMDPOc5r4wSm8OXLTMQZH8jEu2JwnEvaU 0HqdEl7js7U7RAZcvjjO2N1aq1NKpieSk4Z3X54djh+WIPK+gF+2gaUs0e76wgHNc6t8 zyreTZhmFOteRWgfH2sHwnduhP6mHj3WQeUaxQbUKD+SJD4mtQVOIZF0xbjnZlNDZYbf umU19is7aBsb5umxGxcIpSE9AjE+jpdPh04RSEuutvf2FTaPUUzRatgU0FRq/Ki8gP2g kKvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=lZl4cjE9; 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=NONE sp=NONE dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12-v6si6800077plt.209.2018.06.22.01.50.29; Fri, 22 Jun 2018 01:50:43 -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=@android.com header.s=20161025 header.b=lZl4cjE9; 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=NONE sp=NONE dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbeFVIs7 (ORCPT + 99 others); Fri, 22 Jun 2018 04:48:59 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:35903 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbeFVIs5 (ORCPT ); Fri, 22 Jun 2018 04:48:57 -0400 Received: by mail-it0-f67.google.com with SMTP id j135-v6so1919133itj.1 for ; Fri, 22 Jun 2018 01:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TYZ0sHkkriaPb0Nz7y/VYBcI9cTCYncUNwoFDQK8/Eg=; b=lZl4cjE9QPDzcCLltck/YCvYnMs1hOL6IiNC7OLMaGo/78tkZwJiKfnGxILnGSfonL jir7pPwv7RgXwfl257rR+IElchuLMtA45+CgHkJ6y8qfcQPFD9R8p4lTZi09WNr8i1Cy t0hWl/7xww+WE+qZieOL7SFw4wcROqadM9n2soC/OcibNGF7fjiTwpFqVAidg7zYEpBc S6tnPuF6JP0bWerLE62U0wWO/raAdcoqx9sOMCTe/5uzUYm5p0gmxh2vzAKN3A89Ds5N Helb45WAfbidBvCdMJbp0bFl2cnMq8KxHjrQO/CYOCYK8f24SS54leS2j5LWfLReGt69 vgFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TYZ0sHkkriaPb0Nz7y/VYBcI9cTCYncUNwoFDQK8/Eg=; b=NeL2pxU1DXTHWztRPjrzO2va9XKB/nKBgfd7q7PO/h47sVfj4Hv4OwjfWIkc5q8EcY /Y4N3B8gow/i1K/Sd3oC/0xVm3gW9C/ZvfdHpZhHjTJUcIDrt8T+Hx9dyPf7l9PwQZ7c itVWlZWMhcqATvSufYrOZ6L7cxEsLAuec3muZFzKBnSUmev3XSCv70P06LLELp7eybDR 0XFnv5F6O5l4gQx8QXUCKoVWXG/z9vkFJOZ4UZgoeuJOZ93HUbfGOp6ZjEllDrkaUKCx TMPSWL5Pi5FS4m5obu0WuQXCIityVzvb9qR8ODvNJbgayNCbhLzIE9Ha4AYE/dG1jeZr uzPg== X-Gm-Message-State: APt69E2n/Nv2uqxgQwXY3ie8HFIt9gA25z0oHC+kfEjgQFl19B6M6Lyu MNsFxUDwGTRhXtOj7hIPgDqAhesD1HU//9vzENjlKg== X-Received: by 2002:a24:7a4b:: with SMTP id a72-v6mr748450itc.123.1529657336721; Fri, 22 Jun 2018 01:48:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:4642:0:0:0:0:0 with HTTP; Fri, 22 Jun 2018 01:48:56 -0700 (PDT) In-Reply-To: <20180620232937.GA177510@joelaf.mtv.corp.google.com> References: <20180620005735.219840-1-astrachan@google.com> <20180620005735.219840-2-astrachan@google.com> <20180620043200.GA10888@joelaf.mtv.corp.google.com> <20180620232937.GA177510@joelaf.mtv.corp.google.com> From: Martijn Coenen Date: Fri, 22 Jun 2018 10:48:56 +0200 Message-ID: Subject: Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation To: Joel Fernandes Cc: Daniel Colascione , Alistair Strachan , LKML , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , "open list:ANDROID DRIVERS" , kernel-team@android.com 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 Thu, Jun 21, 2018 at 1:29 AM, Joel Fernandes wrote: > Also if you look at the kernel sources, there are dozens of drivers that > check for correct VMA size in mmap handler and fail if it isn't sized > correctly. If that's the case, we should definitely do it this way for ashmem as well. Since its size is fixed after creation, preventing anyone from mapping a larger size seems reasonable to me. Reviewed-by: Martijn Coenen > > thanks! > > - Joel >