Commit Graph

322 Commits

Author SHA1 Message Date
keytouch
5e2b7aa2e3 procfs: Remove unnecessary cleanup on proc_create failure 2023-07-23 18:41:46 +08:00
Jim Huang
433d031ae0
Merge pull request #212 from tylerfanelli/dnf_notes
headers: Update header installation for Fedora
2023-07-08 12:11:00 +08:00
Tyler Fanelli
4f0fa3b17c headers: Update header installation for Fedora 2023-07-08 00:00:20 -04:00
Sam Erickson
9e9f5a8bf8
static_key: Include <linux/jump_label.h> (#210) 2023-07-05 23:14:49 +08:00
Chih-En Lin
befbaf085b
examples: Add missing __init/__exit (#209)
Close #207
2023-07-05 09:44:21 +08:00
Jim Huang
d68fd7623e
Merge pull request #208 from samuelerickson977/master
include linux/init.h in bottomhalf.c
2023-07-05 07:56:03 +08:00
Sam Erickson
8a5463ddd9 include linux/init.h in bottomhalf.c 2023-07-04 10:10:18 -05:00
Jim Huang
f1e60b0a01
Merge pull request #206 from ekangmonyet/master
Cleanup redundant workflow step, fix release body and timestamp
2023-07-04 05:37:06 +08:00
Ekang Monyet
3c66525ef2 Delete old release and retag latest commit
This ensures the latest commit message and timestamp can be correctly
included in the release.
2023-07-04 00:36:05 +08:00
Ekang Monyet
fe46d27faf Revert "Delete existing release asset before releasing"
This reverts commit 7ee66c559f.
2023-07-03 09:32:35 +08:00
Jim Huang
738727bbcc
Merge pull request #200 from lyctw/static_key
Introduce static key in optimizations section
2023-05-02 10:58:15 +08:00
Peter Lin
421b9b04fe Introduce static key in optimizations section
This patch introduces static key technique and adds a kernel module
to demostrate how to use static key to optimize an almost unlikely
branch, the module can interact with userspace thru a character device.

Signed-off-by: Peter Lin <peterlin@qilai.dev>
2023-05-02 10:33:36 +08:00
Jim Huang
a284eabdb5
Merge pull request #202 from linD026/master
CI: Switch Smatch source code to GitHub mirror
2023-05-01 23:48:53 +08:00
Chih-En Lin
16e0656b2d CI: Switch Smatch source code to GitHub mirror
Since the Smatch repository is unavailable recently [1], let's switch
to GitHub mirror, https://github.com/error27/smatch.git [2], instead
of using https://repo.or.cz/smatch.git.

[1] https://lore.kernel.org/all/Y1qf7w%2Fjo8FH5I8G@kadam/
[2] https://lore.kernel.org/all/20220810105926.GS3460@kadam/
2023-05-01 23:36:23 +08:00
Jim Huang
ed0b93c152
Merge pull request #198 from linD026/master
Remove sleep_on family
2023-04-27 11:28:05 +08:00
Chih-En Lin
d2d54ca639 Remove sleep_on family
Since the commit b8780c363d80 ("sched: remove sleep_on() and friends
"), the description about sleep_on is incorrect and the example code has
been fixed by replacing it with wait_event family. Let's also fix the
description to match the corrected code.
2023-04-27 10:20:48 +08:00
Jim Huang
cc37e59a63 Fix macOS prerequisites 2023-03-26 09:21:53 +08:00
Jim Huang
6eb7bd5d23
Merge pull request #193 from linD026/master
procfs: Enforce Linux naming style
2023-03-24 12:23:24 +08:00
Chih-En Lin
23c0a73c78 procfs: Enforce Linux naming style 2023-03-24 11:36:33 +08:00
Jim Huang
45ac4087d0
Merge pull request #189 from linD026/master
Improve the compatibility and fix the missing header
2023-03-14 09:01:22 +08:00
linD026
4ee80a3e16 completion: Improve the compatibility with v5.17+
Since v5.17-rc1, particularly after the commit cead1855266 ("exit:
Rename complete_and_exit to kthread_complete_and_exit"),
complete_and_exit() is renamed to kthread_complete_and_exit().

Close #188
2023-03-14 08:26:19 +08:00
linD026
8a5879a0fa chardev2: Fix missing header for {get, put}_user 2023-03-14 08:15:06 +08:00
Jim Huang
cdf7b42ac1
Merge pull request #187 from linD026/master
Relocate Archlinux code snippet to avoid confusion
2023-02-23 21:58:20 +08:00
Chih-En Lin
b0d4204405 Relocate Archlinux code snippet to avoid confusion
Close #185
2023-02-23 21:03:49 +08:00
Jim Huang
a91431a2e3
Merge pull request #186 from ashevche/kernel.h
Discourage kernel.h usage and other header cleanups
2023-02-23 20:33:11 +08:00
Andy Shevchenko
b8bbcd8a07 treewide: Replace kernel.h by printk.h
The kernel.h should be discouraged for use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-02-23 12:54:30 +02:00
Andy Shevchenko
e62dff0df4 treewide: Clean up the headers
The rule of thumb is to include the headers we are the direct user of.
In particular, if we need an atomic API, we include <linux/atomic.h>.

On the other hand we should not use headers for no reason. In particular,
if we are not doing any IRQ job, why is the <linux/irq.h> included?

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-02-23 12:54:30 +02:00
Andy Shevchenko
e07bf16bfd devicemodel: Remove duplicate owner assignment
platform_driver_register() macro already does the correct assignment for
the owner of the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-02-21 23:04:41 +02:00
Jim Huang
53f4b4c640
Merge pull request #184 from linD026/master
syscall: Use openat() instead of open()
2022-12-25 20:24:10 +08:00
linD026
78e3e062c4 syscall: Use openat() instead of open()
Since sys_open is deprecated and some architectures don't support it.
We switch the implementation to sys_openat.

Moreover, in some architectures like x86-64, the prototype of syscall,
for example, openat(), might have been changed to struct pt_regs [1]
but we cannot promise that so support the two types
(sys_openat and pt_regs).

Also, to prevent other untraced tasks print out the information, add
the uid checking in our_sys_openat().

[1] https://lore.kernel.org/lkml/20180405095307.3730-1-linux@dominikbrodowski.net/

Close #159
2022-12-25 14:27:03 +08:00
Jim Huang
2f5fd9a75d
Merge pull request #183 from linD026/master
example/syscall: Fix typo and unmatch types
2022-12-25 12:50:15 +08:00
linD026
6062f64bcf example/syscall: Fix typo and unmatch types 2022-12-25 12:33:52 +08:00
Jim Huang
0decb83073
Merge pull request #182 from lyctw/master
Add error message when sha256 algorithm is not supported
2022-12-13 01:11:45 +08:00
Peter Lin
3133ee5293 Add error message when sha256 algorithm is not supported
It failed silently when crypto_alloc_tfm() failed, so add an error
message to inform the developer to enable sha256 algorithm support.

Signed-off-by: Yu Chien Peter Lin <peterlin.tw@pm.me>
2022-12-12 23:07:20 +08:00
Jim Huang
d249317c87
Merge pull request #181 from lyctw/master
Fix typo in interrupt handlers section
2022-12-11 16:49:44 +08:00
Peter Lin
55e7a155fa Fix typo in interrupt handlers section
%s/assembler/assembly language/

Signed-off-by: Yu Chien Peter Lin <peterlin.tw@pm.me>
2022-12-11 14:46:08 +08:00
Jim Huang
1c916a79a9 CI: Bump validation host versioning
The CI is now running on Ubuntu 22.04-LTS along with gcc-11 and
clang-format-12 .
2022-12-10 06:21:02 +08:00
Jim Huang
c6b59d2a8f CI: Bump dependency versions 2022-12-10 06:11:09 +08:00
Jim Huang
0fe984fd04 Make the naming for GitHub Actions more consistent 2022-12-10 06:07:56 +08:00
Iûnn Kiàn-îng
9c25e59b43
Convey secure boot specific considerations (#177) 2022-11-10 22:24:37 +08:00
Jim Huang
910715dab6
Merge pull request #176 from linD026/master
vinput: Fix missing error code
2022-11-04 01:35:33 +08:00
Chih-En Lin
d81d968b0e vinput: Fix missing error code
Fix the missing error code when register_chrdev() failed.
The report is from Smatch:

Smatch failed: 1 warning(s), 0 error(s)
/home/runner/work/lkmpg/lkmpg/examples/vinput.c:372 vinput_init() warn: missing error code 'err'
2022-11-04 01:16:14 +08:00
Johan Calle
9892214764
Fix typo (line 1019) (#174)
Changed "The choose of two different functions depend on whether ..." to
"The choice between two different functions depends on whether ..."
2022-10-24 21:52:05 +08:00
Jim Huang
b950a100f6
Merge pull request #124 from tzuyichan/patch
Fix grammar
2022-10-23 00:28:11 +08:00
Jim Huang
d2ddcccce3 Fix dead link
Close #173
2022-10-21 09:36:47 +08:00
Kohei Otsuka
7b38f3713a
Fix typo (#169) 2022-10-05 00:52:07 +08:00
Jim Huang
760df73743
Merge pull request #168 from linD026/master
Fix dereference NULL pointer with proc_lseek
2022-09-23 13:52:06 +08:00
Jim Huang
422f387ae3
Merge pull request #167 from linD026/minmax
Improve the compatibility with kernel < v5.10
2022-09-23 13:51:25 +08:00
linD026
0f9c72631c Fix dereference NULL pointer with proc_lseek
Since the operations are static storage duration, the pointer in
operation structures will initialize with NULL. But, the kernel
doesn't check whether the pointer is NULL or not when calling it.

Related Discussion:
- https://github.com/sysprog21/lkmpg/issues/165
- https://github.com/sysprog21/lkmpg/issues/160

Close #165
2022-09-21 16:57:23 +08:00
linD026
eb2c766da4 Improve the compatibility with kernel < v5.10
min()/max() splited from kernel.h to minmax.h since v5.10-rc1.
Before v5.10, minmax.h doesn't exist [1].

[1] b296a6d533
2022-09-21 13:53:06 +08:00