Linux Kernel "drivers/scsi/gdth. c" IOCTL Local Privilege Escalation Vulnerability
Release date:Updated on:
Affected Systems:Linux kernel 2.6.0-2.6.37Description:--------------------------------------------------------------------------------Bugtraq id: 44648Cve id: CVE-2010-4157
Linux Kernel is the Kernel used by open source
Path for Linux Device Driver engineers-basic principles and framework of network device drivers
K-Style
Reprinted please indicate from Hengyang Normal College 08 electric 2 K-Style http://blog.csdn.net/ayangke,QQ:843308498 mailbox: yangkeemail@qq.com
1. Linux network subsystem
At the top of the Linux network subsystem
Relationship between Linux device drivers and the entire hardware system 1. Device Classification and features the hardware of a computer system consists of CPU, memory, and peripherals. With the development of the IC (Integrated circuit) manufacturing process, the integration of chips is getting higher and higher, and memory and peripheral adapters are often Integrated into the CPU. The driver targets memo
Differences between Linux 2.4 and kernel drivers-general Linux technology-Linux programming and kernel information. For more information, see the following. To thoroughly prevent incorrect operations on the kernel module being used, the Linux 2.4 kernel has been improved com
Four main types of Linux drivers-general Linux technology-Linux programming and kernel information. Character device: a device that uses the RST stream to access the device, such as a character terminal or serial port. It generally accesses the device sequentially, but it can also move the access pointer, such as a fra
undefined macro. they are found in inux/capability. h and sched. h. in the two files. add # include in c
# Include
After the correction, make and press enter to display the output.
Make-C/lib/modules/2.6.22.1-41. fc7/build M =/home/hide1713/Desktop/kernel/examples/scull LDDINC =/home/hide1713/Desktop/kernel/examples/scull /.. /include modules
Make [1]: Entering directory '/usr/src/kernels/2.6.22.1-41. fc7-i686'
CC [M]/home/hide1713/Desktop/kernel/examples/scull/access. o
LD [M
Question: I want to know what modules are built into the kernel in the Linux system and what parameters each module has. Is there a way to get a list of built-in modules and device drivers, along with their detailed information?
The modern Linux kernel is growing rapidly over time to support a large number of hardware, file systems, and network funct
Brief Introduction to interrupt handling for Linux Device Drivers
The first step related to interrupt handling in Linux device drivers is to apply for and release IRQ APIs: request_irq () and free_irq ().
The prototype of request_irq () is:
Int request_irq (unsigned int IRQ, void (* Handler) (int irq, void * dev_id, s
, unsigned short type, void *daddr, void *saddr, unsigned len);The function establishes a hardware header based on the source and destination hardware addresses that were previously retrieved. The function task is to organize the information that is passed as a parameter into the appropriate hardware header that is unique to the device.Eth_headeris the default function of the Ethernet type interface,E
macro, the type of the return value is as follows:
_ioc_none : No properties
_ioc_read : Readable properties
_ioc_write : Writable Property
_ioc_read | _ioc_write: Readable, writable property
When you use this command, the ARG variable value of the application's IOCTL () specifies the cache (struct) address when the data is read on the device driver._iow MacroUsed to create a command to write data on the device, the remainder is the same as _ior. Typically, w
)When you run the macro, the type of the return value is as follows:
_ioc_none: No attribute
_ioc_read: Readable properties
_ioc_write: Writable Properties
_ioc_read | _ioc_write: Readable, writable property
When you use this command, the ARG variable value of the application's IOCTL () specifies the cache (struct) address when the data is read on the device driver._IOW macroUsed to create a command to write data on the device, the remainder is the same as _ior. Typical
buffers help to separate the delivery and reception of data from the system call write and read, thereby improving the overall performance of the system
A good buffering mechanism requires interrupt-driven I/O
To properly interrupt-driven data transfer, the hardware should be able to generate interrupts according to the following semantics
For input, the device interrupts the processor when new data has arrived and the processor is ready to receive it
For outp
In the Linux authoring process, there are two files that we must understand and know. One of these is the Kconfig file, and the other is the makefile file. If you are familiar with it, then it is certainly necessary for the kernel to compile the. config file, in the. config file, we found that some modules were compiled into the kernel, and some just generated a module. In the middle, how do we let the kernel discover the modules we write, which we ne
Debug one of exynos4412-ARM embedded Linux-LEDS/GPIO drivers, exynos4412leds
/****************************************** ***************************************@ Author's brother * @ version V1.0.0 * @ date 2016-02-19 **************************** **************************************** * ********** 1-led hardware Principle
The Led circuit is relatively simple. Generally, a control circuit is built using a
Preface
Linux is a variant of the UNIX operating system, and the principle and idea of writing a driver in Linux is similar to that of other Unix systems, but it is very different for drivers in DOS or window environments. Design the driver in the Linux environment, the thought is concise, the operation is convenient,
ARM processor.4. Start GDBPath= $PATH:/opt/arm-linux-gcc/s3c2440_4. 4.3/~/buildspacce/linux-2.6. + . 2_debugarm-none-linux-gnueabi-gdb./vmlinux-d.The kernel stops in hibernation when the OPENOCD is connected in gdb.(GDB) Target remote:3333Remote debugging using:3333s3c24xx_default_idle () at Arch/arm/mach-s3c2410/include/mach/system.h : 0(i++) {5. The ke
the methods in the previous chapter to see information about this device in SYSFS:# Ls/sys/block/simp_blkdevDev holders range removable size slaves stat subsystem uevent#We found that our driver was missing the queue subdirectory in the SYSFS directory.It's not surprising, or it's going to freak out.In this chapter we implement our own make_request function to deal with bio, which is to get rid of the I/O Scheduler and the General __make_request () of bio processing.Since the data in our block
closed, that is, in the device-driven release () function, you should call the device-drivenThe Fasync () function removes a file from the list of asynchronous notifications. The following code listing provides support for asynchronous notificationsA template for the device driver release () function.static int xxx_release (struct inode *inode, struct file *filp){struct Xxx_dev *dev = filp->private_data;/ * Remove the file from the asynchronous notification list */Xxx_fasync ( -1, FILP, 0); ...
, void *addr)int test_bit (nr, void * addr);int test_and_set_bit (nr, void *addr);int test_and_clear_bit (nr, void *addr);int test_and_change_bit (nr,void *addr);Spin lockprimarily for SMP and kernel preemption scenariossingle CPU and kernel can be preempted, preemption will be banned during spin lock holdYou cannot call Copy_to_user () Copy_from_user Kmalloc () and other functions that may cause blocking during a spin lock callspinlock_t spin;Spin_lock_init (lock);Spin_lock (lock);Spin_try_lock
No_llseek
Access control for device files
Exclusive equipment
The most blunt method of access control is to allow only one process to open the device at a time
Restrict access by only one user at a time
Requires two data items
An open count
UID of the device owner
Current->uid
Current->euid
Block Open alternative to Ebusy
This is usually the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.