How to authenticate shared memory?

I am listening for the ES_EVENT_TYPE_AUTH_MMAP event, but did not see mmap MAP_SHARED authentication callback, only see the following logs

2023-02-02 20:11:32.713347+0800 0x12ac8    Default     0x0                  404    0    com.test.es:  ➔D|320 [M_IPC]: ES_EVENT_TYPE_AUTH_MMAP: pid:1443, path:/Users/armmini/go/src/myapp/maptest, sourcePath:/Users/armmini/go/src/myapp/maptest, path_tuncated:0, flag:0x40002, protection:0x1, max_protection:0x7

2023-02-02 20:11:32.715234+0800 0x12ac8    Default     0x0                  404    0    com.test.es:  ➔D|320 [M_IPC]: ES_EVENT_TYPE_AUTH_MMAP: pid:1443, path:/Users/armmini/go/src/myapp/maptest, sourcePath:/Users/armmini/go/src/myapp/maptest, path_tuncated:0, flag:0x12, protection:0x3, max_protection:0x3

2023-02-02 20:11:32.715402+0800 0x12ac8    Default     0x0                  404    0    com.test.es:  ➔D|320 [M_IPC]: ES_EVENT_TYPE_AUTH_MMAP: pid:1443, path:/Users/armmini/go/src/myapp/maptest, sourcePath:/Users/armmini/go/src/myapp/maptest, path_tuncated:0, flag:0x12, protection:0x3, max_protection:0x3

Demo as follows

package main

/*
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/shm.h>
#include <sys/ipc.h>

#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
int my_shm_new(char *name) {
    shm_unlink(name);
    return shm_open(name, O_RDWR|O_CREAT|O_EXCL, FILE_MODE);
}
int my_shm_open(char *name) {
    return shm_open(name, O_RDWR);
}
*/
import "C"
import (
	"flag"
	"fmt"
	"unsafe"
)

const SHM_Name = "my_shm"
const SHM_Size = 1000 * 1000

type SHM_Data struct {
	data [1024]byte
}

func main() {
	send(*msg)
	// receive()
}

func send(msg string) {
	fd, err := C.my_shm_new(C.CString(SHM_Name))
	if err != nil {
		fmt.Printf("1 %v", err)
		return
	}

	C.ftruncate(fd, SHM_Size)
	ptr, err := C.mmap(nil, SHM_Size, C.PROT_READ|C.PROT_WRITE, C.MAP_SHARED, fd, 0)
	if err != nil {
		fmt.Printf("2 %v", err)
		return
	}

	C.close(fd)
	data := (*SHM_Data)(unsafe.Pointer(ptr))
	msgByte := []byte(msg)
	for idx, b := range msgByte {
		data.data[idx] = b
	}
}

func receive() {
	fd, err := C.my_shm_open(C.CString(SHM_Name))
	if err != nil {
		fmt.Println(err)
		return
	}

	ptr, err := C.mmap(nil, SHM_Size, C.PROT_READ|C.PROT_WRITE, C.MAP_SHARED, fd, 0)
	if err != nil {
		fmt.Println(err)
		return
	}

	C.close(fd)

	data := (*SHM_Data)(unsafe.Pointer(ptr))

	bt := make([]byte, 0)
	for _, b := range data.data {
		bt = append(bt, b)
	}
	fmt.Println("Receive:", string(bt))
}

How to authenticate shared memory?
 
 
Q