linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* slub - extended kmalloc redzone and dma alignment
@ 2025-04-04  9:30 Vlastimil Babka
  2025-04-04 10:30 ` Harry Yoo
  0 siblings, 1 reply; 24+ messages in thread
From: Vlastimil Babka @ 2025-04-04  9:30 UTC (permalink / raw)
  To: Feng Tang, Peng Fan, Hyeonggon Yoo
  Cc: David Rientjes, Christoph Lameter, linux-mm@kvack.org,
	Petr Tesarik

Hi,

due to some off-list inquiry I have realized that since 946fa0dbf2d8
("mm/slub: extend redzone check to extra allocated kmalloc space than
requested")
we might be reporting false positives due to dma writing into the redzone.

It wasn't confirmed (yet) during the conversation but AFAICS it can be
happening. We have this ARCH_DMA_MINALIGN and kmalloc() will guarantee it,
but the redzone check doesn't take it into account. So if it's 8 bytes, I
think it's valid to do e.g. kmalloc(60), get a 64 byte object, do a dma
operation and it can write into the last 4 bytes. But the redzone check will
then report a buffer overflow.

Do you agree? If yes we should probably align the redzone with
ARCH_DMA_MINALIGN even if it means not reporting some non-dma buffer
overflows anymore.

Thanks,
Vlastimil


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-04-10  1:54 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04  9:30 slub - extended kmalloc redzone and dma alignment Vlastimil Babka
2025-04-04 10:30 ` Harry Yoo
2025-04-04 11:12   ` Petr Tesarik
2025-04-04 12:45     ` Vlastimil Babka
2025-04-04 13:53       ` Petr Tesarik
2025-04-06 14:02         ` Feng Tang
2025-04-07  7:21           ` Feng Tang
2025-04-07  7:54             ` Vlastimil Babka
2025-04-07  9:50               ` Petr Tesarik
2025-04-07 17:12               ` Catalin Marinas
2025-04-08  5:27                 ` Petr Tesarik
2025-04-08 15:07                   ` Catalin Marinas
2025-04-09  8:39                     ` Petr Tesarik
2025-04-09  9:05                       ` Petr Tesarik
2025-04-09  9:47                         ` Catalin Marinas
2025-04-09 12:18                           ` Petr Tesarik
2025-04-09 12:49                             ` Catalin Marinas
2025-04-09 13:41                               ` Petr Tesarik
2025-04-09  8:51                     ` Vlastimil Babka
2025-04-09 11:11                       ` Catalin Marinas
2025-04-09 12:22                         ` Vlastimil Babka
2025-04-09 14:30                           ` Catalin Marinas
2025-04-10  1:54                             ` Feng Tang
2025-04-07  7:45         ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).