From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC3E9C433EF for ; Tue, 31 May 2022 05:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244081AbiEaFpr (ORCPT ); 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 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.