Vigil@nce: Linux kernel, NULL dereference via sg_build_indirect
September 2009 by Vigil@nce
A local attacker can generate an error in a SCSI device, in order
to stop the kernel or to execute privileged code.
Severity: 2/4
Consequences: administrator access/rights, denial of service of
computer
Provenance: user shell
Means of attack: no proof of concept, no attack
Ability of attacker: expert (4/4)
Confidence: confirmed by the editor (5/5)
Diffusion of the vulnerable configuration: high (3/3)
Creation date: 04/09/2009
IMPACTED PRODUCTS
– Linux kernel
DESCRIPTION OF THE VULNERABILITY
The drivers/scsi/sg.c file implements the interface for generic
SCSI devices.
The sg_build_indirect() function, which is called by sg_open(),
frees memory pages when an error occurs (such as a cdrom burning
error). However, the index to memory pages in not incremented, and
__free_pages() is called with a NULL pointer.
A local attacker can therefore generate an error in a SCSI device,
in order to stop the kernel.
An attacker can also use this vulnerability with
VIGILANCE-VUL-8953 (https://vigilance.fr/tree/1/8953)/VIGILANCE-VUL-8861
(https://vigilance.fr/tree/1/8861) in order to elevate his
privileges.
CHARACTERISTICS
Identifiers: BID-36238, VIGILANCE-VUL-9001
http://vigilance.fr/vulnerability/Linux-kernel-NULL-dereference-via-sg-build-indirect-9001