From patchwork Thu Sep 13 20:49:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 969540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-95831-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="vyCJqjFn"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42B9kZ4Nmfz9s3l for ; Fri, 14 Sep 2018 06:49:42 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=N5THOlgzfA5xXPtPsxMRZeWAhgUs/ DiF1kmAOtq1NpixrlenecAa1zJdlyZCG4F3NY6CXEfg5sdTyVt55ECfaUMCSKvVP 2eqPClhGrX5M1aQzGFkto9BvempvIfsjybwrYjWXiwu60WP63jta9QSznriK8x3x x1Mjux8z13Ciwc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=cGb2PhduWO1sN/+o8OqjIQlBToA=; b=vyC JqjFnzSzb9fRzHNPS6vNh9ukHE/vqVuiyOb7itntsKSakwMgyY13vx238p/9oMzI FEzo5ColWQPAUGF7tICRXwbe3k50LHI6/1aeI3Gm6vS1fWmSonbQ0xubO2AlSngp 6g4h23CKchM0OkCqmnJJS8SDprzJxPED730BUCRo= Received: (qmail 39885 invoked by alias); 13 Sep 2018 20:49:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 39876 invoked by uid 89); 13 Sep 2018 20:49:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Lots X-HELO: relay1.mentorg.com Date: Thu, 13 Sep 2018 20:49:29 +0000 From: Joseph Myers To: Subject: Fix sys/procfs.h pr_uid, pr_gid type (bug 23649) Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 As noted in , glibc's sys/procfs.h headers for microblaze, mips (n64), nios2 and riscv have incorrect types for the pr_uid and pr_gid members of struct elf_prpsinfo (as does the generic Linux version, but nothing uses that). This patch fixes those headers to use unsigned int. The generic Linux version is also fixed, but I do *not* recommend making new architectures use it yet. Rather, I think it should be reworked to look more like a copy of the AArch64 version, but with a new header included to provide register set definitions; would then be architecture-specific while many architectures could use the generic . This fix is deliberately separate from any reworking to use a generic header more, since it's possible there could be uses for backporting this fix but not for backporting a subsequent cleanup. Tested with build-many-glibcs.py. This of course doesn't provide much validation of the structure layout; if the Linux kernel is fixed so that "#include " actually compiles with the headers from "make headers_install" (and if the layout in both headers is meant to be the same, whatever ABI we are building for), I have a test that can be added to glibc to check the layout against that from the Linux kernel. 2018-09-13 Joseph Myers [BZ #23649] * sysdeps/unix/sysv/linux/microblaze/sys/procfs.h (struct elf_prpsinfo): Use unsigned int for pr_uid and pr_gid. * sysdeps/unix/sysv/linux/mips/sys/procfs.h (struct elf_prpsinfo): Likewise. * sysdeps/unix/sysv/linux/nios2/sys/procfs.h (struct elf_prpsinfo): Likewise. * sysdeps/unix/sysv/linux/riscv/sys/procfs.h (struct elf_prpsinfo): Likewise. * sysdeps/unix/sysv/linux/sys/procfs.h (struct elf_prpsinfo): Likewise. diff --git a/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h b/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h index 17c52519e7..7a9832371e 100644 --- a/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h @@ -91,8 +91,8 @@ struct elf_prpsinfo char pr_zomb; /* Zombie. */ char pr_nice; /* Nice val. */ unsigned long int pr_flag; /* Flags. */ - unsigned short int pr_uid; - unsigned short int pr_gid; + unsigned int pr_uid; + unsigned int pr_gid; int pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing. */ char pr_fname[16]; /* Filename of executable. */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/procfs.h b/sysdeps/unix/sysv/linux/mips/sys/procfs.h index 2be0c7e818..523317dec7 100644 --- a/sysdeps/unix/sysv/linux/mips/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/mips/sys/procfs.h @@ -97,8 +97,8 @@ struct elf_prpsinfo #else unsigned long int pr_flag; /* Flags. */ #endif - long pr_uid; - long pr_gid; + unsigned int pr_uid; + unsigned int pr_gid; int pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ char pr_fname[16]; /* Filename of executable. */ diff --git a/sysdeps/unix/sysv/linux/nios2/sys/procfs.h b/sysdeps/unix/sysv/linux/nios2/sys/procfs.h index a61fe96c6b..1bb18f1e58 100644 --- a/sysdeps/unix/sysv/linux/nios2/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/nios2/sys/procfs.h @@ -91,8 +91,8 @@ struct elf_prpsinfo char pr_zomb; /* Zombie. */ char pr_nice; /* Nice val. */ unsigned long int pr_flag; /* Flags. */ - unsigned short int pr_uid; - unsigned short int pr_gid; + unsigned int pr_uid; + unsigned int pr_gid; int pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ char pr_fname[16]; /* Filename of executable. */ diff --git a/sysdeps/unix/sysv/linux/riscv/sys/procfs.h b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h index 518de56741..3abbecf957 100644 --- a/sysdeps/unix/sysv/linux/riscv/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h @@ -82,8 +82,8 @@ struct elf_prpsinfo char pr_zomb; /* Zombie. */ char pr_nice; /* Nice val. */ unsigned long int pr_flag; /* Flags. */ - long int pr_uid; - long int pr_gid; + unsigned int pr_uid; + unsigned int pr_gid; int pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ char pr_fname[16]; /* Filename of executable. */ diff --git a/sysdeps/unix/sysv/linux/sys/procfs.h b/sysdeps/unix/sysv/linux/sys/procfs.h index 3c417bab29..6af44c02ca 100644 --- a/sysdeps/unix/sysv/linux/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/sys/procfs.h @@ -86,8 +86,8 @@ struct elf_prpsinfo char pr_zomb; /* Zombie. */ char pr_nice; /* Nice val. */ unsigned long int pr_flag; /* Flags. */ - unsigned short int pr_uid; - unsigned short int pr_gid; + unsigned int pr_uid; + unsigned int pr_gid; int pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ char pr_fname[16]; /* Filename of executable. */