我的任务如下:需要从 BIOS 芯片读取所有 UEFI 固件数据并计算checksum
这些数据。
如何做到这一点(UEFI 固件的内存区域是什么,是否可以从 Linux 内核读取 UEFI 固件)?
我的任务如下:需要从 BIOS 芯片读取所有 UEFI 固件数据并计算checksum
这些数据。
如何做到这一点(UEFI 固件的内存区域是什么,是否可以从 Linux 内核读取 UEFI 固件)?
我知道 dmesg 命令会打印存储在环形缓冲区中的消息。但是从 Linux 源代码来看,缓冲区的名称是什么?我想在 Linux 被终止且没有任何消息后查看缓冲区。我怀疑这不是由软件陷阱引起的(因此没有恐慌消息),但我可以检查内存(使用一些 System.map 和虚拟到物理地址的转换)。
我打算使用 Ext4 文件加密功能。一切正常,但还有一个问题。通过 删除密码后keyctl
,我仍然可以看到加密目录的内容。我尝试删除密钥、同步并清空页面缓存、卸载文件系统、重新启动 caja 文件管理器并再次挂载 fs。但它不起作用。虽然我无法再写入目录,但我仍然可以看到清晰的名称。
如何清空内核的 KeyRing 缓存?(无需重新启动或重启我的 X 会话)
资料来源:
我看到了一种非常奇怪的行为。
/proc/1154/cmdline
存在,并且kill -0 1154
成功,但是ps -ef | grep 1154
和ls /proc | grep 1154
不显示任何内容。
1154 是虚拟机重新启动时,处于关闭状态的 postgres 进程(或者日志中提到但可能没有被刷新)。
这怎么可能呢?
我已经编译并安装了 Linux 驱动程序,但现在我不确定如何在我的代码中实际使用它。
该驱动程序适用于 mcp9600 热电偶放大器,默认情况下它不在我的内核中(内核版本 6.6),但源代码可在此处获得: https://github.com/torvalds/linux/blob/master/drivers/iio/temperature/mcp9600.c
我已经成功编译并安装了驱动程序(我假设),因为我可以在 /sys 中找到文件:
>ls /sys/module/mcp9600
coresize holders initstate refcnt taint
drivers initsize notes sections uevent
>ls /sys/bus/i2c/drivers/mcp9600
bind module uevent unbind
但是 /dev 下什么都没有
我需要做什么才能从 c 代码或 shell 脚本读取该芯片的温度数据?
这是在 arm64 嵌入式设备上的 debian 上。
根据内核参数kexec_load_disabled的文档,
此值默认为 0(false:启用 kexec_load),但可以设置为 1(true:禁用 kexec_load)。一旦设置为 true,kexec 将不再可用,并且无法将切换设置回 false。
该文档说的是,如果将此参数设置为 true,即 1,则一旦加载了内核,就无法在运行时卸载它,也无法加载新内核来代替它。因此,如果在将内核参数设置为 的机器上安装了内核 6.10.13 kexec_load_disabled
,1
是否会影响将内核升级到版本 6.11.2?即使重新启动后也会阻止它吗?
此外,如果将此参数设置为 true,则不会阻止在引导加载程序(如 GRUB)中操纵条目。因此,在 GRUB 中可以创建一个条目来加载其他内核版本。我的理解正确吗?
我遇到了一些意外的自动重启并且没有剩余的 vmcore。
因此我想捕捉内核重启的发生时间以及调用此命令的人。
正如我之前所想的,当我输入一个reboot
命令时,SYSCALL_DEFINE4(reboot)
就会被调用,然后内核进入该函数kernel_restart
。
但事实是,当我使用 kprobe 来跟踪kernel_restart
并输入时reboot
,什么都没有捕获到 ---- 我已经在其他一些内核函数上进行了测试,例如do_sys_open
和ksys_umount
,它们都工作正常,所以至少我对 kprobe 的使用没有错。
现在我想知道内核中是否还有其他方法可以调用重启?
如果设备操作中缺少 llseek 方法,则内核中的默认实现通过修改 filp->f_pos 来执行查找
但是我有一个字符设备,其驱动程序没有实现 lseek。以下是此设备类型的文件操作定义: https://github.com/Xilinx/dma_ip_drivers/blob/master/XDMA/linux-kernel/xdma/cdev_ctrl.c
但尝试在此设备上执行 lseek 时会返回 ESPIPE:
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
int main(int argc, char** argv) {
uint32_t val=0x12345678;
int fid=open("/dev/xdma0_user", O_RDWR);
off_t lseek_ret=lseek(fid, 0x8ul, SEEK_SET);
if (lseek_ret <0)
fprintf(stderr, "Seek result: %d, errno: %s (%d)\n", lseek_ret, strerror(errno), errno );
unsigned int c=write(fid, &val, sizeof(val));
printf("written %u bytes\n", c);
close(fid);
return (0);
}
输出:
Seek result: -1, errno: Illegal seek (29)
written 4 bytes
我不明白这是怎么发生的。它不可能来自驱动程序:ESPIPE 甚至没有在任何地方提及,因此它一定来自内核,这与上面的引述相矛盾。
默认行为是否已被改变?能否以某种方式进行配置?如何查看内核实际执行的操作(理想情况下是源代码)?
内核版本是 5.10(Debian 11)。
我知道,由于类 Unix 内核的 PID 重用,如果在 PID 已经被收获之后发送信号,则信号可能会被传送到错误的进程。
下文的讨论可能必然取决于我们讨论的具体内核,因此我很乐意将讨论范围缩小到 Linux。不过我欢迎其他内核专家的回答。
需要考虑的几种情况:
假设我正在调用kill(2)
僵尸进程(即,我已经在内核空间中并执行内核代码来启动信号)。同时,僵尸进程的父进程调用wait(2)
。我对的调用是否kill(2)
可能最终尝试对其他进程采取行动?
假设我已经对kill(2)
一个进程执行了 -ed(即成功从调用返回到用户空间),但在传递我的信号之前,另一个信号被捕获并终止了该进程。在这种情况下,我假设我的信号肯定会被丢弃?原因之一是:即使 PID 被捕获并且同时生成了具有相同 PID 的另一个进程,将信号传递给新进程也可能会打开权限漏洞。
谢谢
我从 Open Suse Leap 中的软件更新功能收到以下错误消息:
There is no update candidate for kernel-default-devel-5.14.21-150500.55.68.1.x86_64
如果我尝试应用所有可用更新,就会发生这种情况,这些更新始终(可能是因为我已更新到 15.5)包括kernel-devel
和的更新kernel-default-devel
,均针对版本5.14.21-150500.53.2
。但是,YasT 软件包管理在多版本软件包下告诉我,我只安装了 55.65 和 55.68;这些也是我的启动菜单中明确提到的唯一版本。
我必须手动排除这两个包才能使其余更新成功。我该怎么做:
我忘了为什么要安装这些-devel
软件包,但我想可能是因为它们提供了构建某些软件所需的文件——或者只是出于简单的好奇。
(我很抱歉在这些列表中使用了德语;我安装了几种语言,但出于某种原因,它经常使用德语而不是英语!)
pjtraill@PatrickLaptopLinux:~> zypper search /^kernel/
S | Name | Summary | Type
---+--------------------------------------+---------------------------------------------------------------+-----------
| kernel-64kb | Kernel with 64kb PAGE_SIZE | Quellpaket
| kernel-azure | Kernel for MS Azure cloud | Paket
| kernel-azure | Kernel for MS Azure cloud | Quellpaket
| kernel-azure-devel | Development files necessary for building kernel modules | Paket
| kernel-azure-extra | Kernel for MS Azure cloud - Unsupported kernel modules | Paket
| kernel-azure-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
| kernel-azure-optional | Kernel for MS Azure cloud - Optional kernel modules | Paket
| kernel-azure-vdso | vdso binaries for debugging purposes | Paket
| kernel-debug | A Debug Version of the Kernel | Paket
| kernel-debug | A Debug Version of the Kernel | Quellpaket
| kernel-debug-devel | Development files necessary for building kernel modules | Paket
| kernel-debug-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
| kernel-debug-vdso | vdso binaries for debugging purposes | Paket
i+ | kernel-default | The Standard Kernel | Paket
| kernel-default | The Standard Kernel | Quellpaket
| kernel-default-base | The Standard Kernel - base modules | Paket
| kernel-default-base | The Standard Kernel - base modules | Quellpaket
| kernel-default-base-rebuild | Empty package to ensure rebuilding kernel-default-base in OBS | Paket
i+ | kernel-default-devel | Development files necessary for building kernel modules | Paket
i+ | kernel-default-extra | The Standard Kernel - Unsupported kernel modules | Paket
| kernel-default-livepatch | Metapackage to pull in matching kernel-livepatch package | Paket
| kernel-default-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
i+ | kernel-default-optional | The Standard Kernel - Optional kernel modules | Paket
| kernel-default-vdso | vdso binaries for debugging purposes | Paket
i+ | kernel-devel | Development files needed for building kernel modules | Paket
| kernel-devel-azure | Development files needed for building kernel modules | Paket
| kernel-devel-rt | Development files needed for building kernel modules | Paket
| kernel-docs | Kernel Documentation | Paket
| kernel-docs | Kernel Documentation | Quellpaket
| kernel-docs-html | Kernel Documentation (HTML) | Paket
| kernel-firmware | Linux kernel firmware files | Paket
| kernel-firmware | Linux kernel firmware files | Quellpaket
i+ | kernel-firmware-all | Compatibility metapackage for kernel firmware files | Paket
i+ | kernel-firmware-amdgpu | Kernel firmware files for AMDGPU graphics driver | Paket
i+ | kernel-firmware-ath10k | Kernel firmware files for Atheros QCA988x WiFi drivers | Paket
i+ | kernel-firmware-ath11k | Kernel firmware files for Atheros Qualcomm WiFi drivers | Paket
i+ | kernel-firmware-atheros | Kernel firmware files for Atheros wireless drivers | Paket
i+ | kernel-firmware-bluetooth | Kernel firmware files for various Bluetooth drivers | Paket
i+ | kernel-firmware-bnx2 | Kernel firmware files for Broadcom network drivers | Paket
i+ | kernel-firmware-brcm | Kernel firmware files for Broadcom wireless drivers | Paket
i+ | kernel-firmware-chelsio | Kernel firmware files for Chelsio network drivers | Paket
i+ | kernel-firmware-dpaa2 | Kernel firmware files for NXP Management Complex bus driver | Paket
i+ | kernel-firmware-i915 | Kernel firmware files for Intel i915 graphics driver | Paket
i+ | kernel-firmware-intel | Kernel firmware files for Intel-platform device drivers | Paket
i+ | kernel-firmware-iwlwifi | Kernel firmware files for Intel wireless drivers | Paket
i+ | kernel-firmware-liquidio | Kernel firmware files for Cavium LiquidIO driver | Paket
i+ | kernel-firmware-marvell | Kernel firmware files for Marvell network drivers | Paket
i+ | kernel-firmware-media | Kernel firmware files for various Video4Linux drivers | Paket
i+ | kernel-firmware-mediatek | Kernel firmware files for Mediatek network drivers | Paket
i+ | kernel-firmware-mellanox | Kernel firmware files for Mellanox Spectrum switch driver | Paket
i+ | kernel-firmware-mwifiex | Kernel firmware files for Marvell WiFi fullmac drivers | Paket
i+ | kernel-firmware-network | Kernel firmware files for various network drivers | Paket
i+ | kernel-firmware-nfp | Kernel firmware files for Netronome Flow Processor driver | Paket
i+ | kernel-firmware-nvidia | Kernel firmware files for Nvidia Tegra and graphics drivers | Paket
| kernel-firmware-nvidia-gsp-G06 | Kernel firmware file for open NVIDIA kernel module driver G06 | Paket
| kernel-firmware-nvidia-gspx-G06 | Kernel firmware file for open NVIDIA kernel module driver G06 | Quellpaket
| kernel-firmware-nvidia-gspx-G06 | Kernel firmware file for open NVIDIA kernel module driver G06 | Paket
| kernel-firmware-nvidia-gspx-G06-cuda | Kernel firmware file for open NVIDIA kernel module driver G06 | Quellpaket
| kernel-firmware-nvidia-gspx-G06-cuda | Kernel firmware file for open NVIDIA kernel module driver G06 | Paket
i+ | kernel-firmware-platform | Kernel firmware files for various platform drivers | Paket
i+ | kernel-firmware-prestera | Kernel firmware files for Marvell Prestera ASIC driver | Paket
i | kernel-firmware-qcom | Kernel firmware files for Qualcomm device drivers | Paket
i+ | kernel-firmware-qlogic | Kernel firmware files for QLogic network drivers | Paket
i+ | kernel-firmware-radeon | Kernel firmware files for Radeon graphics driver | Paket
i+ | kernel-firmware-realtek | Kernel firmware files for Realtek wireless drivers | Paket
i+ | kernel-firmware-serial | Kernel firmware files for various serial drivers | Paket
i+ | kernel-firmware-sound | Kernel firmware files for various sound drivers | Paket
i+ | kernel-firmware-ti | Kernel firmware files for Texas Instruments wireless drivers | Paket
i+ | kernel-firmware-ueagle | Kernel firmware files for Eagle IV USB ADSL modem driver | Paket
i+ | kernel-firmware-usb-network | Kernel firmware files for various USB WiFi / Ethernet drivers | Paket
i | kernel-install-tools | Useful tools for installing self-built kernels | Paket
| kernel-kvmsmall | The Small Developer Kernel for KVM | Paket
| kernel-kvmsmall | The Small Developer Kernel for KVM | Quellpaket
| kernel-kvmsmall-devel | Development files necessary for building kernel modules | Paket
| kernel-kvmsmall-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
| kernel-kvmsmall-vdso | vdso binaries for debugging purposes | Paket
i+ | kernel-macros | RPM macros for building Kernel Module Packages | Paket
| kernel-obs-build | package kernel and initrd for OBS VM builds | Paket
| kernel-obs-build | package kernel and initrd for OBS VM builds | Quellpaket
| kernel-obs-qa | Basic QA tests for the kernel | Paket
| kernel-obs-qa | Basic QA tests for the kernel | Quellpaket
| kernel-rt | The Linux Kernel | Paket
| kernel-rt | The Linux Kernel | Quellpaket
| kernel-rt-devel | Development files necessary for building kernel modules | Paket
| kernel-rt-extra | The Linux Kernel - Unsupported kernel modules | Paket
| kernel-rt-livepatch | Metapackage to pull in matching kernel-livepatch package | Paket
| kernel-rt-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
| kernel-rt-optional | The Linux Kernel - Optional kernel modules | Paket
| kernel-rt-vdso | vdso binaries for debugging purposes | Paket
| kernel-rt_debug | The Linux Kernel | Paket
| kernel-rt_debug | The Linux Kernel | Quellpaket
| kernel-rt_debug-devel | Development files necessary for building kernel modules | Paket
| kernel-rt_debug-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
| kernel-rt_debug-vdso | vdso binaries for debugging purposes | Paket
i+ | kernel-source | The Linux Kernel Sources | Paket
| kernel-source | The Linux Kernel Sources | Quellpaket
| kernel-source-azure | The Linux Kernel Sources | Paket
| kernel-source-azure | The Linux Kernel Sources | Quellpaket
| kernel-source-rt | The Linux Kernel Sources | Paket
| kernel-source-rt | The Linux Kernel Sources | Quellpaket
| kernel-source-vanilla | Vanilla Linux kernel sources with minor build fixes | Paket
| kernel-syms | Kernel Symbol Versions (modversions) | Paket
| kernel-syms | Kernel Symbol Versions (modversions) | Quellpaket
| kernel-syms-azure | Kernel Symbol Versions (modversions) | Paket
| kernel-syms-azure | Kernel Symbol Versions (modversions) | Quellpaket
| kernel-syms-rt | Kernel Symbol Versions (modversions) | Paket
| kernel-syms-rt | Kernel Symbol Versions (modversions) | Quellpaket
| kernel-vanilla | The Standard Kernel - without any SUSE patches | Quellpaket
| kernel-vanilla | The Standard Kernel - without any SUSE patches | Paket
| kernel-vanilla-base | The Standard Kernel - without any SUSE patches - base modules | Paket
| kernel-vanilla-devel | Development files necessary for building kernel modules | Paket
| kernel-vanilla-livepatch-devel | Kernel symbols file used during kGraft patch development | Paket
| kernel-zfcpdump | The IBM System Z zfcpdump Kernel | Quellpaket
| kernelshark | GUI for trace-cmd | Paket
zypper info kernel-devel
:
Information for Paket kernel-devel:
-----------------------------------
Repository : update-sle (15.5)
Name : kernel-devel
Version : 5.14.21-150500.55.68.1
Arch : noarch
Anbieter : SUSE LLC <https://www.suse.com/>
Installed Size : 59.1 MiB
Installed : Yes
Status : up-to-date
Quellpaket : kernel-source-5.14.21-150500.55.68.1.src
Upstream-URL : https://www.kernel.org/
Summary : Development files needed for building kernel modules
Description :
Kernel-level headers and Makefiles required for development of
external kernel modules.
Source Timestamp: 2024-06-05 21:39:05 +0000
GIT Revision: 40e256a4a88f37d43c8f973ffe5bee78c5b1c679
GIT Branch: SLE15-SP5
zypper repos
Repository-Prioritäten treten in Kraft: (Siehe 'zypper lr -P' für Details)
20 (erhöhte Priorität) : 1 Repository
99 (Standard-Priorität) : 12 Repositorys
# | Alias | Name | Enabled | GPG Check | Refresh
---+--------------------------------------+--------------------------------------------------------------+---------+-----------+--------
1 | NVIDIA:repo-non-free | repo-non-free (15.5) | Yes | (r ) Yes | Yes
2 | download.nvidia.com-$releasever | nVidia Graphics Drivers | Yes | (r ) Yes | Yes
3 | http-download.opensuse.org-08194b20 | openSUSE:Leap:15.5:Update | No | ---- | ----
4 | https-download.opensuse.org-1a3b4b18 | SUSE:SLE-15-SP2:GA | No | ---- | ----
5 | https-download.opensuse.org-1df5925c | SUSE:SLE-15:GA | No | ---- | ----
8 | https-download.opensuse.org-4e7c4183 | devel:languages:rust | No | ---- | ----
11 | https-download.opensuse.org-7c0c5e5f | SUSE:SLE-15-SP1:GA | No | ---- | ----
7 | https-download.opensuse.org-31c9479b | home:kimi | No | ---- | ----
9 | https-download.opensuse.org-75a45d34 | server:database | No | ---- | ----
10 | https-download.opensuse.org-75f4f64c | home:bespokesynth:libs | No | ---- | ----
6 | https-download.opensuse.org-2312c850 | SUSE:SLE-15-SP1:Update | No | ---- | ----
12 | https-download.opensuse.org-a01803b3 | network:im:signal | No | ---- | ----
13 | https-download.opensuse.org-b4a26c73 | home:hibby50 | No | ---- | ----
14 | https-download.opensuse.org-b695c6af | SUSE:SLE-15:Update | No | ---- | ----
15 | https-download.opensuse.org-b800ad06 | SUSE:SLE-15-SP3:GA | No | ---- | ----
16 | https-download.opensuse.org-e33eb299 | openSUSE:Backports:SLE-15-SP3 | No | ---- | ----
17 | https-download.opensuse.org-eb8758bc | openSUSE:Backports:SLE-15-SP3:Checks | No | ---- | ----
18 | https-download.opensuse.org-fb44bba0 | SUSE:SLE-15-SP2:Update | No | ---- | ----
19 | openSUSE-Leap-${releasever}-1 | openSUSE-Leap-15.5-1 | No | ---- | ----
20 | openSUSE:repo-non-oss | repo-non-oss (15.5) | Yes | (r ) Yes | Yes
21 | openSUSE:repo-non-oss-debug | repo-non-oss-debug (15.5) | No | ---- | ----
22 | openSUSE:repo-openh264 | repo-openh264 (15.5) | Yes | (r ) Yes | Yes
23 | openSUSE:repo-oss | repo-oss (15.5) | Yes | (r ) Yes | Yes
24 | openSUSE:repo-oss-debug | repo-oss-debug (15.5) | No | ---- | ----
25 | openSUSE:repo-oss-source | repo-oss-source (15.5) | No | ---- | ----
26 | openSUSE:update-backports | update-backports (15.5) | Yes | (r ) Yes | Yes
27 | openSUSE:update-backports-debug | update-backports-debug (15.5) | No | ---- | ----
28 | openSUSE:update-non-oss | update-non-oss (15.5) | Yes | (r ) Yes | Yes
29 | openSUSE:update-non-oss-debug | update-non-oss-debug (15.5) | No | ---- | ----
30 | openSUSE:update-oss | update-oss (15.5) | Yes | (r ) Yes | Yes
31 | openSUSE:update-oss-debug | update-oss-debug (15.5) | No | ---- | ----
32 | openSUSE:update-sle | update-sle (15.5) | Yes | (r ) Yes | Yes
33 | openSUSE:update-sle-debug | update-sle-debug (15.5) | No | ---- | ----
34 | openSUSE_Leap_${releasever} | Mozilla for Leap 15.5 | Yes | (r ) Yes | Yes
35 | openSUSE_Leap_${releasever}_1 | Packman (full) for Leap 15.5 | Yes | (r ) Yes | Yes
36 | repo-backports-update | Update repository of openSUSE Backports | Yes | (r ) Yes | Yes
37 | repo-sle-update | Update repository with updates from SUSE Linux Enterprise 15 | Yes | (r ) Yes | Yes
sudo zypper purge-kernels --dry-run
:
Installierte Pakete werden gelesen...
Säuberung von veralteten Kerneln wird vorbereitet...
Konfiguration: latest,latest-1,running
Kernel Release läuft: 5.14.21-150500.55.68-default
Kernel arch läuft: x86_64
Paketabhängigkeiten werden aufgelöst...
Nothing to do.
来自信息中心的版本数据:
Operating System: openSUSE Leap 15.5
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 5.14.21-150500.55.68-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4702MQ CPU @ 2.20GHz
Memory: 11.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4600
Manufacturer: Acer
Product Name: Aspire V3-772G
System Version: V1.15