Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2091392pxy; Mon, 2 Aug 2021 19:19:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq7CoQ3Rwd9DL81QMQarWQNBc5mRItfsbIkLoYKM+nZFT1MVQiIQcq7/4A3rYXPjAp5sZ0 X-Received: by 2002:a92:b108:: with SMTP id t8mr4982ilh.6.1627957172755; Mon, 02 Aug 2021 19:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627957172; cv=none; d=google.com; s=arc-20160816; b=K2nsGQpVsKUFAmohsx6hKQRmij9QmmuelpZm04ulMQlNspwlE8kt2B43Awmx8iys79 bdp31wOmG4KfVGCE9USWTu0jZNGG4E37kwSxV3nzh/K4BT+Qf7P6GuHoF2A+1CBxTZLe mVkqDZWmBZryHlHohTXhMZMemjo2vL7abu8NZyTySgXT/0SVcn1my6DmAq4gZsiiCifY rXyUnnIRSWMPwoFCxt0J+7PP2Ji8uMypZ1fEgnNiZ3j87TQptSon5uuVjXpn1MlePhno MwU24IoBjDzMvLSq8+wenRFge/Q7QJ4JcX4gvK1ux4xgrsbpjJ1DozUO9/4EIHpyYPjp zr1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=p0Rg8uoQAdCMqNvWG4KJ4Lml0OYquOl0PzeY+NghgIs=; b=z740daI46G2FMlFClSskY5I+9DQl7FP8gyyL2OgB9sDyrrq1SCrCF/kUfKmRY35rpY Xneql3dw/abMoMcbc8Yz5w9Tr1mQ01mfM6LhwJr2nphv7VeuM9Kdb8BwWUgw27/6HWqx YNuXASKOI8ZcolLNA9OnOXjw9rZ4NUTxZ0ItLYh3OuxqXRylu//EKxGJjiwKY3hdJNyA zQxOrYvX3M6PgCvi9vQzwhuJ6d/s6jW4X+SSLgBwZ+TA6fQoli3j1UqStxxBhfUNe0v7 aiicGmAC/M1Exe4V/wD4shz4fOIrtPPblFrIuvgjntQaMbyq47a6xkWMTLCcOnh86qSq bJuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJeSRXes; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i16si12177462jan.31.2021.08.02.19.19.14; Mon, 02 Aug 2021 19:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJeSRXes; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233602AbhHCCSd (ORCPT + 99 others); Mon, 2 Aug 2021 22:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233200AbhHCCSd (ORCPT ); Mon, 2 Aug 2021 22:18:33 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6536C061764 for ; Mon, 2 Aug 2021 19:18:22 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id z2so37225016lft.1 for ; Mon, 02 Aug 2021 19:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p0Rg8uoQAdCMqNvWG4KJ4Lml0OYquOl0PzeY+NghgIs=; b=rJeSRXesNgqD/ctsEcHci3GJIr+ZkXbWSPIKY0cGUASov47tyDQAO5lBimd0asmIsL +4rmPRHpsXvlmc0U/W2TuK9bg1MhTeOs7bo8xF8pbSMAURvWUezdYoi0kluk8bQwRucC sVI0o4Nkcozxs0qQcniS007Mw17HutvMJYPWo5XFmdPmurdTI4nsoUb6cEW5QHA4gsJ4 MY2BCxRTcVYUddEibbqdE6MT3YsNNPvMNUJ4G0z+qJSPoRFIEO4PXKaGHgQ81CJhLojN HoAJQ0Sf6F0cfaImhnZg544kzLmUxPDV3XS8Ilm6pjvOYyzbU5onvpQy6uTTI+FiM5Jk 1R8g== 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=p0Rg8uoQAdCMqNvWG4KJ4Lml0OYquOl0PzeY+NghgIs=; b=nOrAiONDJWapNYDcZVBmt2yKgNlixnjIWEINvgr/Qb7rAgi/NExALSA6r0Big66Tvf 3cmZ4HrtVfuDFQo+ZYMF4GOtrWZe57Nt2zmc9LrML22k8JJatiJ7k3yb22m1SvIVy9rq 08kghdO3617+IBa2dsFPqYMGbaLoOuTtN3BUSHTcURg2tO/o37lVOAAtiJtk2wYE2GK/ BEwUtGyT4QfSEChnwVpzMtVYu6cn/Rz2UlN9mfbzxD2jiTy9H3v+3mfy/S+8nilyEXLi Sg/7qTdLjZipMMxzYLsvQfDeKRfQ5xH8kLpM2lai91MB6ZBYKOEcrQ2ZwxnrYPtLCPOL +LFw== X-Gm-Message-State: AOAM531Cx0PHfqUNAsa3koaE8y/RaJep621fcF7lT168BILFpDfSvVR5 QnY2MCH1FtnvGlufS4gZE7Za9lkmzHO1Y9hbBfAP9A== X-Received: by 2002:a19:c10a:: with SMTP id r10mr14608548lff.508.1627957101180; Mon, 02 Aug 2021 19:18:21 -0700 (PDT) MIME-Version: 1.0 References: <20210722190747.1986614-1-hridya@google.com> In-Reply-To: <20210722190747.1986614-1-hridya@google.com> From: John Stultz Date: Mon, 2 Aug 2021 19:18:09 -0700 Message-ID: Subject: Re: [PATCH] dma-buf: heaps: Set allocation limit for system heap To: Hridya Valsaraju Cc: Sumit Semwal , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , =?UTF-8?Q?Christian_K=C3=B6nig?= , linux-media , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , lkml , Android Kernel Team , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 22, 2021 at 12:07 PM Hridya Valsaraju wrote: > This patch limits the size of total memory that can be requested in a > single allocation from the system heap. This would prevent a > buggy/malicious client from depleting system memory by requesting for an > extremely large allocation which might destabilize the system. > > The limit is set to half the size of the device's total RAM which is the > same as what was set by the deprecated ION system heap. > > Signed-off-by: Hridya Valsaraju Seems sane to me, unless folks have better suggestions for allocation limits. Reviewed-by: John Stultz thanks -john