All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH] arm: dma-mapping: fix potential endless loop in __dma_page_dev_to_cpu()
Date: Wed, 9 Aug 2023 19:05:04 +0200	[thread overview]
Message-ID: <ab061a6b-2aeb-fb62-3dd0-a20059ff10ac@samsung.com> (raw)
In-Reply-To: <ZNEagJ6rVDwBKUdr@casper.infradead.org>

Hi,

On 07.08.2023 18:23, Matthew Wilcox wrote:
> On Mon, Aug 07, 2023 at 05:26:57PM +0200, Marek Szyprowski wrote:
>> It is possible that the folio_size() of the next folio returns zero, so
> What?  How can folio_size() return zero?
>
>          return PAGE_SIZE << folio_order(folio);
>
> It is a minimum of PAGE_SIZE.

Well, the folio_order() on that next folio returns 255, so folio_size() 
overflows to zero. However, the main source of this issue is relying on 
the properties of the folio beyond the requested sync region.

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH] arm: dma-mapping: fix potential endless loop in __dma_page_dev_to_cpu()
Date: Wed, 9 Aug 2023 19:05:04 +0200	[thread overview]
Message-ID: <ab061a6b-2aeb-fb62-3dd0-a20059ff10ac@samsung.com> (raw)
In-Reply-To: <ZNEagJ6rVDwBKUdr@casper.infradead.org>

Hi,

On 07.08.2023 18:23, Matthew Wilcox wrote:
> On Mon, Aug 07, 2023 at 05:26:57PM +0200, Marek Szyprowski wrote:
>> It is possible that the folio_size() of the next folio returns zero, so
> What?  How can folio_size() return zero?
>
>          return PAGE_SIZE << folio_order(folio);
>
> It is a minimum of PAGE_SIZE.

Well, the folio_order() on that next folio returns 255, so folio_size() 
overflows to zero. However, the main source of this issue is relying on 
the properties of the folio beyond the requested sync region.

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-09 17:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230807152704eucas1p1bbe08af4559a7d2984198fe8ba487a2e@eucas1p1.samsung.com>
2023-08-07 15:26 ` [PATCH] arm: dma-mapping: fix potential endless loop in __dma_page_dev_to_cpu() Marek Szyprowski
2023-08-07 15:26   ` Marek Szyprowski
2023-08-07 16:23   ` Matthew Wilcox
2023-08-07 16:23     ` Matthew Wilcox
2023-08-09 17:05     ` Marek Szyprowski [this message]
2023-08-09 17:05       ` Marek Szyprowski
2023-08-07 22:14   ` Matthew Wilcox
2023-08-07 22:14     ` Matthew Wilcox
2023-08-07 22:46     ` Russell King (Oracle)
2023-08-07 22:46       ` Russell King (Oracle)
2023-08-09 19:38       ` Matthew Wilcox
2023-08-09 19:38         ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab061a6b-2aeb-fb62-3dd0-a20059ff10ac@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=rppt@kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.