From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750849AbeBPVWv (ORCPT ); Fri, 16 Feb 2018 16:22:51 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:59210 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbeBPVWt (ORCPT ); Fri, 16 Feb 2018 16:22:49 -0500 Date: Fri, 16 Feb 2018 16:22:48 -0500 (EST) Message-Id: <20180216.162248.2136274977153072425.davem@davemloft.net> To: dhowells@redhat.com Cc: netdev@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] rxrpc: Work around usercopy check From: David Miller In-Reply-To: <151873554032.16545.2581958777736418547.stgit@warthog.procyon.org.uk> References: <151873554032.16545.2581958777736418547.stgit@warthog.procyon.org.uk> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells Date: Thu, 15 Feb 2018 22:59:00 +0000 > Due to a check recently added to copy_to_user(), it's now not permitted to > copy from slab-held data to userspace unless the slab is whitelisted. This > affects rxrpc_recvmsg() when it attempts to place an RXRPC_USER_CALL_ID > control message in the userspace control message buffer. A warning is > generated by usercopy_warn() because the source is the copy of the > user_call_ID retained in the rxrpc_call struct. > > Work around the issue by copying the user_call_ID to a variable on the > stack and passing that to put_cmsg(). > > The warning generated looks like: ... > Reported-by: Jonathan Billings > Signed-off-by: David Howells > Acked-by: Kees Cook > Tested-by: Jonathan Billings Applied, thanks David.