mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-07 14:54:17 +00:00
* 0day explit mitigation * Memory corruption prevention * Privilege escalation prevention * Buffer over flow prevention * File System corruption defense * Thread escape prevention This may very well be the most intensive inclusion to BrooklynR. This will not be part of an x86 suite nor it will be released as tool kit. The security core toolkit will remain part of kernel base.
38 lines
785 B
C
38 lines
785 B
C
#ifndef __FS_CEPH_BUFFER_H
|
|
#define __FS_CEPH_BUFFER_H
|
|
|
|
#include <linux/kref.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <linux/types.h>
|
|
#include <linux/uio.h>
|
|
|
|
/*
|
|
* a simple reference counted buffer.
|
|
*
|
|
* use kmalloc for smaller sizes, vmalloc for larger sizes.
|
|
*/
|
|
struct ceph_buffer {
|
|
struct kref kref;
|
|
struct kvec vec;
|
|
size_t alloc_len;
|
|
};
|
|
|
|
extern struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp);
|
|
extern void ceph_buffer_release(struct kref *kref);
|
|
|
|
static inline struct ceph_buffer *ceph_buffer_get(struct ceph_buffer *b)
|
|
{
|
|
kref_get(&b->kref);
|
|
return b;
|
|
}
|
|
|
|
static inline void ceph_buffer_put(struct ceph_buffer *b)
|
|
{
|
|
kref_put(&b->kref, ceph_buffer_release);
|
|
}
|
|
|
|
extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end);
|
|
|
|
#endif
|