Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262686AbVAFCxS (ORCPT ); Wed, 5 Jan 2005 21:53:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262709AbVAFCxR (ORCPT ); Wed, 5 Jan 2005 21:53:17 -0500 Received: from vds-320151.amen-pro.com ([62.193.204.86]:42372 "EHLO vds-320151.amen-pro.com") by vger.kernel.org with ESMTP id S262686AbVAFCwZ (ORCPT ); Wed, 5 Jan 2005 21:52:25 -0500 Subject: [PATCH] Enhanced Trusted Path Execution (TPE) Linux Security Module From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: linux-kernel@vger.kernel.org Cc: linux-security-module@wirex.com Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-WvlOs3B+kFDWnW7qSdaj" Date: Thu, 06 Jan 2005 03:51:48 +0100 Message-Id: <1104979908.8060.34.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: 50914 Lines: 708 --=-WvlOs3B+kFDWnW7qSdaj Content-Type: multipart/mixed; boundary="=-5Hk3cYK5sQ1w9xikxsHY" --=-5Hk3cYK5sQ1w9xikxsHY Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, This patch adds support for an enhanced Trusted Path Execution (TPE) subsystem relying in the Linux Security Modules framework. It's a rewrite of the IBM's TPE LSM module by Niki A. Rahimi, which adds a couple of improvements and feature enhancements. The most notable of them are support for per-gid basis access control lists in runtime and kernel-configuration time (adds support for trusted and untrusted user groups), procfs interface for statistics and runtime information and debugging capabilities (for limiting the garbage messages). Also, the documentation has been rewritten and under the "Trusted Path Execution (EXPERIMENTAL)" configuration option, has been added a "GID for trusted users" key to make possible to set a default gid for a specific trusted user group. The reasons that give sense for including this, are that standard Vanilla kernels have SELinux and LSM (SELinux already supports TPE functionalities), but SELinux has less possibilities of being used by those desktop or just not experienced users who are not already using their distribution-specific SELinux implementation, even if they want simple protections for their every-day system use, also, the availability of some patch-sets with security enhancements (like grsecurity) distracts users of being using the LSM framework or even SELinux itself, in addition, this TPE has more features than grsecurity's one in terms of per-users and groups acl basis, which make easy the management of the TPE protection. In short, after a first review you can see that it could worthy to include this in the kernel sources. Note: the code, as it is right now, has some limitations that would be solved in a relatively short time manner, more short if more people contribute to it. The limitations of the current code are described in ./Documentation/tpe-lsm.txt Patch against 2.6.10 attached. (not inside msg body for preventing messing up by archives-managing software) I will make available an independent-packaged version ASAP, which could be built outside the kernel sources, at http://selinux.tuxedo-es.org Cheers, PS: I would appreciate to be CC'ed, as I'm not subscribed to the list. (Just for mail traffic volume reasons, which i don't have time to handle) --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro [1024D/6F2B2DEC] [2048g/9AE91A22] Hardened Debian head developer & project manager --=-5Hk3cYK5sQ1w9xikxsHY Content-Disposition: attachment; filename=tpe-20050106.diff Content-Type: text/x-patch; name=tpe-20050106.diff; charset=ISO-8859-1 Content-Transfer-Encoding: base64 ZGlmZiAtTnVyIC4uL2xpbnV4LTIuNi4xMC9Eb2N1bWVudGF0aW9uL3RwZS1sc20udHh0IGxpbnV4 LTIuNi4xMC10cGUvRG9jdW1lbnRhdGlvbi90cGUtbHNtLnR4dA0KLS0tIC4uL2xpbnV4LTIuNi4x MC9Eb2N1bWVudGF0aW9uL3RwZS1sc20udHh0CTE5NzAtMDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAw ICswMTAwDQorKysgbGludXgtMi42LjEwLXRwZS9Eb2N1bWVudGF0aW9uL3RwZS1sc20udHh0CTIw MDUtMDEtMDYgMDI6NTI6MzQuMDAwMDAwMDAwICswMTAwDQpAQCAtMCwwICsxLDg5IEBADQorVHJ1 c3RlZCBQYXRoIEV4ZWN1dGlvbiBMaW51eCBTZWN1cml0eSBNb2R1bGUNCitDb3B5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CQkJCVwNCisJCX0gd2hpbGUgKDApCQkJCQkJDQorDQorLyogS0VSTl9JTkZP IG1lc3NhZ2VzIHVzZSBraW5mbygpIHJhdGhlciB0aGFuIHByaW50aygpIGZvciBiZXR0ZXIgb3V0 cHV0dGluZyBsYXlvdXQgKi8NCisjZGVmaW5lIGtpbmZvKGZtdCwgYXJnLi4uKQkJCQkJCQlcDQor CQlkbyB7CQkJCQkJCQlcDQorCQlpZiAoMSkgIHsJCQkJCQkJXA0KKwkJCXByaW50ayhLRVJOX0lO Rk8gIiVzOiAiIGZtdCAsIE1ZX05BTUUsICMjIGFyZyk7CQlcDQorCQkJfQkJCQkJCQlcDQorCQl9 IHdoaWxlICgwKQ0KKw0KKw0KKy8qICBJbnNlcnRpb24gc29ydCB0aGUgbGlzdC4gKi8NCitzdGF0 aWMgdm9pZCB0cGVfc29ydCAoaW50IGxvdywgaW50IGhpZ2gpICAvKiAobGlzdCBsb3cgZWxlbWVu dCwgbGlzdCBoaWdoIGVsZW1lbnQpICovDQorew0KKyAgICAgICBpbnQgaSxqLG47DQorICAgICAg IC8qIFN0YW5kYXJkIGluc2VydGlvbiBzb3J0LiAqLw0KKyAgICAgICBmb3IgKGkgPSBsb3cgKyAx OyBpIDw9IGhpZ2g7IGkrKykgew0KKyAgICAgICAgICAgICAgIGlmICh0cGVfYWNsW2ldIDwgdHBl X2FjbFtsb3ddKSB7DQorICAgICAgICAgICAgICAgICAgICAgICB0cGVfYWNsW2xvd10gXj0gdHBl X2FjbFtpXTsNCisgICAgICAgICAgICAgICAgICAgICAgIHRwZV9hY2xbaV0gXj0gdHBlX2FjbFts b3ddOw0KKyAgICAgICAgICAgICAgICAgICAgICAgdHBlX2FjbFtsb3ddIF49IHRwZV9hY2xbaV07 DQorICAgICAgICAgICAgICAgfSANCisgICAgICAgfQ0KKyAgICAgICAvKiB0cGVfYWNsICovDQor ICAgICAgIGZvciAoaSA9IGxvdyArIDI7IGkgPD0gaGlnaDsgaSsrKSB7DQorICAgICAgICAgICAg ICAgaiA9IGk7DQorICAgICAgICAgICAgICAgbiA9IHRwZV9hY2xbaV07DQorICAgICAgICAgICAg ICAgd2hpbGUgKG4gPCB0cGVfYWNsW2ogLSAxXSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAg dHBlX2FjbFtqXSA9IHRwZV9hY2xbaiAtIDFdOw0KKyAgICAgICAgICAgICAgICAgICAgICAgai0t Ow0KKyAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICB0cGVfYWNsW2pdID0gbjsNCisg ICAgICAgfQ0KK30NCitzdGF0aWMgdm9pZCB0cGVfZ3JvdXBfc29ydCAoaW50IGxvdywgaW50IGhp Z2gpICAvKiAobGlzdCBsb3cgZWxlbWVudCwgbGlzdCBoaWdoIGVsZW1lbnQpICovDQorew0KKyAg ICAgICBpbnQgaSxqLG47DQorICAgICAgIC8qIFN0YW5kYXJkIGluc2VydGlvbiBzb3J0IGZvciB0 cGVfZ3JvdXBfYWNsLiAqLw0KKyAgICAgICBmb3IgKGkgPSBsb3cgKyAxOyBpIDw9IGhpZ2g7IGkr Kykgew0KKyAgICAgICAgICAgICAgIGlmICh0cGVfZ3JvdXBfYWNsW2ldIDwgdHBlX2dyb3VwX2Fj bFtsb3ddKSB7DQorICAgICAgICAgICAgICAgICAgICAgICB0cGVfZ3JvdXBfYWNsW2xvd10gXj0g dHBlX2dyb3VwX2FjbFtpXTsNCisgICAgICAgICAgICAgICAgICAgICAgIHRwZV9ncm91cF9hY2xb aV0gXj0gdHBlX2dyb3VwX2FjbFtsb3ddOw0KKyAgICAgICAgICAgICAgICAgICAgICAgdHBlX2dy b3VwX2FjbFtsb3ddIF49IHRwZV9ncm91cF9hY2xbaV07DQorICAgICAgICAgICAgICAgfSANCisg ICAgICAgfQ0KKyAgICAgICAvKiB0cGVfZ3JvdXBfYWNsICovDQorICAgICAgIGZvciAoaSA9IGxv dyArIDI7IGkgPD0gaGlnaDsgaSsrKSB7DQorICAgICAgICAgICAgICAgaiA9IGk7DQorICAgICAg ICAgICAgICAgbiA9IHRwZV9ncm91cF9hY2xbaV07DQorICAgICAgICAgICAgICAgd2hpbGUgKG4g PCB0cGVfZ3JvdXBfYWNsW2ogLSAxXSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgdHBlX2dy b3VwX2FjbFtqXSA9IHRwZV9ncm91cF9hY2xbaiAtIDFdOw0KKyAgICAgICAgICAgICAgICAgICAg ICAgai0tOw0KKyAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICB0cGVfZ3JvdXBfYWNs W2pdID0gbjsNCisgICAgICAgfQ0KK30NCisNCisvKiAgQXR0ZW1wdCB0byBhZGQgYW4gVUlEIGNh bmRpZGF0ZSB0byB0aGUgbGlzdC4gICovDQorc3RhdGljIGludCB0cGVfYWRkICh1aWRfdCBhZGRf Y2FuZGlkYXRlKQ0KK3sNCisgICAgICAgaW50IHJldHZhbCA9IC1FSU5WQUw7DQorDQorICAgICAg IC8qIEZ1bGwgbGlzdC4gKi8NCisgICAgICAgaWYgKHRwZV9hY2xfY2FuZGlkYXRlcyA9PSAoVFBF X0FDTF9TSVpFIC0gMikpIHsNCisgICAgICAgICAgICAgICBraW5mbygiVW5hYmxlIHRvIGFkZCB1 c2VyICVkLiBMaXN0IGlzIGZ1bGwuXG4iLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGFkZF9jYW5kaWRhdGUpOw0KKyAgICAgICAgICAgICAgIGdvdG8gb3V0Ow0KKyAgICAgICB9 DQorIA0KKyAgICAgICBpZiAoYWRkX2NhbmRpZGF0ZSA9PSAwKSB7DQorICAgICAgICAgICAgICAg a2luZm8oIkludmFsaWQgdXNlciBpZC4gQ2Fubm90IGFkZC5cbiIpOw0KKyAgICAgICAgICAgICAg IGdvdG8gb3V0Ow0KKyAgICAgICB9DQorDQorICAgICAgIC8qIERvbid0IGFkZCBkdXBsaWNhdGVz ICovDQorICAgICAgIGlmICgodHBlX3NlYXJjaChhZGRfY2FuZGlkYXRlKSkgPT0gTkFDSykgew0K KyAgICAgICAgICAgICAgIC8qIEFkZCB0byB0aGUgZW5kIG9mIHRoZSBsaXN0LCB0aGVuIHNvcnQu ICovDQorICAgICAgICAgICAgICAgdHBlX2FjbF9jYW5kaWRhdGVzKys7DQorICAgICAgICAgICAg ICAgdHBlX2FjbFt0cGVfYWNsX2NhbmRpZGF0ZXNdID0gYWRkX2NhbmRpZGF0ZTsNCisgICAgICAg ICAgICAgICB0cGVfYWNsW3RwZV9hY2xfY2FuZGlkYXRlcyArIDFdID0gJ1wwJzsgLyogdGVybWlu YXRlIGFycmF5ICovDQorICAgICAgICAgICAgICAgdHBlX3NvcnQoMCwgdHBlX2FjbF9jYW5kaWRh dGVzKTsNCisgICAgICAgICAgICAgICBraW5mbygiVUlEICVkIGFkZGVkIGFzIHRydXN0ZWQgdG8g YWNjZXNzIGNvbnRyb2wgbGlzdFxuIiwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhZGRfY2FuZGlkYXRlKTsNCisgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICBraW5m bygiRHVwbGljYXRlIFVJRCAlZCBub3QgYWRkZWRcbiIsDQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYWRkX2NhbmRpZGF0ZSk7DQorICAgICAgICAgICAgICAgZ290byBvdXQ7DQor ICAgICAgIH0NCisgICAgICAgcmV0dmFsID0gMDsNCitvdXQ6DQorICAgICAgIHJldHVybiByZXR2 YWw7DQorfQ0KKw0KKy8qICBBdHRlbXB0IHRvIGFkZCBhbiBHSUQgY2FuZGlkYXRlIHRvIHRoZSBs aXN0LiAgKi8NCitzdGF0aWMgaW50IHRwZV9ncm91cF9hZGQgKGdpZF90IGFkZF9jYW5kaWRhdGUp DQorew0KKyAgICAgICBpbnQgcmV0dmFsID0gLUVJTlZBTDsNCisNCisgICAgICAgLyogRnVsbCBs aXN0LiAqLw0KKyAgICAgICBpZiAodHBlX2FjbF9ncm91cF9jYW5kaWRhdGVzID09IChUUEVfQUNM X1NJWkUgLSAyKSkgew0KKyAgICAgICAgICAgICAgIGtpbmZvKCJVbmFibGUgdG8gYWRkIHVzZXIg JWQuIExpc3QgaXMgZnVsbC5cbiIsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YWRkX2NhbmRpZGF0ZSk7DQorICAgICAgICAgICAgICAgZ290byBvdXQ7DQorICAgICAgIH0NCisg DQorICAgICAgIGlmIChhZGRfY2FuZGlkYXRlID09IDApIHsNCisgICAgICAgICAgICAgICBraW5m bygiSW52YWxpZCB1c2VyaWQuIENhbm5vdCBhZGQuXG4iKTsNCisgICAgICAgICAgICAgICBnb3Rv IG91dDsNCisgICAgICAgfQ0KKw0KKyAgICAgICAvKiBEb24ndCBhZGQgZHVwbGljYXRlcyAqLw0K KyAgICAgICBpZiAoKHRwZV9zZWFyY2hfZ3JvdXAoYWRkX2NhbmRpZGF0ZSkpID09IE5BQ0spIHsN CisgICAgICAgICAgICAgICAvKiBBZGQgdG8gdGhlIGVuZCBvZiB0aGUgbGlzdCwgdGhlbiBzb3J0 LiAqLw0KKyAgICAgICAgICAgICAgIHRwZV9hY2xfZ3JvdXBfY2FuZGlkYXRlcysrOw0KKyAgICAg ICAgICAgICAgIHRwZV9ncm91cF9hY2xbdHBlX2FjbF9ncm91cF9jYW5kaWRhdGVzXSA9IGFkZF9j YW5kaWRhdGU7DQorICAgICAgICAgICAgICAgdHBlX2dyb3VwX2FjbFt0cGVfYWNsX2dyb3VwX2Nh bmRpZGF0ZXMgKyAxXSA9ICdcMCc7IC8qIHRlcm1pbmF0ZSBhcnJheSAqLw0KKyAgICAgICAgICAg ICAgIHRwZV9ncm91cF9zb3J0KDAsIHRwZV9hY2xfZ3JvdXBfY2FuZGlkYXRlcyk7DQorICAgICAg ICAgICAgICAga2luZm8oIkdJRCAlZCBhZGRlZCBhcyB0cnVzdGVkIHRvIGFjY2VzcyBjb250cm9s IGxpc3RcbiIsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkX2NhbmRpZGF0 ZSk7DQorICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAga2luZm8oIkR1cGxpY2F0ZSBH SUQgJWQgbm90IGFkZGVkXG4iLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFk ZF9jYW5kaWRhdGUpOw0KKyAgICAgICAgICAgICAgIGdvdG8gb3V0Ow0KKyAgICAgICB9DQorICAg ICAgIHJldHZhbCA9IDA7DQorb3V0Og0KKyAgICAgICByZXR1cm4gcmV0dmFsOw0KK30gDQorIA0K Ky8qICBBdHRlbXB0IHRvIHJlbW92ZSBhIGNhbmRpZGF0ZSBmcm9tIHRoZSBsaXN0LiAgT25seSBm YWlscyBpZiB0aGUgZW50cnkgaXMgKi8NCisvKiAgbm90IHRoZXJlLiAqLw0KK3N0YXRpYyBpbnQg dHBlX3JlbW92ZSAodWlkX3QgcmVtX2NhbmRpZGF0ZSkNCit7DQorICAgICAgIGludCBuOw0KKyAg ICAgICBpbnQgcmV0dmFsID0gLUVJTlZBTDsNCisgICAgICAgaWYgKHRwZV9hY2xfY2FuZGlkYXRl cyA9PSAwKSB7DQorICAgICAgICAgICAgICAgLyogRW1wdHkgbGlzdCAqLw0KKyAgICAgICAgICAg ICAgIGdvdG8gb3V0Ow0KKyAgICAgICB9DQorICAgICAgIGlmIChyZW1fY2FuZGlkYXRlID09IDAp IHsNCisgICAgICAgICAgICAgICBraW5mbygiSW52YWxpZCB1c2VyaWQuIENhbm5vdCByZW1vdmUu XG4iKTsNCisgICAgICAgICAgICAgICBnb3RvIG91dDsNCisgICAgICAgfQ0KKyANCisgICAgICAg biA9IHRwZV9zZWFyY2gocmVtX2NhbmRpZGF0ZSk7DQorICAgICAgIGlmIChuICE9IE5BQ0spIHsN CisgICAgICAgICAgICAgICAvKiBSZW1vdmUgY2FuZGlkYXRlIChtYXJrIHNsb3QgYXMgdW51c2Vk KSwgcmVzb3J0IHRoZSBsaXN0LiAqLw0KKyAgICAgICAgICAgICAgIHRwZV9hY2xbbl0gPSBUUEVf SU5JVElBTElaRVI7DQorICAgICAgICAgICAgICAgdHBlX2FjbF9jYW5kaWRhdGVzLS07DQorICAg ICAgICAgICAgICAgdHBlX3NvcnQoMCwgdHBlX2FjbF9jYW5kaWRhdGVzKTsNCisgICAgICAgICAg ICAgICBraW5mbygiVUlEICVkIHJlbW92ZWQgZnJvbSB0cnVzdCBsaXN0XG4iLA0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHJlbV9jYW5kaWRhdGUpOw0KKyAgICAgICAgICAgICAg IHJldHZhbCA9IDA7DQorICAgICAgICAgICAgICAgZ290byBvdXQ7DQorICAgICAgIH0NCisgICAg ICAgLyogTm90IGZvdW5kLiAqLw0KKyAgICAgICBraW5mbygiVUlEICVkIG5vdCBmb3VuZCBpbiB0 cnVzdCBsaXN0XG4iLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICByZW1fY2FuZGlkYXRlKTsN CitvdXQ6DQorICAgICAgIHJldHVybiByZXR2YWw7DQorfQ0KKw0KKy8qIEdJRCByZW1vdmluZyAq Lw0KK3N0YXRpYyBpbnQgdHBlX2dyb3VwX3JlbW92ZSAoZ2lkX3QgcmVtX2NhbmRpZGF0ZSkNCit7 DQorICAgICAgIGludCBuOw0KKyAgICAgICBpbnQgcmV0dmFsID0gLUVJTlZBTDsNCisgICAgICAg aWYgKHRwZV9hY2xfZ3JvdXBfY2FuZGlkYXRlcyA9PSAwKSB7DQorICAgICAgICAgICAgICAgLyog RW1wdHkgZ3JvdXBzIGxpc3QgKi8NCisgICAgICAgICAgICAgICBnb3RvIG91dDsNCisgICAgICAg fQ0KKyAgICAgICBpZiAocmVtX2NhbmRpZGF0ZSA9PSAwKSB7DQorICAgICAgICAgICAgICAga2lu Zm8oIkludmFsaWQgR0lELiBDYW5ub3QgcmVtb3ZlLlxuIik7DQorICAgICAgICAgICAgICAgZ290 byBvdXQ7DQorICAgICAgIH0NCisgDQorICAgICAgIG4gPSB0cGVfc2VhcmNoX2dyb3VwKHJlbV9j YW5kaWRhdGUpOw0KKyAgICAgICBpZiAobiAhPSBOQUNLKSB7DQorICAgICAgICAgICAgICAgLyog UmVtb3ZlIGNhbmRpZGF0ZSAobWFyayBzbG90IGFzIHVudXNlZCksIHJlc29ydCB0aGUgbGlzdC4g Ki8NCisgICAgICAgICAgICAgICB0cGVfZ3JvdXBfYWNsW25dID0gVFBFX0lOSVRJQUxJWkVSOw0K KyAgICAgICAgICAgICAgIHRwZV9hY2xfZ3JvdXBfY2FuZGlkYXRlcy0tOw0KKyAgICAgICAgICAg ICAgIHRwZV9ncm91cF9zb3J0KDAsIHRwZV9hY2xfZ3JvdXBfY2FuZGlkYXRlcyk7DQorICAgICAg ICAgICAgICAga2luZm8oIkdJRCAlZCByZW1vdmVkIGZyb20gdHJ1c3QgbGlzdFxuIiwNCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1fY2FuZGlkYXRlKTsNCisgICAgICAgICAg ICAgICByZXR2YWwgPSAwOw0KKyAgICAgICAgICAgICAgIGdvdG8gb3V0Ow0KKyAgICAgICB9DQor ICAgICAgIC8qIE5vdCBmb3VuZC4gKi8NCisgICAgICAga2luZm8oIkdJRCAlZCBub3QgZm91bmQg aW4gdHJ1c3QgbGlzdFxuIiwNCisgICAgICAgICAgICAgICAgICAgICAgICAgcmVtX2NhbmRpZGF0 ZSk7DQorb3V0Og0KKyAgICAgICByZXR1cm4gcmV0dmFsOw0KK30NCisNCisNCisvKiBCZWdpbm5p bmcgb2YgYSBzeXNmcyBzdWJzeXN0ZW0gZm9yIHRwZSAqLw0KK3N0YXRpYyBzdHJ1Y3Qgc3Vic3lz dGVtIHRwZWZzX3N1YnN5czsNCisNCitzdHJ1Y3QgdHBlX2xpc3Qgew0KKyAgICAgICBjaGFyICpu YW1lOw0KKyANCisgICAgICAgc3RydWN0IGxpc3RfaGVhZCAgICAgICAgc2xvdF9saXN0Ow0KKyAg ICAgICBzd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3JvdXBfYWNsX2xvY2spOw0KKyAgICAgICBpZiAocmV0 dmFsKSB7DQorICAgICAgICAgICAgICAgcmV0dXJuIHJldHZhbDsNCisgICAgICAgfSANCisgICAg ICAgcmV0dXJuIGNvdW50Ow0KKw0KK30NCitzdGF0aWMgc3NpemVfdCB0cnVzdGVkbGlzdGFkZF9n cm91cF9yZWFkX2ZpbGUgKHN0cnVjdCB0cGVfbGlzdCAqbGlzdCwgY2hhciAqYnVmKQ0KK3sNCisg ICAgICAgaW50IGk7DQorICAgICAgIGludCByZXR2YWwgPSAwOw0KKyAgICAgICBjaGFyICpncm91 cCA9IE5VTEw7DQorICAgICAgIGNoYXIgYnVmZmVyWzQwMF07DQorDQorICAgICAgIGdyb3VwID0g KGNoYXIgKilfX2dldF9mcmVlX3BhZ2UoR0ZQX0tFUk5FTCk7DQorICAgICAgIGlmICghZ3JvdXAp DQorICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07DQorDQorICAgICAgIGlmICh0cGVfYWNs ID09IE5VTEwpIHsNCisgICAgICAgICAgICAgIGtpbmZvKCJFbXB0eSB1c2VyIGdyb3VwcyBBY2Nl c3MgQ29udHJvbCBMaXN0XG4iKTsNCisgICAgICAgICAgICAgICByZXR1cm4gLUVOT0RBVEE7IA0K KyAgICAgICB9DQorDQorICAgICAgIGJ1ZmZlclswXSA9ICdcMCc7DQorICAgICAgIGtpbmZvKCIl ZCB0cnVzdGVkIGdyb3VwKHMpOiBcbiIsIHRwZV9hY2xfZ3JvdXBfY2FuZGlkYXRlcyk7DQorICAg ICAgIHNwaW5fbG9jaygmdHBlX2dyb3VwX2FjbF9sb2NrKTsNCisgICAgICAgZm9yIChpPTA7IGkg PCB0cGVfYWNsX2dyb3VwX2NhbmRpZGF0ZXM7IGkrKykgew0KKyAgICAgICAgICAgICAgIHByaW50 ayhLRVJOX0lORk8gIiVkICIsIHRwZV9ncm91cF9hY2xbaV0pOw0KKyAgICAgICAgICAgICAgIHJl dHZhbCA9IHNwc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5maWxlLT5mX2RlbnRyeS0+ZF9wYXJlbnQtPmRfaW5vZGUtPmlfdWlk Ow0KKyAgICAgICBtb2RlX3QgcHRobW9kZSA9IGJwcm0tPmZpbGUtPmZfZGVudHJ5LT5kX3BhcmVu dC0+ZF9pbm9kZS0+aV9tb2RlOw0KKyAgICAgICBpZigoIVRSVVNURURfUEFUSChwdGhtb2RlLCBw dGh1aWQpKSAmJiAoIVRSVVNURURfVVNFUihjdXJyZW50LT5ldWlkKSkgDQorICAgICAgIAkmJiAo IVRSVVNURURfR1JPVVAoYnBybS0+ZV9naWQpKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAg a2luZm8oIlVudHJ1c3RlZCBleGVjdXRpb246ICVzICINCisJCQkJInVpZC9ldWlkPSVkLyVkIGdp ZC9lZ2lkPSVkLyVkIHBpZD0lZCINCisJCQkJIlxuIiwgYnBybS0+ZmlsZW5hbWUsIGN1cnJlbnQt PnVpZCwgYnBybS0+ZV91aWQsDQorCQkJCSAgICAgIGN1cnJlbnQtPmdpZCwgYnBybS0+ZV9naWQs IGN1cnJlbnQtPnBpZCk7DQorICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVBQ0NFUzsN CisgICAgICAgfSANCisgICAgICAgcmV0dXJuIDA7DQorfQ0KKw0KK3N0cnVjdCBzZWN1cml0eV9v cGVyYXRpb25zIHRwZV9zZWN1cml0eV9vcHMgPSB7DQorICAgICAgICBicHJtX3NldF9zZWN1cml0 eTogICAgICAgICAgICAgIHRwZV9icHJtX3NldF9zZWN1cml0eSwNCit9Ow0KKw0KK3N0YXRpYyBp bnQgX19pbml0IHRwZV9tb2R1bGVfaW5pdCAodm9pZCkNCit7DQorICAgICAgIGludCByZXR2YWw7 DQorICAgICAgIGludCBjZm9vID0gMDsNCisgICAgICAgLyogcmVnaXN0ZXIgb3Vyc2VsdmVzIHdp dGggdGhlIHNlY3VyaXR5IGZyYW1ld29yayAqLw0KKyAgICAgICBpZiAocmVnaXN0ZXJfc2VjdXJp dHkgKCZ0cGVfc2VjdXJpdHlfb3BzKSkgew0KKyAgICAgICAgICAgICAgIHByaW50ayAoS0VSTl9J TkZPDQorICAgICAgICAgICAgICAgICAgICAgICAiRmFpbHVyZSByZWdpc3RlcmluZyB0cGUgbW9k dWxlIHdpdGggdGhlIGtlcm5lbFxuIik7DQorICAgICAgICAgICAgICAgLyogdHJ5IHJlZ2lzdGVy aW5nIHdpdGggcHJpbWFyeSBtb2R1bGUgKi8NCisgICAgICAgICAgICAgICBpZiAobW9kX3JlZ19z ZWN1cml0eSAoTEVHQUNZX05BTUUsICZ0cGVfc2VjdXJpdHlfb3BzKSkgew0KKyAgICAgICAgICAg ICAgICAgICAgICAgcHJpbnRrIChLRVJOX0lORk8gIkZhaWx1cmUgcmVnaXN0ZXJpbmcgdHBlIG1v ZHVsZSAiDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ3aXRoIHByaW1hcnkgc2Vj dXJpdHkgbW9kdWxlLlxuIik7DQorICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZB TDsNCisgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgc2Vjb25kYXJ5ID0gMTsNCisg ICAgICAgfQ0KKyANCisgICAgICAgLyogcmVnaXN0ZXIgdHBlIHN1YnN5c3RlbSAqLw0KKyAgICAg ICBraW5mbygiUmVnaXN0ZXJpbmcgVFBFIHN1YnN5c3RlbS5cbiIpOw0KKyAgICAgICByZXR2YWwg PSBzdWJzeXN0ZW1fcmVnaXN0ZXIoJnRwZWZzX3N1YnN5cyk7DQorICAgICAgIGlmIChyZXR2YWwp IHsNCisgICAgICAgICAgICAgICBraW5mbygic3Vic3lzdGVtX3JlZ2lzdGVyIGZhaWxlZCB3aXRo ICVkXG4iLCByZXR2YWwpOw0KKyAgICAgICAgICAgICAgIHJldHVybiByZXR2YWw7DQorICAgICAg IH0NCisgICAgICAga2luZm8oIlJlZ2lzdGVyaW5nIHRwZWZzIHN1cHBvcnQgZm9yIH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AgICAgICogY29t cG9uZW50IG9mIFRQRS4gVGhpcyB3aWxsIGJlIA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKiBmaXhlZCBsYXRlciBvbi4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICovIA0KKyANCisjZGVmaW5lIFRQRV9JTklUSUFMSVpFUiAtMSAgICAgIC8qIEEgVUlEIHRoYXQg aXNuJ3QgdXNlZCAqLw0KKw0KKyNkZWZpbmUgQUNLICAgICAgICAgICAgIDEgICAgICAgLyogcG9z aXRpdmUgYWNrbm93bGVkZ2VtZW50ICovDQorI2RlZmluZSBOQUNLICAgICAgICAgICAgLTEgICAg ICAvKiBuZWdhdGl2ZSBhY2tub3dsZWRnZW1lbnQgKi8NCisjZGVmaW5lIERVUCAgICAgICAgICAg IDMgICAgICAgLyogZHVwbGljYXRlIGlkIHJldHVybiBmb3IgdHBlX2FkZCAqLw0KKw0KKy8qDQor ICogIFZlcmlmeSB0aGUgcGF0aC4gDQorICovDQorI2RlZmluZSBUUlVTVEVEX1BBVEgobW9kZSwg dWlkKSBcDQorKCEobW9kZSAmIChTX0lXR1JQIHwgU19JV09USCkpICYmICh1aWQgPT0gMCkpDQor DQorc3RhdGljIHVpZF90IHRwZV9hY2xbVFBFX0FDTF9TSVpFXTsgICAgLyogdHJ1c3RlZCB1c2Vy cyBsaXN0ICovDQorc3RhdGljIGdpZF90IHRwZV9ncm91cF9hY2xbVFBFX0FDTF9TSVpFXTsgICAg LyogdHJ1c3RlZCB1c2VyIGdyb3VwcyBsaXN0ICovDQorc3RhdGljIGludCB0cGVfYWNsX2NhbmRp ZGF0ZXM7ICAgICAgICAgLyogbnVtYmVyIG9mIHVzZXJzIG9uIHRoZSBsaXN0ICovDQorc3RhdGlj IGludCB0cGVfYWNsX2dyb3VwX2NhbmRpZGF0ZXM7ICAgICAgICAgLyogbnVtYmVyIG9mIHVzZXIg Z3JvdXBzIG9uIHRoZSBsaXN0ICovDQorDQorLyoNCisg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AgICAgCQl0cGVfYWNsX2dyb3VwX2Nh bmRpZGF0ZXMgPSAxOyANCisgICAgICAgCX0NCisgICAgICAgdHBlX2FjbFswXSA9IDA7DQorICAg ICAgIGlmICghKHRwZV90cnVzdGVkX2dpZCA9PSAwKSkgDQorICAgICAgIAl7DQorICAgICAgIAkJ dHBlX2dyb3VwX2FjbFswXSA9IDA7DQorICAgICAgIAkJDQorICAgICAgIAkJdHBlX2dyb3VwX2Fj bFsxXSA9IHRwZV90cnVzdGVkX2dpZDsNCisgICAgICAgCX0gZWxzZSB7DQorICAgICAgIAkJdHBl X2dyb3VwX2FjbFswXSA9IDA7DQorICAgICAgIAl9DQorfQ0KKw0KKy8qICBMb2NhdGUgYSB1aWQg aW4gdGhlIGxpc3QgKi8NCitzdGF0aWMgaW5saW5lIGludCB0cGVfc2VhcmNoICh1aWRfdCBjYW5k aWRhdGUpDQoreyANCisgICAgICAgaW50IGk7DQorICAgICAgIGZvciAoaSA9IDA7IGkgPCB0cGVf YWNsX2NhbmRpZGF0ZXM7IGkrKykgew0KKyAgICAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPT0g dHBlX2FjbFtpXSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7DQorICAgICAg ICAgICAgICAgfQ0KKyAgICAgICB9DQorICAgICAgIHJldHVybiBOQUNLOw0KK30NCisNCisvKiAg VmVyaWZ5IGEgY2FuZGlkYXRlIHVzZXIuICovDQorc3RhdGljIGlubGluZSBpbnQgdHBlX3Zlcmlm eSAodWlkX3QgY2FuZGlkYXRlKQ0KK3sNCisgICAgICAgaWYgKCh0cGVfc2VhcmNoKGNhbmRpZGF0 ZSkpICE9IE5BQ0spIHsgDQorICAgICAgICAgICAgICAgcmV0dXJuIChBQ0spOw0KKyAgICAgICB9 DQorICAgICAgIHJldHVybiAoTkFDSyk7DQorfQ0KKw0KKy8qICBWZXJpZnkgYSBjYW5kaWRhdGUg dXNlciBncm91cC4gKi8NCitzdGF0aWMgaW5saW5lIGludCB0cGVfc2VhcmNoX2dyb3VwIChnaWRf dCBncm91cF9jYW5kaWRhdGUpDQoreyANCisgICAgICAgaW50IGk7DQorICAgICAgIGZvciAoaSA9 IDA7IGkgPCB0cGVfYWNsX2dyb3VwX2NhbmRpZGF0ZXM7IGkrKykgew0KKyAgICAgICAgICAgICAg IGlmIChncm91cF9jYW5kaWRhdGUgPT0gdHBlX2dyb3VwX2FjbFtpXSkgew0KKyAgICAgICAgICAg ICAgICAgICAgICAgcmV0dXJuIGk7DQorICAgICAgICAgICAgICAgfQ0KKyAgICAgICB9DQorICAg ICAgIHJldHVybiBOQUNLOw0KK30NCitzdGF0aWMgaW5saW5lIGludCB0cGVfZ3JvdXBfdmVyaWZ5 IChnaWRfdCBncm91cF9jYW5kaWRhdGUpDQorew0KKyAgICAgaWYgKCh0cGVfc2VhcmNoX2dyb3Vw KGdyb3VwX2NhbmRpZGF0ZSkpICE9IE5BQ0spIHsNCisgICAgICAgICAgICAgICByZXR1cm4gKEFD Syk7DQorICAgICAgIH0NCisgICAgICAgcmV0dXJuIChOQUNLKTsNCit9DQorDQorI2VuZGlmICAv KiBfX1RQRV9IICovDQo= --=-5Hk3cYK5sQ1w9xikxsHY-- --=-WvlOs3B+kFDWnW7qSdaj 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) iD8DBQBB3KfEDcEopW8rLewRAjamAJ9mMdsDEWOk5FKxtlSlk2blFNXrXwCgmDcJ U+70VYcOQUnvnYp/7Dr7bUQ= =XNrl -----END PGP SIGNATURE----- --=-WvlOs3B+kFDWnW7qSdaj-- - 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/