mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Helsley <matthltc@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	Jean-Pierre Dion <jean-pierre.dion@bull.net>,
	Guillaume Thouvenin <guillaume.thouvenin@bull.net>,
	Badari Pulavarty <pbadari@us.ibm.com>,
	Ram Pai <linuxram@us.ibm.com>,
	CKRM-Tech <ckrm-tech@lists.sourceforge.net>,
	Erich Focht <efocht@hpce.nec.com>,
	elsa-devel <elsa-devel@lists.sourceforge.net>,
	Gerrit Huizenga <gh@us.ibm.com>, Adrian Bunk <bunk@stusta.de>,
	"Chandra S. Seetharaman" <sekharan@us.ibm.com>,
	Jay Lan <jlan@engr.sgi.com>, Erik Jacobson <erikj@sgi.com>,
	Jack Steiner <steiner@sgi.com>
Subject: Re: [ckrm-tech] Re: [PATCH] Process Events Connector
Date: Fri, 28 Oct 2005 17:57:18 -0700	[thread overview]
Message-ID: <1130547438.10680.872.camel@stark> (raw)
In-Reply-To: <1130543791.10680.853.camel@stark>

On Fri, 2005-10-28 at 16:56 -0700, Matt Helsley wrote:
> OK, I wasn't as thorough as I had hoped re: 64-bit kernel/32-bit
> userspace. The uid_t and gid_t types appear to present a problem to the
> following:
> 
> User  <-> Kernel
> i386  <-> x86_64/IA64
> sparc <-> sparc64
> s390  <-> s390x
> 
> :(
> 
> 	I'll look at this some more and see if I need to resubmit. Until then
> I'll hold off on my request for inclusion in -mm.
> 
> Cheers,
> 	-Matt Helsley

	Userspace can include sys/types.h -- in which case uid_t and gid_t
match -- or linux/types.h -- in which case they are not guaranteed to
match. To further complicate things translation is not possible because
the connector broadcasts the events to multiple 'listener's. A mix of 32
and 64-bit userspace programs could be listening; guaranteeing
incompatibility if the structure layouts do not match.

	This patch addresses the problem by fixing the size to the largest size
found in the kernel (and likely the largest size needed). This preserves
the total size of the event structure while ensuring that the event
structure layouts match.

	Are there better alternative solutions?

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>

---

Index: linux-2.6.14/include/linux/cn_proc.h
===================================================================
--- linux-2.6.14.orig/include/linux/cn_proc.h
+++ linux-2.6.14/include/linux/cn_proc.h
@@ -84,16 +84,16 @@ struct proc_event {
 
 		struct id_proc_event {
 			pid_t process_pid;
 			pid_t process_tgid;
 			union {
-				uid_t ruid; /* current->uid */
-				gid_t rgid; /* current->gid */
+				__u32 ruid; /* task uid */
+				__u32 rgid; /* task gid */
 			};
 			union {
-				uid_t euid;
-				gid_t egid;
+				__u32 euid;
+				__u32 egid;
 			};
 		} id;
 
 		struct exit_proc_event {
 			pid_t process_pid;



  reply	other threads:[~2005-10-29  1:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-28  8:55 Matt Helsley
2005-10-28  9:19 ` Arjan van de Ven
2005-10-28 10:03   ` Matt Helsley
2005-10-28 23:19 ` Matt Helsley
2005-10-28 23:56   ` Matt Helsley
2005-10-29  0:57     ` Matt Helsley [this message]
2005-10-29 10:19       ` [ckrm-tech] " Evgeniy Polyakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1130547438.10680.872.camel@stark \
    --to=matthltc@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=bunk@stusta.de \
    --cc=ckrm-tech@lists.sourceforge.net \
    --cc=efocht@hpce.nec.com \
    --cc=elsa-devel@lists.sourceforge.net \
    --cc=erikj@sgi.com \
    --cc=gh@us.ibm.com \
    --cc=guillaume.thouvenin@bull.net \
    --cc=jean-pierre.dion@bull.net \
    --cc=jlan@engr.sgi.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=pbadari@us.ibm.com \
    --cc=sekharan@us.ibm.com \
    --cc=steiner@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome