From patchwork Thu Oct 15 19:37:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 40735 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0E0C83857C7E; Thu, 15 Oct 2020 19:37:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E0C83857C7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1602790632; bh=nByztIvJtFp+ZCyhb0/ErxSjVo4jP/X3DEvI4qi46v0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=P/tn39rHCKYecDJP4/4bH28sdXOmIsKeu/NypACaYVMpi+JeUH8QifcpHUpgqRU7z Ephog7+qye9BETSSewQ28/vzX8lO6JlJ2V6qoTdsXu+DmC6KHgaq/uSceWOhnjOtVm 4pgmD2wRDjpubgmt02iY3ExgB13ch+u3Yun4nghc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id BE72C3857C57 for ; Thu, 15 Oct 2020 19:37:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BE72C3857C57 Received: by mail-qk1-x741.google.com with SMTP id q63so122304qkf.3 for ; Thu, 15 Oct 2020 12:37:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nByztIvJtFp+ZCyhb0/ErxSjVo4jP/X3DEvI4qi46v0=; b=fSQ+bHvgFau28ST4tEgV26sDD3gvs6eSEqCyfuhFhPtUErIe7nNvR6G/e4L25NRNHc csd/UTqdUtS5YXF//hcoRMeMfOcKADozb+HmlsErDJEEXV9tONtNoVmDFt26mfkWHOdl 1KIX2euZXw6ka+9IC+FgtPUhsy0/9DbmNl+3Qf9iLRb0/8Pn6UGBlMoP68i8dNU44DuH xAr5xD95MaZKxy88gshNlG2wDBAJdBw1+ZKu3e1XBbU0m28fvOQMn3X+tk6MqigX1fAX 1LDFmVc3yrI3H1euAAeAKTfbMo5G5qivstCgWoL+FmQmZbJOLdSdc/DgRyAcxLtC4YAH +sww== X-Gm-Message-State: AOAM5337KyRzGGMuN2ovIY+x2MFnETx+b13kMBFV8EUHUd44o7mVPyZG CGMuiEaXOOj6eIhLX+I8mP1EgMhIzO0JjQ== X-Google-Smtp-Source: ABdhPJx/2V6mhHYklLzfJ9XpoZSV20WAXwj3cfGsH0c9JNHZzRwCcG/Po3RQ/tpXUqPhJdCmtdWGAw== X-Received: by 2002:ae9:f507:: with SMTP id o7mr376516qkg.420.1602790629063; Thu, 15 Oct 2020 12:37:09 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id 123sm1519750qkj.85.2020.10.15.12.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 12:37:08 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [COMMITTED] sysvipc: Fix tst-sysvshm-linux on x32 Date: Thu, 15 Oct 2020 16:37:03 -0300 Message-Id: <20201015193703.1683769-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The Linux shminfo fields are '__syscall_ulong_t' (which is 64-bit for x32). This patch fixes the test to compare againt the correct type and to only clamp the value if '__syscall_ulong_t' is the same size of 'unsigned long int'. Checked on x86_64-linux-gnu-x32. --- sysdeps/unix/sysv/linux/tst-sysvshm-linux.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c index 7128ae2e14..cb32bd522e 100644 --- a/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c +++ b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c @@ -54,9 +54,9 @@ do_prepare (int argc, char *argv[]) struct test_shminfo { - unsigned long int shmall; - unsigned long int shmmax; - unsigned long int shmmni; + __syscall_ulong_t shmall; + __syscall_ulong_t shmmax; + __syscall_ulong_t shmmni; }; /* It tries to obtain some system-wide SysV shared memory information from @@ -128,7 +128,8 @@ do_test (void) #if LONG_MAX == INT_MAX /* Kernel explicit clamp the value for shmmax on compat symbol (32-bit binaries running on 64-bit kernels). */ - if (v > INT_MAX) + if (sizeof (__syscall_ulong_t) == sizeof (unsigned long int) + && v > INT_MAX) v = INT_MAX; #endif tipcinfo.shmmax = v;