DPDK patches and discussions
 help / color / mirror / Atom feed
* [Bug 1206] Multiple large memory block allocations using rte_malloc can lead to memory out-of-bounds issues.
@ 2023-03-31  1:17 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2023-03-31  1:17 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 3526 bytes --]

https://bugs.dpdk.org/show_bug.cgi?id=1206

            Bug ID: 1206
           Summary: Multiple large memory block allocations using
                    rte_malloc can lead to memory out-of-bounds issues.
           Product: DPDK
           Version: 21.11
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: killerstemp@gmail.com
  Target Milestone: ---

[root@localhost bin]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Model name:            Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Stepping:              9
CPU MHz:               3700.073
CPU max MHz:           3900.0000
CPU min MHz:           1600.0000
BogoMIPS:              6784.24
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer
aes xsave avx f16c rdrand lahf_lm epb ssbd ibrs ibpb tpr_shadow vnmi
flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
[root@localhost bin]# 

Not supported pdpe1gb



There are many free 2M HugePages.

HugePages_Total:    6656
HugePages_Free:     5682
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      236476 kB
DirectMap2M:    33228800 kB




test code

  char * t_mem1;
  char * t_mem2;
        int t_size = 1024*1024*1024;
        t_mem1 = rte_malloc(NULL,t_size,RTE_CACHE_LINE_SIZE);
        t_mem2 = rte_malloc(NULL,t_size,RTE_CACHE_LINE_SIZE);
        printf("rte_malloc1 t_mem1=%p \n",t_mem1);
        printf("rte_malloc1 t_mem2=%p \n",t_mem2);      

        memset(t_mem1,0,t_size);
        memset(t_mem2,1,t_size);        

        int t_i;
        for(t_i=0;t_i<t_size;t_i++)
        {
                if (t_mem1[t_i] ==1)
                {
                        printf("rte_malloc find t_mem1=%p error t_i=%d
%p=%d\n",t_mem1, t_i,&t_mem1[t_i],t_mem1[t_i] );
                        t_mem1[t_i] = 2;
                        break;
                }
        }
        for(t_i=0;t_i<t_size;t_i++)
        {
                if (t_mem2[t_i] ==2)
                {
                        printf("rte_malloc find t_mem2=%p error t_i=%d
%p=%d\n",t_mem2, t_i,&t_mem2[t_i],t_mem2[t_i] );
                        break;
                }
        }

run print:

rte_malloc1 t_mem1=0x107c00000 
rte_malloc1 t_mem2=0x140c00000 
rte_malloc find t_mem1=0x107c00000 error t_i=956301312 0x140c00000=1
rte_malloc find t_mem2=0x140c00000 error t_i=0 0x140c00000=2

The two allocated blocks of memory overlap partially.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #2: Type: text/html, Size: 5496 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-31  1:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  1:17 [Bug 1206] Multiple large memory block allocations using rte_malloc can lead to memory out-of-bounds issues bugzilla

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).