From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbdAOP01 (ORCPT ); Sun, 15 Jan 2017 10:26:27 -0500 Received: from mout.web.de ([212.227.17.11]:56182 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbdAOP0Z (ORCPT ); Sun, 15 Jan 2017 10:26:25 -0500 Subject: [PATCH 26/46] selinux: Improve another size determination in sens_read() To: linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, Eric Paris , James Morris , Paul Moore , "Serge E. Hallyn" , Stephen Smalley , William Roberts References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <6aec69ea-27e6-da3f-8a54-e1f12c78cc2e@users.sourceforge.net> Date: Sun, 15 Jan 2017 16:26:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:zUj/sAhxgCLTJcOWUbBsnYvishFhrB2i2EgxuFqFKgpQjWGRv9v 1YwoxjoNozytzU9UamGpmLM6ZQpJ6aGYb9VQHCankUf4yqEc3kqvzh4++hL4+wOv3/F7jYv 78ha4cpmr0eCNVzGzTocLqvafgp92HflBMPuCC8HzUSWKFkdja5lfb56zL8S1F1cJxeYrj8 aF0O5Lctfu6ZQhmLg6wzg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZofIXYsKmD8=:GNKm7Ff/Op+M3lbK64vvAt kA1BSMWZITVjX5Pye6vjMoE/Ef9PMt+vgzcXxK5+kLpJlRK21NFbQb2NA6BXy65hinExTdVKM nB8EvgFVUd1vqICAudnauYRImx4lUJofp1J2DxheipgUUswuVCYIj/pNj9yGxfnCAlxSa3+xz BmwLYDY8iidXwE4fbUt354lCGrKregheb6rQLTAv7IVvdYDvBXZTVxFVvXQrrRJ85sZ/Xmtwv n5OOpvKJfTavw20K8SaIEEd+c0kUobdV7IhCRRor9NYV3MXfpc5iIs9iZ/M9WKc4OW/PoM0EC sB5PK72+pv/dlpQ29h4HAJktbrLxvYzUalydmjVkYcyKF3W2PD5v/p3iTRZjbP/QGuYlYuwW5 MC8nFkO3CKd7AgJzAARXBLV8BrYTSiX9q6ddSIcAOsyJilEy3X8X+9gCrwCNZiMiuexSkRvWT ER8ZK5y0+Uaz2TI5450S2iqZw1JB9GUyotbu/tvAtyVjDrC2FraMX7gtB6a3P806TbzYmZ62q 3cKADLaQdSD3aNyO+2KT2cL74Brk1s/lsPupxHZRUblqNBzMkVZY3D9YEPHGgd/eERGN6G1LB KYX1ySF+GD3chX2PxiQw/mI7ryWe1zyx9rwM00LbHVI6BVVHoDqyg+qUVpWshP99L3cjDnxzq ksk7jZAHGPRms7HLP1PyzeXN5Ib4gT0XjajG+QiO5pBywnRywQpu8UKmBseYAAX84rWtKIaBH uXek2PmPFKz/6FMn6nfExrBaiEgcOlkFvyOOTnjLxjaIhTmjhk2PtOPBMxe3JFGdTCNR4pFu2 D8XtS+W Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sat, 14 Jan 2017 21:52:55 +0100 Replace the specification of a data type by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- security/selinux/ss/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 5caa1fa5ea80..edfcfd3bbc60 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1609,7 +1609,7 @@ static int sens_read(struct policydb *p, struct hashtab *h, void *fp) goto bad; rc = -ENOMEM; - levdatum->level = kmalloc(sizeof(struct mls_level), GFP_ATOMIC); + levdatum->level = kmalloc(sizeof(*levdatum->level), GFP_ATOMIC); if (!levdatum->level) goto bad; -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Sun, 15 Jan 2017 15:26:04 +0000 Subject: [PATCH 26/46] selinux: Improve another size determination in sens_read() Message-Id: <6aec69ea-27e6-da3f-8a54-e1f12c78cc2e@users.sourceforge.net> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, Eric Paris , James Morris , Paul Moore , "Serge E. Hallyn" , Stephen Smalley , William Roberts Cc: LKML , kernel-janitors@vger.kernel.org From: Markus Elfring Date: Sat, 14 Jan 2017 21:52:55 +0100 Replace the specification of a data type by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- security/selinux/ss/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 5caa1fa5ea80..edfcfd3bbc60 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1609,7 +1609,7 @@ static int sens_read(struct policydb *p, struct hashtab *h, void *fp) goto bad; rc = -ENOMEM; - levdatum->level = kmalloc(sizeof(struct mls_level), GFP_ATOMIC); + levdatum->level = kmalloc(sizeof(*levdatum->level), GFP_ATOMIC); if (!levdatum->level) goto bad; -- 2.11.0