From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id 104773858D28 for ; Tue, 11 Apr 2023 07:44:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 104773858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x22c.google.com with SMTP id w19so4838402oiv.13 for ; Tue, 11 Apr 2023 00:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681199068; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fbl4g31bN1TUJLiTW0GcabSxzrwpZpYaenWLWyzgyM8=; b=AstEGJGXQs2Avh2cXB1GU9ahWi9p395jIILewRt0FPj1MP3Th912iIf4KswbF9ltZq /LGwc5uNl3SWMOsC6RlMFzdTRwmUOZRehWWcW9IIpdkcLQygsJc+Yz2JIeBPtzKOEaDu XxC06mqZT5bSx45dPR91ksmob0B+vT2voB2CrB7iQBtcEkj8nu6OqpPOkR0jkUNd3V2U CwP24sPScoMvswS8SDgIeI4gRfZHdLl1hEa+MlwqZ6auUvmbRTYTz/DmCNz1ATQTlK1t fR/s8uhxCl0+BrUZFcC0rjMOxSEKxUyioTpqjUalKeDz8IYa/yWvcnm4HV5EoYTYKmv5 Hfpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681199068; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fbl4g31bN1TUJLiTW0GcabSxzrwpZpYaenWLWyzgyM8=; b=uDyj8H2bgoKI2dv26+RB7kaupMVDyTuY2i/ghCKh/MDCQ9KSCB0hcOwvsMqOFvIPIu jKQivf2OuXTfuiZi64K7QOsdh+18yX+5HsBaBQ4/xHOlld4P4cH7ztuJBwFJbccH3Du+ 4Ac/XXIklUkPLcFqx04SGo217l88bFRe4kM1JMfttLduUiSaBs9rA/xd4l2pEWr5ZTRG AQxkGmjnMBRXOpm0zGsThJ7QCbhKWguICDn5C0k1SUDCyAGsaB5TNq9hf3kx07dVaDwc KRsf022rxyylwjxuqa1ALv/IwTFaOWy5EO3HLYvS1n0eiWICCkXvmh9KAdng7O1jq39C jvMA== X-Gm-Message-State: AAQBX9efEjdtwpAUuI/BzWN0AGEbGUXM5JtBjh6X0nCzMdPkcgphT6Pe GVxkzjZDFhteTVbu6AhaheeH5MkfNHwonQzVM/326vtv X-Google-Smtp-Source: AKy350aZbdZbUNSdEtjEq3peQxeFtYfnHDfDAJkCuy+sdRXEZyJtLjcirT3tVBlAIhdFf8NwPDMmBaOLXiUmEIJ9lI4= X-Received: by 2002:a05:6808:6d3:b0:38b:c1ae:cb0b with SMTP id m19-20020a05680806d300b0038bc1aecb0bmr1715759oih.4.1681199068271; Tue, 11 Apr 2023 00:44:28 -0700 (PDT) MIME-Version: 1.0 References: <20230319151017.531737-1-bugaevc@gmail.com> <20230319151017.531737-26-bugaevc@gmail.com> <20230410220311.fecuaj4gicx3hh5l@begin> In-Reply-To: <20230410220311.fecuaj4gicx3hh5l@begin> From: Sergey Bugaev Date: Tue, 11 Apr 2023 10:44:17 +0300 Message-ID: Subject: Re: [RFC PATCH glibc 25/34] hurd: Improve reply port handling when exiting signal handlers To: Samuel Thibault Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Apr 11, 2023 at 1:03=E2=80=AFAM Samuel Thibault wrote: > I tend to be very cautious with reply port reuse since it can confuse > servers a lot when e.g. interrupted, so it's generally safer not to try > to reuse them. Huh? Confuse how? For one thing, the servers are unable to even tell if two send-once rights point to the same port (which is actually something that I'd very much like to change, since it would greatly benefit rpctrace, but that's a topic that deserves its own wall-of-text email). The servers can still notice if their send-once right dies though. If a call has been interrupted and we have not received a reply (EINTR or not), we surely must destroy the reply port used, if only for security reasons (so a malicious server won't be able to inject a fake reply to some other RPC we make later). But I don't see a reason to destroy the *current* reply port, the one used during signal handling, which we're longjumping out of. On the other hand it doesn't hurt much either, and signal handling is a slow path anyway, so we may just play it safe. Sergey