可以使用如下代码: struct uart_state *state = tty->driver_data; struct uart_port *port = state->port; 类似的,由 uart_port 得到tty_struct 则使用如下方法: struct tty_struct *tty = port.info->port.tty;
struct tty_struct { int magic; struct kref kref; struct device *dev; // 对应的 tty_driver struct tty_driver *driver; // static const struct tty_operations uart_ops; const struct tty_operations *ops; int index; /* Protects ldisc changes: Lock tty not pty */ struct ld_semaphore ldisc_...
利用tty设备泄露关键地址:通过打开ptmx设备,泄露tty_struct和tty_operations地址,进一步判断内核基址。结合泄露信息实现提权:在调试阶段,结合已泄露的内核基址和其他关键信息,进行后续操作,最终实现提权。启示: 技术细节随内核版本变化:随着内核版本的更新,漏洞利用的技术细节会有所变化,需要不断学习新...
void (*receive_buf)(struct tty_struct *, const unsigned char *cp, char *fp, int count); void (*write_wakeup)(struct tty_struct *); void (*dcd_change)(struct tty_struct *, unsigned int); int (*receive_buf2)(struct tty_struct *, const unsigned char *cp, char *fp, int count);...
tty_operations:tty 设备操作关联函数表 在/dev下有一个伪终端设备ptmx,在我们打开这个设备时内核中会创建一个tty_struct结构体,与其他类型设备相同,tty驱动设备中同样存在着一个存放着函数指针的结构体tty_operations 那么我们不难想到的是我们可以通过 UAF 劫持/dev/ptmx这个设备的tty_struct结构体与其内部的tty_ope...
kernel UAF && tty_struct,#kernelUAF&&劫持tty_struct###ciscn2017_babydriverexp1fork进程时会申请堆来存放cred。cred结构大小为0xA8。修改cred里的uid,gid为0,即可getroot#include<string.h>#include<
babydev_struct.device_buf_len =0x40; printk(KERN_INFO"device open\n");return0; }staticinta3_module_release(structinode * __inode,structfile * __file){ kfree(babydev_struct.device_buf); printk(KERN_INFO"device release\n");return0; ...
pid_t tty_old_pgrp; //进程控制终端所在的组标识 pid_t session; //进程的会话标识 pid_t tgid; int leader; //表示进程是否为会话主管 struct task_struct *p_opptr,*p_pptr,*p_cptr,*p_ysptr,*p_osptr; struct list_head thread_group; //线程链表 ...
pid_t tty_old_pgrp; //进程控制终端所在的组标识 pid_t session; //进程的会话标识 pid_t tgid; int leader; //表示进程是否为会话主管 struct task_struct *p_opptr,*p_pptr,*p_cptr,*p_ysptr,*p_osptr; struct list_head thread_group; //线程链表 ...
struct task_struct *pidhash_next; struct task_struct **pidhash_pprev; //pid是随机分配的,我们常常使用kill pid想进程发送信号(大部分人认为是杀死进程,其实这是个发送信号的指令,默认的参数为杀死。如果想暂停某进程,只需kill STOP 进程的PID),这里可以看到根据pid寻找进程的操作是经常被使用的,而pid又是...