lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABXGCsNzsPU569w-6LFgrs9gHb=5BaZ9XJYFtZCrYcBqxvJkuQ@mail.gmail.com>
Date: Thu, 19 Dec 2024 21:25:02 +0500
From: Mikhail Gavrilov <mikhail.v.gavrilov@...il.com>
To: Fedor Pchelkin <pchelkin@...ras.ru>
Cc: Linux List Kernel Mailing <linux-kernel@...r.kernel.org>, 
	Linux regressions mailing list <regressions@...ts.linux.dev>, Christoph Hellwig <hch@....de>, Takashi Iwai <tiwai@...e.de>
Subject: Re: 6.13/regression/bisected - 133577cad6bf led to error in kernel
 log "DMA-API: snd_hda_intel 0000:03:00.1: device driver failed to check map
 error[device address=0x00000000ffff0000] [size=20480 bytes] [mapped as single]"

On Thu, Dec 19, 2024 at 7:08 PM Fedor Pchelkin <pchelkin@...ras.ru> wrote:
>
> And the error message printed indicates the exact same thing. This is the
> fragment of the dma-debug kernel code raising the observed error.
>
>         /*
>          * Drivers should use dma_mapping_error() to check the returned
>          * addresses of dma_map_single() and dma_map_page().
>          * If not, print this warning message. See Documentation/core-api/dma-api.rst.
>          */
>         if (entry->map_err_type == MAP_ERR_NOT_CHECKED) {
>                 err_printk(ref->dev, entry,
>                            "device driver failed to check map error"
>                            "[device address=0x%016llx] [size=%llu bytes] "
>                            "[mapped as %s]",
>                            ref->dev_addr, ref->size,
>                            type2name[entry->type]);
>         }
>
> That is, dma_mapping_error() is needed to update the internal state of
> dma-debug structures in case of a failure. Otherwise, it'll complain.
>
> Could you test please if the following diff avoids the error message?
>
> diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
> index 13b71069ae18..b3853583d2ae 100644
> --- a/sound/core/memalloc.c
> +++ b/sound/core/memalloc.c
> @@ -505,7 +505,7 @@ static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
>         if (!p)
>                 return NULL;
>         dmab->addr = dma_map_single(dmab->dev.dev, p, size, DMA_BIDIRECTIONAL);
> -       if (dmab->addr == DMA_MAPPING_ERROR) {
> +       if (dma_mapping_error(dmab->dev.dev, dmab->addr)) {
>                 do_free_pages(dmab->area, size, true);
>                 return NULL;
>         }
>

Thanks a lot!
The proposed patch fixed the issue.
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@...il.com>

-- 
Best Regards,
Mike Gavrilov.

Download attachment "dmesg-6.13.0-rc3-eabcdba3ad40-with-fix.zip" of type "application/zip" (50406 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ