CVE-2012-2745: Buffer Overflow

Published Jun 19, 2012
·
Updated

keyctlsessiontoparent(task) sets ->replacementsessionkeyring, it should be processed and cleared by keyreplacesessionkeyring().

However, this task can fork before it notices TIFNOTIFYRESUME and the new child gets the bogus ->replacementsessionkeyring copied by duptaskstruct(). This is obviously wrong and, if nothing else, this leads to putcred(alreadyfreedcred).

This causes the following panic on ppc64: Kernel panic - not syncing: CRED: putcredrcu() sees c0000001f41a4480 with usage -1

Call Trace: [c0000001fff53bc0] [c000000000012f04] .showstack+0x74/0x1c0 (unreliable) [c0000001fff53c70] [c0000000005c2d18] .panic+0xb8/0x1ec [c0000001fff53d00] [c0000000000c7858] .putcredrcu+0x118/0x120 [c0000001fff53d80] [c000000000117708] .rcuprocesscallbacks+0x158/0x3f0 [c0000001fff53e30] [c0000000001179d4] .rcuprocesscallbacks+0x34/0x70 [c0000001fff53eb0] [c00000000009cb18] .dosoftirq+0x118/0x290 [c0000001fff53f90] [c000000000031e28] .calldosoftirq+0x14/0x24 [c0000001fcf7b990] [c00000000000e700] .dosoftirq+0xf0/0x110 [c0000001fcf7ba30] [c00000000009c834] .irqexit+0xb4/0xc0 [c0000001fcf7bab0] [c00000000002e3b8] .timerinterrupt+0x108/0x160 [c0000001fcf7bb40] [c000000000003718] decrementercommon+0x118/0x180 --- Exception: 901 at .rawlocalirqrestore+0x54/0x60 LR = .cpuidle+0x14c/0x1d0

Because powerpc does not, currently, call keyreplacesessionkeyring() from the TIFNOTIFYRESUME handler. i386, x8664, s390 and ia64 all do call the keyrings code and so the attack window is much smaller - though still present.

An unprivileged local user could use this flaw to crash the system.

Introduced by: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ee18d64c

Upstream commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79549c6dfda0603dba9a70a53467ce62d9335c33

Other sources

The copycreds function in kernel/cred.c in the Linux kernel before 3.3.2 provides an invalid replacement session keyring to a child process, which allows local users to cause a denial of service (panic) via a crafted application that uses the fork system call.

Launchpad

Affected Software

10 affected componentsFixes available
Linux Linux kernel<=3.3.1
Linux Linux kernel=3.3
Linux Linux kernel=3.3-rc1
Linux Linux kernel=3.3-rc2
Linux Linux kernel=3.3-rc3
Linux Linux kernel=3.3-rc4
Linux Linux kernel=3.3-rc5
Linux Linux kernel=3.3-rc6
Linux Linux kernel=3.3-rc7
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1

Event History

Jun 19, 2012
Data Sourced
via Red Hat·01:01 PM
DescriptionSeverityAffected Software
Aug 9, 2012
CVE Published
via MITRE·10:00 AM
Data Sourced
via MITRE·10:00 AM
Description
Data Sourced
via NVD·10:29 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·10:00 PM
Description
Sep 20, 2024
Data Sourced
via Ubuntu·12:49 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2012-2745?

CVE-2012-2745 is considered to have a medium severity level potentially allowing for local privilege escalation.

2

How do I fix CVE-2012-2745?

To mitigate CVE-2012-2745, update to a patched version of the Linux kernel, specifically 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.128-1, 6.12.12-1, or 6.12.13-1.

3

Which versions are affected by CVE-2012-2745?

CVE-2012-2745 affects multiple versions of the Linux kernel up to and including 3.3.1.

4

What type of vulnerability is CVE-2012-2745?

CVE-2012-2745 is a local privilege escalation vulnerability due to improper handling of session keyrings during task forking.

5

Is CVE-2012-2745 exploitable remotely?

CVE-2012-2745 is not remotely exploitable; it requires local access to the vulnerable system.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203