Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp966394ybi; Thu, 30 May 2019 09:24:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRc9E0f38Hdz9h1AKLF5wMsDI9PWf4Wiv9slyPWbIraZuuhEaE15tFJ1LxrTnQUDdQGRHS X-Received: by 2002:aa7:93ba:: with SMTP id x26mr4446278pff.238.1559233453489; Thu, 30 May 2019 09:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559233453; cv=none; d=google.com; s=arc-20160816; b=HvH3VER2bDAV4hV+rOUyhLf4/5Ia7/YnQB1mZAdgARFUhqwuLdlgRNZvtFJy0kYo9/ NF71g839Q+QfcatvDsNl7iIh9nNa3dTRyHfSW/HP/wzxqO3CstsPIoFiGpgHcAlSXyvk FRIBuETv7C3XI6vZoTDpbRLFl6t1r+Sxi3jPhjtOoypZ4oW6f/JKK27mMeNjJMHE5w6R SeZwQ/6pSvYLP4QmhZgXSzni3jLjFIL8MYDyG3RRruPFr1RIuWQqXyWfqeoRVH+2+EVn 1H21FqO5UIVpDf3Bp1Fgxg88g2VCGtKGsZf/8iyQfvkNFuqRbWRUH6dvsfn/gRlx/Mw3 GiUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=V3ZprDbgVuXl9fz1gY+RTx6tJ5kdGLhRY5j0E7iWLOY=; b=Tq35j1j/aUIA6gxkr7ffuWYLK4VjciP0pB81J/+va4zpuYZU8mlI8OONnawX6IeNSO aHbfdz4EaxQSoiUT+bcwOgXesduQELbnRb4Crl1KaFfftU/Ecj8BU28me3cAU92h6KkS jvseA9CarEyZDEhgNhQETREaTCdocP3CCqz36uMgSYJdJhPuqdedmCX+FMIWgwuXz3JT 8cjhXU0Mtt3HZXBbQ+XwzOSX598uymMtrelQzTokD+9dcYMYH2PCqMdVA8QVlv+jgke7 ZTXE0UrsD2XqW70wKdcEw843IFu1VyiygfcLPWobm/tL2xv6//7lSmektxxuBnZYaZcg iRaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si3491423pgr.361.2019.05.30.09.23.57; Thu, 30 May 2019 09:24:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727641AbfE3QWk convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 May 2019 12:22:40 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:44596 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbfE3QWj (ORCPT ); Thu, 30 May 2019 12:22:39 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-178-hOyN1okSMISZ_H4QMpI_WQ-1; Thu, 30 May 2019 17:22:36 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 30 May 2019 17:22:35 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 30 May 2019 17:22:35 +0100 From: David Laight To: "'Eric W. Biederman'" , Oleg Nesterov CC: Deepa Dinamani , Al Viro , Linus Torvalds , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "arnd@arndb.de" , "dbueso@suse.de" , "axboe@kernel.dk" , "dave@stgolabs.net" , "e@80x24.org" , "jbaron@akamai.com" , "linux-fsdevel@vger.kernel.org" , "linux-aio@kvack.org" , "omar.kilani@gmail.com" , "tglx@linutronix.de" , "stable@vger.kernel.org" Subject: RE: pselect/etc semantics Thread-Topic: pselect/etc semantics Thread-Index: AQHVFv20Wpjj98PrdUiaI6VbWN/dmKaD1ZRg Date: Thu, 30 May 2019 16:22:35 +0000 Message-ID: <21c751a08bae4f7ea25b0ba278594336@AcuMS.aculab.com> References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190529161157.GA27659@redhat.com> <87woi8rt96.fsf@xmission.com> <871s0grlzo.fsf@xmission.com> In-Reply-To: <871s0grlzo.fsf@xmission.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: hOyN1okSMISZ_H4QMpI_WQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric W. Biederman > Sent: 30 May 2019 16:38 > ebiederm@xmission.com (Eric W. Biederman) writes: > > > Which means I believe we have a semantically valid change in behavior > > that is causing a regression. > > I haven't made a survey of all of the functions yet but > fucntions return -ENORESTARTNOHAND will never return -EINTR and are > immune from this problem. Eh? ERESTARTNOHAND just makes the system call restart if there is no signal handler, EINTR should still be returned if there is a handler. All the functions that have a temporary signal mask are likely to be expected to work the same way and thus have the same bugs. http://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html# isn't overly helpful. But I think it should return EINTR even if there is no handler unless SA_RESTART is set: [EINTR] The function was interrupted while blocked waiting for any of the selected descriptors to become ready and before the timeout interval expired. If SA_RESTART has been set for the interrupting signal, it is implementation-defined whether the function restarts or returns with [EINTR]. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)