Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751859AbbGIWxA (ORCPT ); Thu, 9 Jul 2015 18:53:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48794 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbbGIWww (ORCPT ); Thu, 9 Jul 2015 18:52:52 -0400 Date: Fri, 10 Jul 2015 00:51:17 +0200 From: Oleg Nesterov To: Frederic Weisbecker Cc: LKML , Christoph Lameter , Rik van Riel , Andrew Morton Subject: Re: [RFC PATCH 5/5] kmod: Handle UMH_WAIT_PROC from system unbound workqueue Message-ID: <20150709225117.GB17528@redhat.com> References: <1436465237-22031-1-git-send-email-fweisbec@gmail.com> <1436465237-22031-6-git-send-email-fweisbec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436465237-22031-6-git-send-email-fweisbec@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 38 On 07/09, Frederic Weisbecker wrote: > > The UMH_WAIT_PROC handler runs in its own thread for obsolete reasons. > We couldn't launch and then wait for the exec kernel thread completion > without blocking other usermodehelper queued jobs since khelper was > implemented as a singlthread ordered workqueue. > > But now we replaced khelper with generic system unbound workqueues which > can handle concurrent blocking jobs. > > So lets run it from the workqueue. Probably this is fine, but I am a bit worried... WQ_MAX_ACTIVE == 512, this should be enough "in practice". But nothing protects us from creative driver(s) which spawns 512 long-living user space tasks... Note also that userpace can ptrace these task and "block" sys_wait() forever. I am worried ;) > CHECK: I'm just worried about the signal handler that gets tweaked > and also the call to sys_wait() that might fiddle with internals. The > system workqueue must continue to work without surprise for other > works. Yes. This means that this patch is wrong without disallow_signal() at the end. Oleg. -- 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/