From d59f3e5e0fd518eeed1ec11886fd796d163cea5d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 14 Sep 2018 13:21:33 +0000 Subject: Fix sys/procfs.h pr_uid, pr_gid type (bug 23649). 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. [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. --- sysdeps/unix/sysv/linux/riscv/sys/procfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv/linux/riscv/sys') 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. */ -- cgit 1.4.1