uids in task_struct-Further Explaining the Problem

From: sena (auntvini_at_sedal.usyd.edu.au)
Date: 01/05/04

  • Next message: Zhu, Yi: "Re: [Bugfix] Set more than 32K pid_max (reformatted)"
    Date:	Tue, 06 Jan 2004 02:20:39 +1100
    To: Robin Holt <holt@sgi.com>
    
    

    Hi Robin,

    Thank you very much for the previous advice and for your valuable time.

    I thought of further explaining the problem to you.

    At this stage linux kernel is calculating Load Averages. The major input
    of the calculation is number of running exe and Runnables in the
    runnable Queue.

    This is happening In timer.c
    static unsigned long count_active_tasks(void) and

    static inline void calc_load(unsigned long ticks)

    What I am Trying:

    What I am tryiing to do is to seperate the running exe and Runnables
    according to the owner of those processes (Say 5 people have login and
    they run diffrent processes)

    And then seperately calculate the Load Averages for those respective
    login users.

    The Problems:

    The task_struct has a uid field. I have used that field to seperate
    them. But the problem is when a child process is created by its parent
    then the child inherits the uid of the parents. As a result the correct
    uid which is related to the username does not contain in that uid.

    Example:

    Say a computer has 5 user logins name1(500), name2(501),
    name3(502).........name5(504) apart from root. If these 5 people
    remotely login and runs there jobs, then the user name of those jobs are
    name1,name2 and name3.

    Say if they use telnet to remotely login then those Tasks will be
    started under telnet server as children.

    As the children inherits uid, euid etc of the parents. That means telnet
    is run as root and it inherits uid<500.

    task_struct has uid and it is updated accordingly.

    I have built the kernel 2.4.19sena1 successfully but this is my problem.
    The problem because child process inherits uid etc if I start any
    process through telnet

    Thanks
    Sena Seneviratne
    Computer Engineering Lab
    Sydney University

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Zhu, Yi: "Re: [Bugfix] Set more than 32K pid_max (reformatted)"

    Relevant Pages

    • task_struct and uid of a task
      ... Say if they use telnet to remotely login then those Tasks will be ... As the children inherits uid, ...
      (Linux-Kernel)
    • Re: uids in task_struct-Further Explaining the Problem
      ... As to euid and uid. ... But the problem is when a child process is created by its parent ... > started under telnet server as children. ... > As the children inherits uid, ...
      (Linux-Kernel)
    • Re: task_struct and uid of a task
      ... In my next kernel update I will follow your avice to naming and indentation. ... The uids in task_struct is parents uid ... >>remotely login and runs there jobs, then the user name of those jobs are ... >>started under telnet server as children. ...
      (Linux-Kernel)
    • Re: uids in task_struct-Further Explaining the Problem
      ... >should have no problem calculating on a per-user basis. ... But the problem is when a child process is created by its parent ... >> uid which is related to the username does not contain in that uid. ... >> started under telnet server as children. ...
      (Linux-Kernel)