2020-06-26 17:23:00 +00:00
|
|
|
#ifndef __LINUX_USERMODE_DRIVER_H__
|
|
|
|
#define __LINUX_USERMODE_DRIVER_H__
|
|
|
|
|
|
|
|
#include <linux/umh.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_BPFILTER
|
|
|
|
void __exit_umh(struct task_struct *tsk);
|
|
|
|
|
|
|
|
static inline void exit_umh(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
if (unlikely(tsk->flags & PF_UMH))
|
|
|
|
__exit_umh(tsk);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline void exit_umh(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 16:16:06 +00:00
|
|
|
struct umd_info {
|
2020-06-25 16:38:08 +00:00
|
|
|
const char *driver_name;
|
2020-06-26 17:23:00 +00:00
|
|
|
struct file *pipe_to_umh;
|
|
|
|
struct file *pipe_from_umh;
|
|
|
|
struct list_head list;
|
2020-06-26 16:16:06 +00:00
|
|
|
void (*cleanup)(struct umd_info *info);
|
2020-06-26 17:23:00 +00:00
|
|
|
pid_t pid;
|
|
|
|
};
|
2020-06-26 16:16:06 +00:00
|
|
|
int fork_usermode_blob(void *data, size_t len, struct umd_info *info);
|
2020-06-26 17:23:00 +00:00
|
|
|
|
|
|
|
#endif /* __LINUX_USERMODE_DRIVER_H__ */
|