Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp408983pxj; Fri, 11 Jun 2021 02:07:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt29aCU/K6352hkRptDTy720P/nJL0TE1QASvv1VYQwIvfIK8QEnOmQB1j9xXzLP/2s+5q X-Received: by 2002:a17:906:cd0e:: with SMTP id oz14mr2636340ejb.308.1623402441571; Fri, 11 Jun 2021 02:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623402441; cv=none; d=google.com; s=arc-20160816; b=YxTCl7HLPxQ+oDky4Ysghnu8fPkNqqCCS7M5ltNaicpycELMkVy7PoLTnhkcFWivVO ri2JNX12QwD6yYf967NZ/m58ddEuNzK7tsVX/kGNPZPRDRMsYKpVRracKxuaKLzPsPQO mqqxspxkDwNNFe7Rhp4RaCoErjyhACcmSzqGrEWiHNLNKMSiG6uF2UqRonz3QuP1HkZy AplOE6xWmg7H6Dq+9LmK2iAgaQ98SOnJ2Dl9/4ctRgZXjvcvNM2AkexLsA2m1g/B3Z3U qUwwWIiQJhlSGVmx8MJNGbIuHKRP9VY07QjtAg4TVUdCPT0Do1DSvnTIUo6cTKheU3Tu igwA== 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=ry2suuzXUcu07KBYOEsb0YWMddgl4sZoFMfa7hKOgms=; b=IxtcNyOnmhu+Fas9+8o4OpKgKW19nMYj2seSj4A6rboNXkMzCZhhMLR36Db26Gmx67 IMPlP0T1pahT5ulu1NhFpu0+V/IPOCzPXkNh9Am93aB7wrgJylybvxVR5fXWTLZxae6p ynA6d/kuPRPHNBXCerMF3v3cJHiP7HlXQg0Mtp4f2k9/zlQfq/2lBTEFD2wRcpDCS9MG rfpn0JuaKX+6uHqBCVTKVC18bVWJ2vCWI0aDU+RlE6Bz8CiJTsF8b+cSdhsQ651DDSwX zSFWUakcFKekLaMuUsml2K2diWb9I6hqaSiAqSQ67NOKVcmyFwl3PTGLdocsm+r17qvC QZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zP33EHoQ; 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 x25si4509003eds.477.2021.06.11.02.06.58; Fri, 11 Jun 2021 02:07:21 -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=zP33EHoQ; 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 S231309AbhFKJHb (ORCPT + 99 others); Fri, 11 Jun 2021 05:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbhFKJH2 (ORCPT ); Fri, 11 Jun 2021 05:07:28 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC61CC0617AF for ; Fri, 11 Jun 2021 02:05:30 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso8196768wmi.3 for ; Fri, 11 Jun 2021 02:05:30 -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=ry2suuzXUcu07KBYOEsb0YWMddgl4sZoFMfa7hKOgms=; b=zP33EHoQsf7qLPQMdpBdFo7t8iJNFw2h3mCHTGhZs6q/PNkWYYg6Lj7b/4oKCHxfnc PgeM5chi+Q2hdpb0PWjfcfrWfXduRDbn6SHDbUR5I5kDp5EZpJx5mC58hsnSEYi307LR RCj3W0r3b6rJDe6LZH0lOoufyqEM+UKiPVAEmHiBY1lHpwqRGcdrPktVAI+y8ZvDMQ+2 JQLootHAB320n0+/e0lXFYpv+2wOJWGGG6pbel+FSRTZSG9Cwuh2998/wEA1CPCO1PP7 nZrN/tES0u0uBGJ2bYXyhm4Rh1DSYTXg4imyqZcDbZ50jciSX6AK+TJoeffZbadQZpA7 q1Gw== 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=ry2suuzXUcu07KBYOEsb0YWMddgl4sZoFMfa7hKOgms=; b=m92A5VGWXOUShrfxvFKz3ztt9ixGSj62z7CAAWphIRXYjrezVsskvhR1CDMwx8ndoe KpfyNQfQtrka5LD3VG3NkPIYFUfpf2S7gPvsKk8lCI3Eyk9XJCZ0SMfgtwSqMw6HPyAP nlPbhkrdukCs32bxx0wkw323vGDezQuDh5gBIgNi2qRypt8525fuecgaJkXqAaTDp3L5 sF01h6Fw9LAb2HxvDQoQTzT5TavYpNlqlVzrNI9huDMKLH1mPHgnK/WFslERLhwJdf7o jPfmwuWFVcrfB2qMgPSAr2kqF8n9dyGHYhLyMG/0ch0ClPHvDDEvNN88aPL60jvHDoDR KTJQ== X-Gm-Message-State: AOAM532mCp7bk8kbFuA5GfKGdY/t9hAFtBkeGlZRv/QqZkIjljaTQHaA mB11MKgs2TJeIv5WMg4PXKM+s1TygYM6QgJHgbPutw== X-Received: by 2002:a1c:41c5:: with SMTP id o188mr19048807wma.60.1623402329133; Fri, 11 Jun 2021 02:05:29 -0700 (PDT) MIME-Version: 1.0 References: <20210610210913.536081-1-tyhicks@linux.microsoft.com> <20210610210913.536081-2-tyhicks@linux.microsoft.com> In-Reply-To: <20210610210913.536081-2-tyhicks@linux.microsoft.com> From: Jens Wiklander Date: Fri, 11 Jun 2021 11:05:18 +0200 Message-ID: Subject: Re: [PATCH v4 1/8] optee: Fix memory leak when failing to register shm pages To: Tyler Hicks Cc: Allen Pais , Sumit Garg , Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Vikas Gupta , Thirupathaiah Annapureddy , Pavel Tatashin , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , OP-TEE TrustedFirmware , linux-integrity , bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 11:09 PM Tyler Hicks wrote: > > Free the previously allocated pages when we encounter an error condition > while attempting to register the pages with the secure world. > > Fixes: a249dd200d03 ("tee: optee: Fix dynamic shm pool allocations") > Fixes: 5a769f6ff439 ("optee: Fix multi page dynamic shm pool alloc") > Signed-off-by: Tyler Hicks > --- > drivers/tee/optee/shm_pool.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) Looks good. Reviewed-by: Jens Wiklander