Skip to content

Commit

Permalink
add licencse in each file
Browse files Browse the repository at this point in the history
  • Loading branch information
bmax committed Jan 9, 2024
1 parent 5a08d3d commit 00de9a8
Show file tree
Hide file tree
Showing 71 changed files with 347 additions and 12 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ Linux 6.3+ (not yet adapted)
- [vmlinux-to-elf](https://github.com/marin-m/vmlinux-to-elf): Some ideas for parsing kernel symbols.
- [android-inline-hook](https://github.com/bytedance/android-inline-hook): Some code for fixing arm64 inline hook instructions.
- [KernelSU](https://github.com/tiann/KernelSU): Some Android compat code.
- [tlsf](https://github.com/mattconte/tlsf): Memory allocator used for KPM. (Need a better one to allocate ROX memory.)
- [tlsf](https://github.com/mattconte/tlsf): Memory allocator used for KPM. (Need another to allocate ROX memory.)
## License
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/fphook.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <hook.h>
#include <symbol.h>
#include <pgtable.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/hmem.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include "hook.h"

#include <stdint.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/hmem.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_HMEM_H_
#define _KP_HMEM_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/base/hook.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <hook.h>
#include <cache.h>
#include <pgtable.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/log.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <stdint.h>

#define BOOT_LOG_SIZE 1024
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/map.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include "setup.h"

typedef uint64_t phys_addr_t;
Expand Down
4 changes: 4 additions & 0 deletions kernel/base/map1.S
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

// todo:
5 changes: 5 additions & 0 deletions kernel/base/predata.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <predata.h>
#include <common.h>
#include <log.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/setup.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include "setup.h"
#include "../version"

Expand Down
5 changes: 5 additions & 0 deletions kernel/base/setup.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_SETUP_H_
#define _KP_SETUP_H_

Expand Down
4 changes: 4 additions & 0 deletions kernel/base/setup1.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#define __ASSEMBLY__
#include "./setup.h"
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/start.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <common.h>
#include <pgtable.h>
#include <ktypes.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/base/start.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_START_H_
#define _KP_START_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/base/symbol.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <symbol.h>
#include <log.h>
#include <stdint.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/include/common.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_COMMON_H_
#define _KP_COMMON_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/ctype.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_CTYPE_H_
#define _KP_CTYPE_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/hook.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_HOOK_H_
#define _KP_HOOK_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/inlinestring.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_INLINESTRING_H_
#define _KP_INLINESTRING_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/kpmodule.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_KPMODULE_H_
#define _KP_KPMODULE_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/log.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_LOG_H_
#define _KP_LOG_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/pgtable.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_PGTABLE_H_
#define _KP_PGTABLE_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/predata.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_PREDATA_H_
#define _KP_PREDATA_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/preset.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_PRESET_H_
#define _KP_PRESET_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/include/symbol.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_SYMBOL_H_
#define _KP_SYMBOL_H_

Expand Down
10 changes: 5 additions & 5 deletions kernel/patch/android/kpuserd.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <ktypes.h>
#include <hook.h>
#include <linux/fs.h>
Expand Down Expand Up @@ -26,11 +31,6 @@
#include <linux/umh.h>
#include <uapi/scdefs.h>

/*
Modified from KernelSU, GPLv2
https://github.com/tiann/KernelSU
*/

const char origin_rc_file[] = "/system/etc/init/atrace.rc";
const char replace_rc_file[] = "/dev/.atrace.rc";

Expand Down
10 changes: 5 additions & 5 deletions kernel/patch/android/sucompat.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <linux/list.h>
#include <ktypes.h>
#include <stdbool.h>
Expand Down Expand Up @@ -29,11 +34,6 @@
#include <uapi/scdefs.h>
#include <predata.h>

/*
Modified from KernelSU, GPLv2
https://github.com/tiann/KernelSU
*/

static const char sh_path[] = ANDROID_SH_PATH;
static const char default_su_path[] = ANDROID_SU_PATH;
static const char *current_su_path = 0;
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/android/supercall.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <ktypes.h>
#include <uapi/scdefs.h>
#include <hook.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/accctl.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include "accctl.h"

#include <pgtable.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/hotpatch.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <hotpatch.h>

#include <linux/stop_machine.h>
Expand Down
4 changes: 4 additions & 0 deletions kernel/patch/common/secpass.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <ktypes.h>
#include <hook.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/selinuxhook.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include "accctl.h"

#include <hook.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/supercall.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <ktypes.h>
#include <uapi/scdefs.h>
#include <hook.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/syscall.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include "syscall.h"

#include <cache.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/taskob.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <taskob.h>
#include <taskext.h>
#include <kallsyms.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/common/utils.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#include <kputils.h>
#include <linux/seq_buf.h>
#include <linux/trace_seq.h>
Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/include/accctl.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_ACCCTL_H_
#define _KP_ACCCTL_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/include/hotpatch.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_HOTPATCH_H_
#define _KP_HOTPATCH_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/include/kconfig.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_KCONFIG_H_
#define _KP_KCONFIG_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/include/kputils.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_UTILS_H_
#define _KP_UTILS_H_

Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/include/ksyms.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_KSYMS_H
#define _KP_KSYMS_H

Expand Down
5 changes: 5 additions & 0 deletions kernel/patch/include/module.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2023 bmax121. All Rights Reserved.
*/

#ifndef _KP_MODULE_H_
#define _KP_MODULE_H_

Expand Down
Loading

0 comments on commit 00de9a8

Please sign in to comment.