From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753130AbbDGAsY (ORCPT ); Mon, 6 Apr 2015 20:48:24 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:46361 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbbDGAsW (ORCPT ); Mon, 6 Apr 2015 20:48:22 -0400 X-Greylist: delayed 341 seconds by postgrey-1.27 at vger.kernel.org; Mon, 06 Apr 2015 20:48:22 EDT X-Sasl-enc: xvHL/kH1zvHewGPvilkzZo47LSnSTaMW780mll+DbVHI 1428367360 Message-ID: <1428367355.2705.6.camel@pluto.fritz.box> Subject: Re: [RFC PATCH 5 1/7] kmod - add workqueue service thread store From: Ian Kent To: David Howells Cc: Kernel Mailing List , Oleg Nesterov , Trond Myklebust , "J. Bruce Fields" , Benjamin Coddington , Al Viro , Jeff Layton , "Eric W. Biederman" Date: Tue, 07 Apr 2015 08:42:35 +0800 In-Reply-To: <18729.1427978611@warthog.procyon.org.uk> References: <20150331031441.10464.24655.stgit@pluto.fritz.box> <20150331030340.10464.30272.stgit@pluto.fritz.box> <18729.1427978611@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-04-02 at 13:43 +0100, David Howells wrote: > Ian Kent wrote: > > > +static struct umh_wq_entry *umh_wq_find_entry(int token) > > +{ > > + struct umh_wq_entry *this, *entry; > > + struct hlist_head *bucket; > > + unsigned int hash; > > + > > + hash = hash_32((unsigned long) token, UMH_WQ_HASH_SHIFT); > > + bucket = &umh_wq_hash[hash]; > > + > > + entry = ERR_PTR(-ENOENT); > > + if (hlist_empty(bucket)) > > + goto out; > > + > > + hlist_for_each_entry(this, bucket, umh_wq_hlist) { > > + if (this->token == token) { > > + entry = this; > > + break; > > + } > > + } > > +out: > > + return entry; > > +} > > Can "struct umh_wq_entry *" be used as the token? Probably not, for example. Couldn't a user set a different workqueue_struct and have it used for execution. Not sure what that would get the user but it sounds like the original reason we couldn't allow execution directly within the caller environment. > > David