From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out6.electric.net ([192.162.217.192]:58457 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275AbdJRNUk (ORCPT ); Wed, 18 Oct 2017 09:20:40 -0400 From: David Laight To: 'SF Markus Elfring' , Joe Perches , "linux-integrity@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" CC: Jason Gunthorpe , "kernel-janitors@vger.kernel.org" , "Stefan Berger" , Alexander Steffen , Nayna Jain , Jerry Snitselaar , "linux-kernel@vger.kernel.org" , Jarkko Sakkinen , James Bottomley , Julia Lawall , Corentin Labbe , Kenneth Goldman , Paul Mackerras , =?utf-8?B?UGV0ZXIgSMO8d2U=?= , Andy Shevchenko , Dan Carpenter Subject: RE: Adjusting further size determinations? Date: Wed, 18 Oct 2017 12:58:43 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD009ACE3@AcuExch.aculab.com> References: <1d3516a2-a8e6-9e95-d438-f115fac84c7f@users.sourceforge.net> <20171016183139.otyh3m5c5yurtmow@linux.intel.com> <20171016183512.3bz6x4b6lbhpbkje@linux.intel.com> <20171017085124.pkrjzghcf5wmcydc@mwanda> <1508255833.3129.33.camel@HansenPartnership.com> <1508280210.6530.32.camel@perches.com> <1508318326.6806.1.camel@perches.com> <026d582729b849b780fbaa06fb8bc79e@infineon.com> <1508322510.6806.3.camel@perches.com> <1508327383.6806.7.camel@perches.com> <0fc1f522-8772-d859-a9b0-cb3b6931c862@users.sourceforge.net> In-Reply-To: <0fc1f522-8772-d859-a9b0-cb3b6931c862@users.sourceforge.net> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-integrity-owner@vger.kernel.org List-ID: From: SF Markus Elfring > >>>> Unpleasant consequences are possible in both cases. > >> How much do you care to reduce the failure probability further? > > > > Zero. > > I am interested to improve the software situation a bit more here. There are probably better places to spend your time! If you want 'security' for kmalloc() then: #define KMALLOC_TYPE(flags) (type *)kmalloc(sizeof (type), flags) #define KMALLOC(ptr, flags) *(ptr) = KMALLOC_TYPE(typeof *(ptr), flags) and change: ptr = kmalloc(sizeof *ptr, flags); to: KMALLOC(&ptr, flags); But it is all churn for churn's sake. David