The shmop functions in PHP before 4.4.5, and before 5.2.1 in the 5.x series, do not verify that their arguments correspond to a shmop resource, which allows context-dependent attackers to read and write arbitrary memory locations via arguments associated with an inappropriate resource, as demonstrated by a GD Image resource.
https://www.exploit-db.com/exploits/3427
https://www.exploit-db.com/exploits/3426
http://www.ubuntu.com/usn/usn-455-1
http://www.novell.com/linux/security/advisories/2007_32_php.html
http://www.debian.org/security/2007/dsa-1283
http://security.gentoo.org/glsa/glsa-200703-21.xml
http://secunia.com/advisories/25062
http://secunia.com/advisories/25057