From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbbJHMLx (ORCPT ); Thu, 8 Oct 2015 08:11:53 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:54056 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752514AbbJHMLv (ORCPT ); Thu, 8 Oct 2015 08:11:51 -0400 From: Arnd Bergmann To: David Miller Cc: netdev@vger.kernel.org, aconole@bytheb.org, edumazet@google.com, james.l.morris@oracle.com, linux-security-module@vger.kernel.org, serge@hallyn.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] af_unix: introduce unix_sk_const helper Date: Thu, 08 Oct 2015 14:11:41 +0200 Message-ID: <5878507.y5cIDTsIKy@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151008.040332.1651208312284048708.davem@davemloft.net> References: <10735490.HC94hyceBX@wuerfel> <20151008.040332.1651208312284048708.davem@davemloft.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:d/RGNVoPjxOMnkmrNhCUZkjBxgIYDRLr3dYqbM3AhOSOnLYsSgL bcexAMWtSLncBmdf+UjIWnv4nRFdyc7lbJJXSQUBcW6XMyUevPR/YSzbQtax1yosii50eoZ COViZd/Dgb/td+9eAIsrDwQD9Pl1QLzVss7OHQEszBSoZo6Rkb+n5aDj3D8VJlbaElipxsF FuHsiFft3M2AKDLLLwXFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:wNYP+zkFD1U=:eNp0lXGhjYEZ4pzZgAHmH1 i9B90QY4dER7EJFW8tWwiEPllBZwogXb7tW1bWeIXpxx+CqV0OfXYX3EFjysVBCW3O91E32XM 16kTHieHQHD94xMwQ5cXgC+Ht6YjKbXNRwkYoi1zwmLWSyr2w+XPhEuXMBlNpxX2d3wunMuKq ouTY0yPGcCMfDKrohF+CkPM8R0tGUU5QYR7c0rnUeeSXEwPnNbg/zOifs7iXp+j1uauH3ocBI yDz5eTSn4AX70yiMYNrYgV1zVew6Ii7HZojPA0tI7F7GH7CRXHeUYVh1rJN2HzHGGYvTRSvxL 7HUYK9W4wNuZLPqh6Wq8Jeol1FRKyNFJPBLabiRSUor8PIIMNzJW89K97oD/NNrlAS3mjCYyS P2No0UsAGkJ868771+mZPjEznmKqCdoXSTgdEqOBTGWOYi8BGm3ffQlyfTM+11e7CTTPCDXMR olej4u77ZVksOOV1dy4FbNaK5bzpGmVEgYKL/ge2QZASKxU76f/wYnyAuF7Q+ZEQI46PpPfhQ XX5a+OsdOS3XGtDqEQKUZUAs2e1WRe/zvQsHgOg5QqK12RzES17wtwAd04daqiw6EP68brQ4R HFwvp3v0nQLuxjak6jF8T+DGsdLmXO1QBpwWfjwJT2UXLKiXWVDE0ysnaquLI/LtrTKYkJxIW 79C5lUQ2F+SrhnveE9jKG8DO9pM3+4jaYQaK10KApdeI9KOfy7kUhHiOCzgfjgUy4uUguz/PV H7K5Ae2rde7bxn2Y Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 08 October 2015 04:03:32 David Miller wrote: > From: Arnd Bergmann > Date: Tue, 06 Oct 2015 22:52:46 +0200 > > > Commit 124613012db1 ("af_unix: Convert the unix_sk macro to an inline > > function for type safety") was recently added to catch incorrect > > uses of the unix_sk helper using compiler warnings. > > > > It has now caught one such case in lsm_audit.c. The code is technically > > correct, but as it converts a const pointer to a non-const pointer, > > the annotation got lost, which gcc now warns about. > > > > This patch avoids the warning by introducing an additional helper > > that has const input and output, which makes the lsm_audit code build > > cleanly again. > > > > Signed-off-by: Arnd Bergmann > > --- > > I'm not entirely happy with this workaround myself, but could not come > > up with a better one. > > You can make the argument unconditionally const, as Paul Moore has done > in a separate patch submission. Ok, I see now how Paul's "audit: constify parts of common_audit_data and lsm_network_audit" patch caused the problem and is now gone from linux-next. That seems nicer indeed. Arnd