From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933884AbdERQtS (ORCPT ); Thu, 18 May 2017 12:49:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34588 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196AbdERQtQ (ORCPT ); Thu, 18 May 2017 12:49:16 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E26E0624B1 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=oleg@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E26E0624B1 Date: Thu, 18 May 2017 18:49:10 +0200 From: Oleg Nesterov To: Miroslav Benes Cc: jpoimboe@redhat.com, jeyu@redhat.com, jikos@kernel.org, pmladek@suse.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] livepatch: send a fake signal to all blocking tasks Message-ID: <20170518164909.GA939@redhat.com> References: <20170518120043.7205-1-mbenes@suse.cz> <20170518120043.7205-3-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170518120043.7205-3-mbenes@suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 18 May 2017 16:49:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I didn't see other patches in series, not sure I understand... On 05/18, Miroslav Benes wrote: > > The very safe marking is done in entry.S on syscall and > interrupt/exception exit paths, and in a stack checking functions of > livepatch. TIF_PATCH_PENDING is cleared and the next > recalc_sigpending() drops TIF_SIGPENDING. Confused. The task can't return from do_signal() is signal_pending() is true, thus it will spin forever if klp_patch_pending(current)) is true. "forever" means until something else clears TIF_PATCH_PENDING, of course. exit_to_usermode_loop() calls do_signal(), then klp_update_patch_state(). So it won't be cleared here. Even if you change the order, this won't help unless I missed something, TIF_PATCH_PENDING can be set when this task has already entered do_signal(). > Last, sending the fake signal is not automatic. It is done only when > admin requests it by writing 1 to force sysfs attribute in livepatch > sysfs directory. OK, but see above, even if klp_send_fake_signal() is never called, the a task will get this fake signal when it calls recalc_sigpending(). Oleg.