shell bypass 403

Cubjrnet7 Shell

: /usr/src/file_protector-1.1-1569/ [ drwxr-xr-x ]

name : memory.h
/**
@file
@brief    Linux kernel memory management interface wrapper
@details  Copyright (c) 2017-2018 Acronis International GmbH
@author   Mikhail Krivtsov ([email protected])
@since    $Id: $
*/

#pragma once

#include <linux/mm.h>       // is_vmalloc_addr()
#include <linux/slab.h>		// kmalloc(), kzalloc(), kfree()
#include <linux/vmalloc.h>  // vmalloc(), vfree()

#define mem_alloc_with_alloc_flags(size, nowait) kmalloc(size, (nowait) ? (GFP_ATOMIC) : (GFP_KERNEL))
#define mem_alloc0_with_alloc_flags(size, nowait) kzalloc(size, (nowait) ? (GFP_ATOMIC) : (GFP_KERNEL))

#define mem_alloc(size) mem_alloc_with_alloc_flags(size, false)
#define mem_alloc0(size) mem_alloc0_with_alloc_flags(size, false)

#define mem_alloc_nowait(size) mem_alloc_with_alloc_flags(size, true)
#define mem_alloc0_nowait(size) mem_alloc0_with_alloc_flags(size, true)

#define mem_free(p) kfree(p)

static inline void *kvmalloc_compat(size_t size, gfp_t flags)
{
    void *ret;
    ret = kmalloc(size, flags | __GFP_NOWARN);
    if (ret)
    {
        return ret;
    }
    return vmalloc(size);
}

static inline void kvfree_compat(void *addr)
{
    if (is_vmalloc_addr(addr))
        vfree(addr);
    else
        kfree(addr);
}

#define large_mem_alloc(size) kvmalloc_compat(size, GFP_KERNEL)
#define large_mem_free(p) kvfree_compat(p)

#define vmem_alloc(size) vmalloc(size)
#define vmem_free(p) vfree(p)

© 2025 Cubjrnet7