Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1246839lfc; Wed, 1 Jun 2022 12:59:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMnaGALZurXMqd8ZK/4fnCA2D19zFOOVdDosmp0o2wyXZ2G0lfb1g0gQjvvWI8iMptyts3 X-Received: by 2002:a63:5d4a:0:b0:3fb:fa23:735a with SMTP id o10-20020a635d4a000000b003fbfa23735amr933048pgm.44.1654113597938; Wed, 01 Jun 2022 12:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113597; cv=none; d=google.com; s=arc-20160816; b=WsL58qbhdcPbuBie7mablJLuZ+9vr6jUGgFs1UCoO/pnetkBDYiFMUGswJnvFLnCIY g2ODIgloXMcF4iw5ArnIwGLb0Ni59JWYEmQ1hEcnDIkC4z+nGPiXZu/WE44E132mrqfs HWtBgrhtcibRjLkzaGTRpkqv5LubXip7A+dSY2ZhhhDcBa0DrGJUIgrCA9YmY3j4fF/l Rb8vmmBfCLFsatgmx1eV8V+edWVuZdzDOt160PnF6R+Yl+ZuOv9GnFij8ulxAWEnFHkK +KLDOYfSYatOJRTc52ccOHep0SO4QteOHRumYV9SId2augOlAhqnnbLN07Z8yQNxNFGm p9Ig== 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=aXbvOx8jAYGA02JcDd8YOIl9eUJrNMJMlFx/ii0oNuQ=; b=WFGX77gh7W0UJXL4f7Mb4vUOk+kT/gRiH9QIO5btxh6tpFBHo4qBmLs5fQSUSXx1xi +uPXiDbM/5a4WeE7/FvxsuwuMI+w4MwMxpXJNIyEpSM3B1mHUoWg8QR/miW01hp7guwB DRV5o9B15J3lkgZCjSajNs+sThBTyWs2WRGD1EavFuwi+5CLfryL5ODyKQttXm0gmCcH D8hr2pxparBpTpdHpe2VopGhTDPrzKvHtCywPnYkhbgGIIN1qqIFU+igcXw9y5aUuQHY Ra275tQ0eMPrxH8mA8zuhwnhyjYm74BPuDLzbvjrZzmV950ltZQ4CycZv/iPCiy+6Gkf jj2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jJFyM7WW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l7-20020a654487000000b003fbeb81bbe9si3260536pgq.288.2022.06.01.12.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:59:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jJFyM7WW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD88721CBF4; Wed, 1 Jun 2022 12:18:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244077AbiEaFpr (ORCPT + 99 others); Tue, 31 May 2022 01:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237081AbiEaFpo (ORCPT ); Tue, 31 May 2022 01:45:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D11C82176 for ; Mon, 30 May 2022 22:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aXbvOx8jAYGA02JcDd8YOIl9eUJrNMJMlFx/ii0oNuQ=; b=jJFyM7WWZHhGufuYtF8xFUisy4 vf56HOF5FnN9fnDmojXdWNTJDth7FAXmzGt2ZiGNaebxZtsKq3FJVntJfqVWRRKQkATiVJXUzgsNt TRmcq8358eXvxv++E4cJfmApY8a1KpPcakKiyBqVlEXLH0IDXOP7tBudyAz2yhINjtNsNgYbl0qfr 3/+ErzBdAiBtc/SOWGJMiGFMaSUTKubkXm/aw8PHn4MhoHCbPKgZFAgV25GQcdN7P2DNSzEIT1J2e SYg2x5pwtAG7swl35WlxOOauKeTZtVEfGvAVcp6PNysZlFnGgITuukX6WqeLQBUig4MtSku36IRWM XCGWwIMQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvuhC-009Pcg-5Y; Tue, 31 May 2022 05:45:34 +0000 Date: Mon, 30 May 2022 22:45:34 -0700 From: Christoph Hellwig To: Dan Carpenter Cc: Hillf Danton , syzbot , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] WARNING in dma_map_sgtable (2) Message-ID: References: <00000000000011e14605e03a125d@google.com> <20220530144542.4382-1-hdanton@sina.com> <20220530151044.GQ2146@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220530151044.GQ2146@kadam> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Someohow only the reply from Dan got delivered to me, not the mail from Hillf he is replying to, so I'm abusing that to reply to the previous mail.. On Mon, May 30, 2022 at 06:10:44PM +0300, Dan Carpenter wrote: > > --- y/drivers/dma-buf/udmabuf.c > > +++ u/drivers/dma-buf/udmabuf.c > > @@ -273,6 +273,14 @@ static long udmabuf_create(struct miscde > > if (IS_ERR(buf)) { > > ret = PTR_ERR(buf); > > goto err; > > + } else { > > + struct device *dev = ubuf->device->this_device; > > + > > + if (!dev->dma_mask) { > > + ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64)); > > + if (ret) > > + goto err; > > + } > > } This is compeltely broken. If the underlying device is ot DMA capable and we can't just set a random mask and still allow DMA mappings.