public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Prasanna Meda <pmeda@akamai.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sys_set/getpriority PRIO_USER semantics fix and optimisation
Date: Thu, 02 Dec 2004 13:53:13 -0800	[thread overview]
Message-ID: <41AF8EC9.2EEA409A@akamai.com> (raw)
In-Reply-To: 200412012321.PAA30853@allur.sanmateo.akamai.com

pmeda@akamai.com wrote:

> sys_set/getpriority is rewritten in 2.5/2.6, perhaps while transitioning
> to the pid maps.  It has now semantical bug, when uid is zero.  Note

A test case:

#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>

int main()
{
        int prio1, prio2, ret, errno;

        /* If root, loose priv. for testing */
        setresuid(237, 237, 237);

        prio1 = getpriority(2, getuid());
        if (setpriority(PRIO_USER, 0, prio1+1) < 0) {
                perror("setprio");
                printf("FAILED!\n");
        }
        else {
                prio2 = getpriority(2, getuid());
                printf("Old prio:%d to new prio:%d\n", prio1, prio2);
                printf((prio1 +1 != prio2)? "FAILED\n":"PASSED\n");
        }
        exit(0);
}


      reply	other threads:[~2004-12-02 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-01 23:21 [PATCH] sys_set/getpriority PRIO_USER semantics fix and optimisation pmeda
2004-12-02 21:53 ` Prasanna Meda [this message]

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=41AF8EC9.2EEA409A@akamai.com \
    --to=pmeda@akamai.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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