From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id DE3AC3858D37 for ; Mon, 10 Oct 2022 02:18:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE3AC3858D37 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-pf1-x435.google.com with SMTP id i6so9635663pfb.2 for ; Sun, 09 Oct 2022 19:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hbzBCw71VrbvVlBS30hWnRBZVzGHk9jI2u8Nliq0Z04=; b=JxF/OLcVVSDCS7CkRuKi9thi4d/rqGA4OqJzPV5oOhpXnjgzkIrhfxnl/VEJEQwam8 z2vSoBWKEmJ6v49rrmtVflAOFYkseZLMRgIuha2wfdsZO6E2mC6T6Kp/MtbyfuIQ+MyV lMCDECB10iv5GXptrwGp3pcWm5/KruZNlebiPSsLTIeEpmE0W902+g/pE53zIOoR7YcO n/siGqqs++6k6ssjYM2Xnh+0rR+QjHKpNKc9lLWnJEDH8QumvL9tWl9n0Mk//i/EoAvG LlzK5A3kLcXBbQW4zluPiyZ7kKWhcWHbqkztXpXAhVjJzUh8yOAhA95GzKXT/17Jy5xU qsKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=hbzBCw71VrbvVlBS30hWnRBZVzGHk9jI2u8Nliq0Z04=; b=i0qfzAkZUL9AoULg8pr2DtwvZwcdc/y7F0xzFzh/mu+EESoDX16aKBF9nl9wqBAQ3l EuVsNUhwO+Wmy9EjezbyHFTWpzAr1n0ybpIIDDvxcVyi3PJQrOMXmM+mJmlyX+cVGnF4 0lY7O7Wipii10IlsUvBWybjO26DKtFecm1M/cUc0V6GEgD2LWJnM79u3aBMk2FnO2Qwh GpWOf1E66Bdf6E715q8hRrrZYmgcstS2+VnJParrN8Inzkx0C/TRS8+S9ICxDf4v1If+ aZudW9bElgvQ3XoKCTovFld+BLhbZOXVoYj10qP0qb0uFhDlmnWgYNqWUpLYCoTqUsCt t2sQ== X-Gm-Message-State: ACrzQf1WSvSNZeflPo7p3ILPP6Pxwexevb3aiQBpK/jNS+SElpwf8e+c XqOLqUpZlVrtFyvW47/LIwqbL5VCITt7RuVj49+l2cmVpmE= X-Google-Smtp-Source: AMsMyM4OFAEZcVF0TMjqD/Eq3M741P38Oqx2JNQv5VW5fdx+ISwvVzkH+avxdtoKDx7qnWd4ahNwtyACBEPIgdzEzOk= X-Received: by 2002:a05:6a00:114c:b0:528:2c7a:6302 with SMTP id b12-20020a056a00114c00b005282c7a6302mr17358483pfm.37.1665368334890; Sun, 09 Oct 2022 19:18:54 -0700 (PDT) MIME-Version: 1.0 References: <20221008024522.523048-1-mattst88@gmail.com> <1e7ae13a-e5dd-2e0e-60ff-637284d3f8a9@redhat.com> In-Reply-To: <1e7ae13a-e5dd-2e0e-60ff-637284d3f8a9@redhat.com> From: Matt Turner Date: Sun, 9 Oct 2022 22:18:43 -0400 Message-ID: Subject: Re: [PATCH] alpha: correct handling of negative *rlimit() args besides -1 To: "Carlos O'Donell" Cc: libc-alpha@sourceware.org, Aurelien Jarno Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Sun, Oct 9, 2022 at 8:51 PM Carlos O'Donell wrote: > > On 10/7/22 22:45, Matt Turner via Libc-alpha wrote: > > The generic version of RLIM_INFINITY in Linux is equal to (rlim_t)-1, > > which is equal to ULLONG_MAX. On alpha however it is instead defined as > > 0x7ffffffffffffffful. This was special-cased in 0d0bc78 [BZ #22648] but > > it specifically used an equality check. > > > > There is a cpython test case test_prlimit_refcount which calls > > setrlimit() with { -2, -2 } as arguments rather than the usual -1, it > > therefore fails the equality test and is treated as a large arbitrary > > positive value past the maximum of RLIM_INFINITY and fails with EPERM. > > This patch changes the behavior of the *rlimit() calls to treat all > > integers between 0x7ffffffffffffffful and (rlim_t)-1 as (rlim_t)-1, > > i.e., RLIM_INFINITY. > > --- > > sysdeps/unix/sysv/linux/alpha/getrlimit64.c | 4 ++-- > > sysdeps/unix/sysv/linux/alpha/setrlimit64.c | 4 ++-- > > Is MIPS affected by the same problem? Looks to me like it is, but I don't have a mips system running to confirm. If this patch is accepted, I'll send a follow-up for mips.