Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp401132pxt; Thu, 12 Aug 2021 00:47:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNZxzJn+bA2RAi6wj4EiT/ST5cLzblccBqMYozoftlyaqBmpB5kTYRum07EUjdaJVkhBvk X-Received: by 2002:a17:906:ced1:: with SMTP id si17mr2330133ejb.506.1628754445479; Thu, 12 Aug 2021 00:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628754445; cv=none; d=google.com; s=arc-20160816; b=QhlD8EBJLTHu+V8tYeKQDg2G/9yKkxMtKEbmAuOJMbNQQcCnSSY9lXYQKEO118xtEO zcWj9txTLA1jTbfcAK25RLyR7N+QW8OXPp5e14xDIvVqhvW+jNL9I1rCF254pvelNgYx 0xT5ZPMIhUU2J61khfKGi5GdY1Nv2KVgKFIxXPyBEg/c8dpVlYcAqNIXlBohDcubboFC fpJE3yDbUwYZ3QFNOpqX8mNxNBdAlaFlr4+RcSYFs46jS22W2XtdFcxCDnnjhzkVSc7y +L4C6hU5IYrVX3A/kn7ejhd9AZzZtzff4slzObFzi5RTGg7MYP5lrZxV00VfEXIW9nC+ 0fdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6f58TOtWer368hRYhnkXwLD6FguP4+evhzIoFM/JA6Q=; b=QpryVl7+LaBMNsIT4yAUvx/1W/LOrwnq4ZIMIHA2481Qj9NZzfybJDzXzHgcPJoQzb L7eEANwc7+pxL4Qw14CC71iZBhn5Xdcw3cPtFSCHQxqOrsdmTyT+4XMVXDPrl45FMMcv zWQm8p28NO9Kc6+LKVyVLUzSFC1E/SJJewBKykjHcJ3IcSMyZGqd7HX37ySWfTtoGDei GRoLxex/no+7mlDyTELY8PrO5XsPLodLTMJ/Ipb+suS9ssf2/g15CqMOzncRZUMADu5x Cp3dfOv4G2hOSC2hykMk3BxtPSKBfpKfgCM/5wXH9IlfgDlmpMcW2p1WhRmZiVeizvYe 8HiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RI74fKhj; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si1811374edc.299.2021.08.12.00.47.02; Thu, 12 Aug 2021 00:47:25 -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=@redhat.com header.s=mimecast20190719 header.b=RI74fKhj; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234366AbhHLHcu (ORCPT + 99 others); Thu, 12 Aug 2021 03:32:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20825 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234315AbhHLHcq (ORCPT ); Thu, 12 Aug 2021 03:32:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628753541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6f58TOtWer368hRYhnkXwLD6FguP4+evhzIoFM/JA6Q=; b=RI74fKhj/KUNTJgyKwADRoeRUTJP2P5xDqMgEe051G7Q1gVW56iybIzLwjcyIle6fLAX4B ftfM+aVSJxdU0aWCmSSMIRZj/uLxc+//ENgbWZUA76dH8AEIRULz5LNK/KeuPHiYOO96HA fFEzB1VRNR4BSAvU+52736goH45ZJb4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-Hu38IQyYM4ev8s7frURskQ-1; Thu, 12 Aug 2021 03:32:17 -0400 X-MC-Unique: Hu38IQyYM4ev8s7frURskQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 23F558799E0; Thu, 12 Aug 2021 07:32:16 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F3616A05F; Thu, 12 Aug 2021 07:32:15 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 088651800922; Thu, 12 Aug 2021 09:32:14 +0200 (CEST) Date: Thu, 12 Aug 2021 09:32:14 +0200 From: Gerd Hoffmann To: Pavel Skripkin Cc: sumit.semwal@linaro.org, christian.koenig@amd.com, dongwon.kim@intel.com, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, syzbot+e9cd3122a37c5d6c51e8@syzkaller.appspotmail.com Subject: Re: [PATCH next] udmabuf: fix general protection fault in udmabuf_create Message-ID: <20210812073214.xwflqw7c6cpt3n7p@sirius.home.kraxel.org> References: <20210811175052.21254-1-paskripkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210811175052.21254-1-paskripkin@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 08:50:52PM +0300, Pavel Skripkin wrote: > Syzbot reported general protection fault in udmabuf_create. The problem > was in wrong error handling. > > In commit 16c243e99d33 ("udmabuf: Add support for mapping hugepages (v4)") > shmem_read_mapping_page() call was replaced with find_get_page_flags(), > but find_get_page_flags() returns NULL on failure instead PTR_ERR(). > > Wrong error checking was causing GPF in get_page(), since passed page > was equal to NULL. Fix it by changing if (IS_ER(!hpage)) to if (!hpage) > > Reported-by: syzbot+e9cd3122a37c5d6c51e8@syzkaller.appspotmail.com > Fixes: 16c243e99d33 ("udmabuf: Add support for mapping hugepages (v4)") > Signed-off-by: Pavel Skripkin Pushed to drm-misc-next. thanks, Gerd