Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261323AbVAGJOZ (ORCPT ); Fri, 7 Jan 2005 04:14:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261328AbVAGJOY (ORCPT ); Fri, 7 Jan 2005 04:14:24 -0500 Received: from vds-320151.amen-pro.com ([62.193.204.86]:52612 "EHLO vds-320151.amen-pro.com") by vger.kernel.org with ESMTP id S261323AbVAGJKe (ORCPT ); Fri, 7 Jan 2005 04:10:34 -0500 Subject: [PATCH] Trusted Path Execution LSM 0.2 (20050107) From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: linux-kernel@vger.kernel.org Cc: narahimi@us.ibm.com, Chris Wright , Stephen Smalley , "Serge E.Hallyn" Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-tVI6wma4GZcMTjjiTbo6" Date: Fri, 07 Jan 2005 10:09:49 +0100 Message-Id: <1105088989.3751.10.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 52553 Lines: 723 --=-tVI6wma4GZcMTjjiTbo6 Content-Type: multipart/mixed; boundary="=-5qqeNFykNeGPiP1gZ981" --=-5qqeNFykNeGPiP1gZ981 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, As Chris Wright suggested, the old limitations of the module are not existing anymore, and the protection hooks are now based on memory mappings of executables, which means, you can't bypass it by using the old ld-linux shared library wrapping trick. Also, many fixes for the module memory use and management, that also prevent a possible overflowing in read functions of acl management code, reported by Brad Spengler (a.k.a. spender) when we were revising it yesterday night. Also Seth Arnold helped me with some fixes and recommendations. Anyway, feel free to try to mess it up, i would appreciate any information about possible vulnerabilities, unexpected behaviors, stinking buffers...whatever else ;) Those who have contributed to this little project are listed in the tpe.c source file. The patch is attached, but i encourage to check out the http://selinux.tuxedo-es.org/tpe-lsm/ site, as there you can find two regression tests, one to try to bypass the engine and the other one for trigger a basic overflow in the acl read functions (results can be found at http://selinux.tuxedo-es.org/tpe-lsm/rtest2-log.txt). The current limitations are described in the tpe-lsm.txt file, inside ./Documentation/ and a few examples can be found at http://selinux.tuxedo-es.org/tpe-lsm/0.2-TPE-LSM-Demonstration.txt ) Now i think it could have a chance for mainline inclusion. Cheers, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro [1024D/6F2B2DEC] [2048g/9AE91A22] Hardened Debian head developer & project manager --=-5qqeNFykNeGPiP1gZ981 Content-Disposition: attachment; filename=tpe-20050107.patch Content-Type: text/x-patch; name=tpe-20050107.patch; charset=ISO-8859-1 Content-Transfer-Encoding: base64 ZGlmZiAtTnVyIC4uL2xpbnV4LTIuNi4xMC9Eb2N1bWVudGF0aW9uL3RwZS1sc20udHh0IGxpbnV4 LTIuNi4xMC10cGUvRG9jdW1lbnRhdGlvbi90cGUtbHNtLnR4dA0KLS0tIC4uL2xpbnV4LTIuNi4x MC9Eb2N1bWVudGF0aW9uL3RwZS1sc20udHh0CTE5NzAtMDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAw ICswMTAwDQorKysgbGludXgtMi42LjEwLXRwZS9Eb2N1bWVudGF0aW9uL3RwZS1sc20udHh0CTIw MDUtMDEtMDcgMDE6MzY6MzUuMDAwMDAwMDAwICswMTAwDQpAQCAtMCwwICsxLDEwMyBAQA0KK1Ry dXN0ZWQgUGF0aCBFeGVjdXRpb24gTGludXggU2VjdXJpdHkgTW9kdWxlDQorQ29weXJpZ2h0IChD KSAyMDAzIElCTSBDb3JwLiA8bmFyYWhpbWlAdXMuaWJtLmNvbT4NCitDb3B5cmlnaHQgKEMpIDIw MDUgTG9yZW56byBIZXJuYW5kZXogR2FyY2lhLUhpZXJybyA8bG9yZW56b0BnbnUub3JnPg0KK0F1 dGhvcjogTG9yZW56byBIZXJuYW5kZXogR2FyY2lhLUhpZXJyby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KwkJcmV0 dXJuIChBQ0spOw0KKwl9DQorCXJldHVybiAoTkFDSyk7DQorfQ0KKw0KKy8qICBWZXJpZnkgYSBj YW5kaWRhdGUgdXNlciBncm91cC4gKi8NCitzdGF0aWMgaW5saW5lIGludCB0cGVfc2VhcmNoX2dy b3VwKGdpZF90IGdyb3VwX2NhbmRpZGF0ZSkNCit7DQorCWludCBpOw0KKwlmb3IgKGkgPSAwOyBp IDwgdHBlX2FjbF9ncm91cF9jYW5kaWRhdGVzOyBpKyspIHsNCisJCWlmIChncm91cF9jYW5kaWRh dGUgPT0gdHBlX2dyb3VwX2FjbFtpXSkgew0KKwkJCXJldHVybiBpOw0KKwkJfQ0KKwl9DQorCXJl dHVybiBOQUNLOw0KK30NCitzdGF0aWMgaW5saW5lIGludCB0cGVfZ3JvdXBfdmVyaWZ5KGdpZF90 IGdyb3VwX2NhbmRpZGF0ZSkNCit7DQorCWlmICgodHBlX3NlYXJjaF9ncm91cChncm91cF9jYW5k aWRhdGUpKSAhPSBOQUNLKSB7DQorCQlyZXR1cm4gKEFDSyk7DQorCX0NCisJcmV0dXJuIChOQUNL KTsNCit9DQorDQorI2VuZGlmCQkJCS8qIF9fVFBFX0ggKi8NCn== --=-5qqeNFykNeGPiP1gZ981-- --=-tVI6wma4GZcMTjjiTbo6 Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3lHdDcEopW8rLewRAt3fAKCIJFM2ck+xn2iNxpXIec9K2ogn+ACffyl9 dVu8cF7wLbn7Ia3zRQuPjIs= =vQdg -----END PGP SIGNATURE----- --=-tVI6wma4GZcMTjjiTbo6-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/