Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8932960rwr; Thu, 11 May 2023 08:00:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yLE2KumQIH2Gpky5x5XusWw7FXTlt7/tbUC2zKomW7wel9fh/INl2eBw3rB28dxuk5/uY X-Received: by 2002:a17:90b:3757:b0:247:afed:6d62 with SMTP id ne23-20020a17090b375700b00247afed6d62mr20691356pjb.46.1683817247230; Thu, 11 May 2023 08:00:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683817247; cv=pass; d=google.com; s=arc-20160816; b=G3Vl0xAT+w02+gnNf4/X9AL0/aoHSrXNcYHzCvoThgQwQbcZJBqGPLvcXrtNof4R86 fgCaBtR/SsFLe+YKQbPC4t1rC0PLTTldkLxiPb83z/YLjA74i/oVydd783kUCQ3uNj9J V0BmeA6KKOGOhhj1EOsRLwhKsparOa05NTqQbCRRvpE1QxUDyCpvYVztFHtgigHlzlH0 KDGczCVzfxn86uGku13530jbfwPmfuFqWoeP3430K8kGbWzAUE4lVNi0HFgSGlid5Umx lGzgi5DTdtwjey0+hUOxEMUkOUIhHPdxbliD1muoH1zg3yUbtxDjte+OsM0RoC3RIQmK GjiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=Xs/+6PWPiBGOlqdSstlKPtpWeA6pyMbktLDMS/6xj5w=; b=Z6goMTrXrBktiAAElGxXn3QU2C98M6zvOeMxZMFWUfAEwqp87Zx8Ufb7Ju4CXhT1si 7JQ6LeUBbom2pZcq7LGZDdj2My5QoXovxRm32rxG+5C9OVKBjzqkD7ZfhZtejOyZuyaN JOBBl6xxabSAqM9gkwncMAecxoPKJ4WCbi62kFnM8VbZpu/yPd1BYwrRZBYtaF1mEzth Po+dFeDK3X96AXnb343aH+U1hDUjTWHliu4OIY9xybDdQQ0NxQ4AVljly7Drm1IxW0qS eBWP70irCiuyMUZTqm1jGC86JMPcwQn0uV5eOQoMz2YJgwiFRHom3kt/pxXTv/zFqp+w Ibpw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=Ibfg5kjF; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a17090a598d00b00247526ba960si19984619pji.119.2023.05.11.08.00.32; Thu, 11 May 2023 08:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=Ibfg5kjF; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238558AbjEKO4n (ORCPT + 99 others); Thu, 11 May 2023 10:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238339AbjEKO40 (ORCPT ); Thu, 11 May 2023 10:56:26 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0729.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D563F10A18 for ; Thu, 11 May 2023 07:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBgMjA+rQYJUY1nZqINf098lLWtIqL7lEKlJ8DPcVBVy5cT0WWDW29mjjhC3vZpKPz1Ax2/269NnRqATQ4eWLJA3wvBUDh6GmH0bB0nMEzlHLyQQwlV5Ue9I6qbSV6NZ9gYeOozC2Mw+zFlfn+0TALcXBdOYocD3fXl4lw9tbDus+G0kVhQAcPygKpis1T5LnkXomNKoAhfVMTD6TVkHEIddMS3V/S8/rq6JyNgjEXvllCTN5tgUwgzgX6KdptMX9uq2eBPqoWWVFGsm4YlQu8aW7NJRG34jIh3a+4t+4AihDyIZLTsaw/h8RqUwUPBkUd/GlsyK6fn9QPkUGaZWGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xs/+6PWPiBGOlqdSstlKPtpWeA6pyMbktLDMS/6xj5w=; b=R2DjFA7/DCCQreWI1qizPTtZvTD330MqUuzioMVdQ7Kj1T4hIaalHWN1hBYxl5ctJwgK2ZhSZHYI6AKiOZYtPOYz8iK8uKbl7xMovuVj4/8GsESHQ7U8GWpbBRwSRhkYJRbNDDqtFPEf9N85QSk9xVHbl8iljPxDIlzfx5rAmX4LZw6alLUiW7f4tHP9VarJ0V5KsotmBJS1mcacir5cwWILj3BNPToRDtxZvpYM5jkSsDMo1+dPtewvUdP2Y09ceUXt4xqorxrEt0u3pkAZ+AOw6UmKYgfZd1YsGvuGLVVltDPHB2tpZMAIm56KmJ+RGJ8VhP91Mv3og7qm+OFDsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xs/+6PWPiBGOlqdSstlKPtpWeA6pyMbktLDMS/6xj5w=; b=Ibfg5kjFDq81/Dk79smJmCgCzTOMIuNlg8FMnLCL0Gfb3F+wjo95AhRP6fSL/4GuFxrVAbAL/LvaEwjU8GFD8ep9UvavM5dACTU9LF/FdpJePiKGaUBTkwBEa2AmFXGV3usHObhUhuYHTxz+/RCvph2ETKlk1BKh7EnSi/Onsrvjv0xwUzMJ6TFapMVZn9Hi86rIPvlt9YRTqR8zwa+5XIX1/kaenO80jhq3pDbjU67bBimLMz9yx+F8mokE1SxqMmyUUAMsd9KY16PRbm/LxPqG+OTC1ovxpIbeYg88YCf3+IsQukYGnEw28FMpu5Jg097qgTbIW98RNfmDrKAszg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from VE1PR08MB4989.eurprd08.prod.outlook.com (2603:10a6:803:114::19) by DU0PR08MB9025.eurprd08.prod.outlook.com (2603:10a6:10:471::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Thu, 11 May 2023 14:54:44 +0000 Received: from VE1PR08MB4989.eurprd08.prod.outlook.com ([fe80::cc7e:f565:88eb:67af]) by VE1PR08MB4989.eurprd08.prod.outlook.com ([fe80::cc7e:f565:88eb:67af%5]) with mapi id 15.20.6387.020; Thu, 11 May 2023 14:54:44 +0000 Message-ID: Date: Thu, 11 May 2023 22:54:33 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [RFD] posix-timers: CRIU woes Content-Language: en-US To: Thomas Gleixner , Andrey Vagin Cc: Frederic Weisbecker , LKML , Anna-Maria Behnsen , Peter Zijlstra , syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com, Dmitry Vyukov , Sebastian Siewior , Michael Kerrisk , Christian Brauner , Alexander Mikhalitsyn , Pavel Emelyanov References: <20230425181827.219128101@linutronix.de> <20230425183312.932345089@linutronix.de> <87zg6i2xn3.ffs@tglx> <87v8h62vwp.ffs@tglx> <878rdy32ri.ffs@tglx> <87v8h126p2.ffs@tglx> <875y911xeg.ffs@tglx> <87ednpyyeo.ffs@tglx> <87r0rnciqo.ffs@tglx> <87ilczc7d9.ffs@tglx> From: Pavel Tikhomirov In-Reply-To: <87ilczc7d9.ffs@tglx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: KU1PR03CA0016.apcprd03.prod.outlook.com (2603:1096:802:18::28) To VE1PR08MB4989.eurprd08.prod.outlook.com (2603:10a6:803:114::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4989:EE_|DU0PR08MB9025:EE_ X-MS-Office365-Filtering-Correlation-Id: 1338c6b1-0dcd-4494-04c0-08db522fa7cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YIcpCRzZRDrk3okB/SFCPrBow7K+ANA37GJYSWz6vAcVKaF7YRh84Cx8KBWowW3kVfMZ94cUq8q3PaeCIAI7iZjCQF4f62OzDSk2wivGlZxdK3zDXUUgoyD7P6NC1lG/j2PUCIDkw4wwI8z4Qy3+OI4fFQFwyodScZ9OK5L1hGStanYE1gfaegnXda79RwWtLVHzwZGwSp6S+NsQbpwfU4tgJQpWZU57Ifihqo6zLRGs0IF7zzkJoUS53GGmaEFu89YtZ67SRIliaJTeibSLTljYPBpR2wiqiuqYYLPcmJ7n8kici4H6a437eKRo2ekz2sbPyFDMHHGkROHyhzmbhH5k4jZbIj9AE6SvnKQaa7Fb/Qg+fydaCKlXQKd9Kj3DT8AuA1pXcx2MIUBHWqXkAaP8Wq7unjMWYuT6q7492UVgKuYPkL1BVXu6A/odXEWqlKwZkVEPHg1f8Rl4WhPmmYuVyKJu3YdeTnTGVRLLDwonNuzf+aQmDfgWQQag0+s6qlV0EzPCERdG3qctnFIVAMKCCpGYoLej2rEK/ufS6q75hTi22LvxdISijA/G9vvO8WPF+BShfDxX8dZ1nPaEiBHF3sg8Pzb+jLFqeXbglsrbpv3zkWhVH3yz6REG+Vzr8SPAaqFAoJewdelOaJTISA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4989.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39850400004)(451199021)(54906003)(110136005)(86362001)(31686004)(31696002)(478600001)(316002)(66946007)(66556008)(41300700001)(4326008)(6666004)(36756003)(966005)(6486002)(8936002)(66476007)(8676002)(5660300002)(7416002)(38100700002)(66899021)(107886003)(83380400001)(6506007)(186003)(6512007)(53546011)(2906002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?REJPcXV0L1RBNXk3OU1VNzV3WS9XOTRPYzQ5RmFBOVFvcFoxeTdRUTl4RUUv?= =?utf-8?B?MXJrVGlNOHM5bWM4T2hSYVBxSkd1bmVZVHc3Y2srUHFDOVdmQzZpQXNQcllj?= =?utf-8?B?TzFpaElGRkRRV0F6NmpJNmYyeCtnK25oYUVXKzVJQUpwOU1KOEZ6TGVHUzNr?= =?utf-8?B?Q2J5UkVYd0pqZWVjaXYzTTBqb09GS3dwSnZ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?B?RmZITG42OE9VRGNSWjhHTEh5R0xvRXdWK2REWFRJajRmcWRzeWRHZzZ6ZlZZ?= =?utf-8?B?ZnUwQVIyR0RVQ3UwTDg0bDNsaTFadVp4QXdxcGRZMkxqR3Z6MmlaQUkybDNP?= =?utf-8?B?Wkhob3NrQXNWS1BRejVReWlRYWU1OFcxRXhFU2UrTTliM2dxSUlrRVlNaEZL?= =?utf-8?B?RG1FUlhDdVJ4YW9iNjE4bHZmWjFKa2hLelNtV2ZrdlAyVUQ0OFc5L1BvMGFy?= =?utf-8?B?eVdIbUgxcjRCZnBjOTlYaGVqRmRRPT0=?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1338c6b1-0dcd-4494-04c0-08db522fa7cf X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4989.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 14:54:43.8552 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Dx47k8Bx/Bkm/auXgDBMflvUy9r5fQOQd10LD0189Qzl9bG/ZgyFkmlsS/6NnjjD/X/OyB5m9mPtXFWeN3mztl970Ua9OwAVa+NUc/51r00= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9025 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.05.2023 21:42, Thomas Gleixner wrote: > On Thu, May 11 2023 at 17:52, Pavel Tikhomirov wrote: >> On 11.05.2023 17:36, Thomas Gleixner wrote: >>> On Thu, May 11 2023 at 11:17, Pavel Tikhomirov wrote: >>>> On 10.05.2023 16:16, Andrey Vagin wrote: >>>>>> >>>>>> So because of that half thought out user space ABI we are now up the >>>>>> regression creek without a paddle, unless CRIU can accomodate to a >>>>>> different restore mechanism to lift this restriction from the kernel. >>>>>> >>>>> If you give us a new API to create timers with specified id-s, we will >>>>> figure out how to live with it. It isn't good to ask users to update >>>>> CRIU to work on new kernels, but here are reasons and event improvements >>>>> for CRIU, so I think it's worth it. >>>> >>>> I agree, any API to create timers with specified id-s would work for new >>>> CRIU versions. >>> >>> The real question is whether this will cause any upheaval when a new >>> kernel meets a non-updated CRIU stack. >> >> Creation of posix timer would hang forever in this loop >> https://github.com/checkpoint-restore/criu/blob/33dd66c6fc93c47213aaa0447a94d97ba1fa56ba/criu/pie/restorer.c#L1185 >> if old criu is run on new kernel (without consecutive id allocation) AFAICS. > > Yes, because that "sanity" check > > if ((long)next_id > args->posix_timers[i].spt.it_id) > > which tries to establish whether the kernel provides timer IDs in strict > increasing order does not work for that case. Yes, this check is not perfect, but it does at least something: It detects that posix timer creation missed needed id (if you start from 0 and increase by 1 each time you can not reach number > N before reaching N). > > It "works" to detect the IDR case on older kernels by chance, but not > under all circumstances. Assume the following case: > > Global IDR has a free slot at index 1 > > Restore tries to create a timer for index 2 > > That will also loop forever, unless some other process creates a timer > and occupies the free slot at index 1, right? Yes on old-old kernel, where there were no ids increasing on create/delete, CRIU is broken, but CRIU does not support kernels earlier than 3.11 (https://criu.org/Check_the_kernel#Basic) so probably we are fine. git describe --contains 5ed67f05f66c v3.10-rc1~171^2~9 > > So this needs a fix anyway, which should be done so that the new kernel > case is at least properly detected. > > But even then there is still the problem of "it worked before I upgraded > the kernel". > > IOW, we are still up a creek without a paddle, unless you would be > willing to utilize the existing CRIU bug to distribute the 'deal with > new kernel' mechanics as a bug bounty :) > > Fix for the loop termination below. It fixes the loop for new kernel, I agree. > > Thanks, > > tglx > --- > criu/pie/restorer.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > --- a/criu/pie/restorer.c > +++ b/criu/pie/restorer.c > @@ -1169,10 +1169,10 @@ static int timerfd_arm(struct task_resto > static int create_posix_timers(struct task_restore_args *args) > { > int ret, i; > - kernel_timer_t next_id; > + kernel_timer_t next_id, timer_id; > struct sigevent sev; > > - for (i = 0; i < args->posix_timers_n; i++) { > + for (i = 0, next_id = 0; i < args->posix_timers_n; i++) { > sev.sigev_notify = args->posix_timers[i].spt.it_sigev_notify; > sev.sigev_signo = args->posix_timers[i].spt.si_signo; > #ifdef __GLIBC__ > @@ -1183,25 +1183,27 @@ static int create_posix_timers(struct ta > sev.sigev_value.sival_ptr = args->posix_timers[i].spt.sival_ptr; > > while (1) { > - ret = sys_timer_create(args->posix_timers[i].spt.clock_id, &sev, &next_id); > + ret = sys_timer_create(args->posix_timers[i].spt.clock_id, &sev, &timer_id); > if (ret < 0) { > pr_err("Can't create posix timer - %d\n", i); > return ret; > } > > - if (next_id == args->posix_timers[i].spt.it_id) > + if (timer_id != next_id) { > + pr_err("Can't create timers, kernel don't give them consequently\n"); > + return -1; > + } > + > + next_id++; > + > + if (timer_id == args->posix_timers[i].spt.it_id) > break; > > - ret = sys_timer_delete(next_id); > + ret = sys_timer_delete(timer_id); > if (ret < 0) { > - pr_err("Can't remove temporaty posix timer 0x%x\n", next_id); > + pr_err("Can't remove temporaty posix timer 0x%x\n", timer_id); > return ret; > } > - > - if ((long)next_id > args->posix_timers[i].spt.it_id) { > - pr_err("Can't create timers, kernel don't give them consequently\n"); > - return -1; > - } > } > } > > > -- Best regards, Tikhomirov Pavel Senior Software Developer, Virtuozzo.