Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2010576imm; Tue, 10 Jul 2018 11:32:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeA3UJqVFeoSGD3EdAT2UGyOIJcq8RVq/I7uTiYC3bcE19dBbFUL85v8P08ANd49992ZDpg X-Received: by 2002:a65:4b87:: with SMTP id t7-v6mr18995312pgq.391.1531247568897; Tue, 10 Jul 2018 11:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531247568; cv=none; d=google.com; s=arc-20160816; b=l7V7P+sI+GOvw4OOyhrNVNKGGSePVQr2lYkvhR1BlZqotVtUTZhvzwU7uAVGTN9Kie fZgiG0GI3IYfAJ+/Qa2vxzYukb7Cs968dczD12mCfniypNWKSLLMiIUimng1550kw1CE XoDOWh/FATimVfblihUbhr6nApCp9O+o8mtKIVvtCzrMTXXZWS0T7bc6/c7JQZKcqsqq XIoOloPlBLO1VIeWi/qJr75l7IJLmlAZ0AIuys2K9adyENu9swd97aQQuK6eOAJ9kWV1 zzJRdTKLLU08XOgQ70313pmKn01O3yTDlCx2aYs0AN7edMhidQuovxdLbmVIB77HKlln jlQA== 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 :arc-authentication-results; bh=8fsF3fVxSES1/fEd1yskwliZZeBlSylJUaf77sBJvgM=; b=CJ/8kGQDWUSJsWJRt9ehJpXhB1wly6mWvVWX4EvRHZDZYRWVMqd4DIcn3ruPH/qRLU Eg4WFh3JAK/i28GrTEpXCyMxIDgskuBFH8VOLtH/xDn+7T5ZwUVK7EKuPcPmwHkWeebA WhbEDC3Z8XCmvHQge7bQckpUXOxmRrnx34vhxm+hilKAxWroD2EvC4sJ8rus3mXcvJtJ L58gH+PTb8+vx2b85Kvld5nlRSceuEsj9fVwHqcGTmppQF40m0XXYHDPL8rxbnABS1U7 X30UUQVrF22cm2joz38tiMsNqb3XLlLnAz+BKgcffsUsVx9sZ/NS8rRhDsSUnqkTgtnW +51A== 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 bb5-v6si882318plb.480.2018.07.10.11.32.33; Tue, 10 Jul 2018 11:32:48 -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 S2388165AbeGJSaq (ORCPT + 99 others); Tue, 10 Jul 2018 14:30:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45632 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733214AbeGJSap (ORCPT ); Tue, 10 Jul 2018 14:30:45 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 86265EB4; Tue, 10 Jul 2018 18:30:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+55b1d9f811650de944c6@syzkaller.appspotmail.com, Laura Abbott Subject: [PATCH 4.9 07/52] staging: android: ion: Return an ERR_PTR in ion_map_kernel Date: Tue, 10 Jul 2018 20:24:35 +0200 Message-Id: <20180710182449.935992529@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180710182449.285532226@linuxfoundation.org> References: <20180710182449.285532226@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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laura Abbott commit 0a2bc00341dcfcc793c0dbf4f8d43adf60458b05 upstream. The expected return value from ion_map_kernel is an ERR_PTR. The error path for a vmalloc failure currently just returns NULL, triggering a warning in ion_buffer_kmap_get. Encode the vmalloc failure as an ERR_PTR. Reported-by: syzbot+55b1d9f811650de944c6@syzkaller.appspotmail.com Signed-off-by: Laura Abbott Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/ion/ion_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -38,7 +38,7 @@ void *ion_heap_map_kernel(struct ion_hea struct page **tmp = pages; if (!pages) - return NULL; + return ERR_PTR(-ENOMEM); if (buffer->flags & ION_FLAG_CACHED) pgprot = PAGE_KERNEL;