Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242290

Re: [PATCH] af_unix: introduce unix_sk_const helper

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] af_unix: introduce unix_sk_const helper
Date 2015-10-08 14:20 +0200
Message-ID <qhikW-3cc-13@gated-at.bofh.it> (permalink)
References <qgHv4-AR-15@gated-at.bofh.it> <qhgVQ-12b-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thursday 08 October 2015 04:03:32 David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 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 <arnd@arndb.de>
> > ---
> > 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
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] af_unix: introduce unix_sk_const helper Arnd Bergmann <arnd@arndb.de> - 2015-10-06 23:00 +0200
  Re: [PATCH] af_unix: introduce unix_sk_const helper David Miller <davem@davemloft.net> - 2015-10-08 12:50 +0200
    Re: [PATCH] af_unix: introduce unix_sk_const helper Arnd Bergmann <arnd@arndb.de> - 2015-10-08 14:20 +0200

csiph-web