linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Yeoh <cyeoh@samba.org>
To: Marcelo Tosatti <marcelo@conectiva.com.br>,
	Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org, trivial@rustcorp.com.au
Subject: [PATCH] SUSv2 msgctl compliance
Date: Fri, 24 May 2002 15:44:58 +1000	[thread overview]
Message-ID: <15597.54106.812433.485262@gargle.gargle.HOWL> (raw)


For msgctl SUSv2 states:

"IPC_SET can only be executed by a process with appropriate privileges
or that has an effective user ID equal to the value of msg_perm.cuid
or msg_perm.uid in the msqid_ds data structure associated with
msqid. Only a process with appropriate privileges can raise the value
of msg_qbytes."

The current linux behaviour is to allow for the value of msg_qbytes to
be raised even if the process is not privileged. The following
patch (against 2.4.19pre8) fixes this problem:

--- ipc/msg.c.orig	Fri May 24 14:51:12 2002
+++ ipc/msg.c	Fri May 24 14:58:36 2002
@@ -539,7 +539,8 @@
 	switch (cmd) {
 	case IPC_SET:
 	{
-		if (setbuf.qbytes > msg_ctlmnb && !capable(CAP_SYS_RESOURCE))
+		if (setbuf.qbytes > min(msg_ctlmnb, msq->q_qbytes) &&
+                    !capable(CAP_SYS_RESOURCE))
 			goto out_unlock_up;
 		msq->q_qbytes = setbuf.qbytes;
 
Chris
-- 
cyeoh@au.ibm.com
IBM OzLabs Linux Development Group
Canberra, Australia

             reply	other threads:[~2002-05-24  5:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24  5:44 Christopher Yeoh [this message]
2002-05-24 14:45 ` [PATCH] SUSv2 msgctl compliance Alan Cox

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=15597.54106.812433.485262@gargle.gargle.HOWL \
    --to=cyeoh@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=torvalds@transmeta.com \
    --cc=trivial@rustcorp.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).