Date: Mon, 1 Jun 2015 16:50:50 +0000 From: "Gumpula, Suresh" <Suresh.Gumpula@netapp.com> To: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Use after free check for all private zones too Message-ID: <D19203B6.3975C%gsuresh@netapp.com> In-Reply-To: <D16D1B68.377D6%gsuresh@netapp.com> References: <D16D1B68.377D6%gsuresh@netapp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--_002_D19203B63975Cgsureshnetappcom_ Content-Type: text/plain; charset="us-ascii" Content-ID: <17DE2A073DA2BD4CB2583EE0D741C3BC@hq.netapp.com> Content-Transfer-Encoding: quoted-printable Hi, I have attached the diff. Can somebody please review and commit this ? Thanks Suresh On 5/4/15, 12:49 PM, "Gumpula, Suresh" <Suresh.Gumpula@netapp.com> wrote: >Hi , > Currently use after free check is available for power of 2 malloc >zones ( mt_rash_ctor/ m_trash_dotr ) which writes uma_junk(0xdeadc0de) on >freed memory and >validates on reusing the object for others . > Similary we( NETAPP) have added a check for all other private zones >too with trash_ctor/ trash_dtor . We pass the trash_ctor/trash_dtor >to uma_zcreate(9) if it is called with NULL for constructor/destructor. >This change uncovered the couple of bugs inernally. One of this is in >tcp timer bug >https://svnweb.freebsd.org/base?view=3Drevision&revision=3D281599 > >Its a useful check and uncovers use after free bugs . Would like to push >this change . Any comments/suggestions please ? > >Thanks >Suresh > > > >_______________________________________________ >freebsd-hackers@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" --_002_D19203B63975Cgsureshnetappcom_ Content-Type: application/octet-stream; name="patch.patch" Content-Description: patch.patch Content-Disposition: attachment; filename="patch.patch"; size=1446; creation-date="Mon, 01 Jun 2015 16:50:49 GMT"; modification-date="Mon, 01 Jun 2015 16:50:49 GMT" Content-ID: <65EE2E0E69E38741ABDC01EE474295E6@hq.netapp.com> Content-Transfer-Encoding: base64 ZGlmZiAtdXJOIGhlYWQvc3lz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Mua2VnID0gTlVMTDsKZGlmZiAtdXJO IGhlYWQvc3lzL3ZtL3VtYV9kYmcuYyB6b25lX2NwdV9jYWNoZS9zeXMvdm0vdW1hX2RiZy5jCi0t LSBoZWFkL3N5cy92bS91bWFfZGJnLmMJMjAxNC0xMS0xMyAyMDozNjo0NC44MTQ0MDAwMDAgLTA1 MDAKKysrIHpvbmVfY3B1X2NhY2hlL3N5cy92bS91bWFfZGJnLmMJMjAxNS0wNS0yMSAxMDozNjow NC44NTg0NjgwMDAgLTA0MDAKQEAgLTY5LDggKzY5LDExIEBACiAKIAlmb3IgKHAgPSBtZW07IGNu dCA+IDA7IGNudC0tLCBwKyspCiAJCWlmICgqcCAhPSB1bWFfanVuaykgewotCQkJcHJpbnRmKCJN ZW1vcnkgbW9kaWZpZWQgYWZ0ZXIgZnJlZSAlcCglZCkgdmFsPSV4IEAgJXBcbiIsCi0JCQkgICAg bWVtLCBzaXplLCAqcCwgcCk7CisjaWZkZWYgSU5WQVJJQU5UUworCQkJcGFuaWMoIk1lbW9yeSBt b2RpZmllZCBhZnRlciBmcmVlICVwKCVkKSB2YWw9JXggQCAlcFxuIiwgbWVtLCBzaXplLCAqcCwg cCk7CisjZWxzZQorCQkJcHJpbnRmKCJNZW1vcnkgbW9kaWZpZWQgYWZ0ZXIgZnJlZSAlcCglZCkg dmFsPSV4IEAgJXBcbiIsIG1lbSwgc2l6ZSwgKnAsIHApOworI2VuZGlmCiAJCQlyZXR1cm4gKDAp OwogCQl9CiAJcmV0dXJuICgwKTsK --_002_D19203B63975Cgsureshnetappcom_--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D19203B6.3975C%gsuresh>