linux/ipc/shm.c
<<
>>
Prefs
   1/*
   2 * linux/ipc/shm.c
   3 * Copyright (C) 1992, 1993 Krishna Balasubramanian
   4 *       Many improvements/fixes by Bruno Haible.
   5 * Replaced `struct shm_desc' by `struct vm_area_struct', July 1994.
   6 * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli.
   7 *
   8 * /proc/sysvipc/shm support (c) 1999 Dragos Acostachioaie <dragos@iname.com>
   9 * BIGMEM support, Andrea Arcangeli <andrea@suse.de>
  10 * SMP thread shm, Jean-Luc Boyard <jean-luc.boyard@siemens.fr>
  11 * HIGHMEM support, Ingo Molnar <mingo@redhat.com>
  12 * Make shmmax, shmall, shmmni sysctl'able, Christoph Rohland <cr@sap.com>
  13 * Shared /dev/zero support, Kanoj Sarcar <kanoj@sgi.com>
  14 * Move the mm functionality over to mm/shmem.c, Christoph Rohland <cr@sap.com>
  15 *
  16 * support for audit of ipc object properties and permission changes
  17 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
  18 *
  19 * namespaces support
  20 * OpenVZ, SWsoft Inc.
  21 * Pavel Emelianov <xemul@openvz.org>
  22 */
  23
  24#include <linux/slab.h>
  25#include <linux/mm.h>
  26#include <linux/hugetlb.h>
  27#include <linux/shm.h>
  28#include <linux/init.h>
  29#include <linux/file.h>
  30#include <linux/mman.h>
  31#include <linux/shmem_fs.h>
  32#include <linux/security.h>
  33#include <linux/syscalls.h>
  34#include <linux/audit.h>
  35#include <linux/capability.h>
  36#include <linux/ptrace.h>
  37#include <linux/seq_file.h>
  38#include <linux/rwsem.h>
  39#include <linux/nsproxy.h>
  40#include <linux/mount.h>
  41#include <linux/ipc_namespace.h>
  42
  43#include <asm/uaccess.h>
  44
  45#include "util.h"
  46
  47struct shm_file_data {
  48        int id;
  49        struct ipc_namespace *ns;
  50        struct file *file;
  51        const struct vm_operations_struct *vm_ops;
  52};
  53
  54#define shm_file_data(file) (*((struct shm_file_data **)&(file)->private_data))
  55
  56static const struct file_operations shm_file_operations;
  57static const struct vm_operations_struct shm_vm_ops;
  58
  59#define shm_ids(ns)     ((ns)->ids[IPC_SHM_IDS])
  60
  61#define shm_unlock(shp)                 \
  62        ipc_unlock(&(shp)->shm_perm)
  63
  64static int newseg(struct ipc_namespace *, struct ipc_params *);
  65static void shm_open(struct vm_area_struct *vma);
  66static void shm_close(struct vm_area_struct *vma);
  67static void shm_destroy (struct ipc_namespace *ns, struct shmid_kernel *shp);
  68#ifdef CONFIG_PROC_FS
  69static int sysvipc_shm_proc_show(struct seq_file *s, void *it);
  70#endif
  71
  72void shm_init_ns(struct ipc_namespace *ns)
  73{
  74        ns->shm_ctlmax = SHMMAX;
  75        ns->shm_ctlall = SHMALL;
  76        ns->shm_ctlmni = SHMMNI;
  77        ns->shm_rmid_forced = 0;
  78        ns->shm_tot = 0;
  79        ipc_init_ids(&shm_ids(ns));
  80}
  81
  82/*
  83 * Called with shm_ids.rw_mutex (writer) and the shp structure locked.
  84 * Only shm_ids.rw_mutex remains locked on exit.
  85 */
  86static void do_shm_rmid(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
  87{
  88        struct shmid_kernel *shp;
  89        shp = container_of(ipcp, struct shmid_kernel, shm_perm);
  90
  91        if (shp->shm_nattch){
  92                shp->shm_perm.mode |= SHM_DEST;
  93                /* Do not find it any more */
  94                shp->shm_perm.key = IPC_PRIVATE;
  95                shm_unlock(shp);
  96        } else
  97                shm_destroy(ns, shp);
  98}
  99
 100#ifdef CONFIG_IPC_NS
 101void shm_exit_ns(struct ipc_namespace *ns)
 102{
 103        free_ipcs(ns, &shm_ids(ns), do_shm_rmid);
 104        idr_destroy(&ns->ids[IPC_SHM_IDS].ipcs_idr);
 105}
 106#endif
 107
 108static int __init ipc_ns_init(void)
 109{
 110        shm_init_ns(&init_ipc_ns);
 111        return 0;
 112}
 113
 114pure_initcall(ipc_ns_init);
 115
 116void __init shm_init (void)
 117{
 118        ipc_init_proc_interface("sysvipc/shm",
 119#if BITS_PER_LONG <= 32
 120                                "       key      shmid perms       size  cpid  lpid nattch   uid   gid  cuid  cgid      atime      dtime      ctime        rss       swap\n",
 121#else
 122                                "       key      shmid perms                  size  cpid  lpid nattch   uid   gid  cuid  cgid      atime      dtime      ctime                   rss                  swap\n",
 123#endif
 124                                IPC_SHM_IDS, sysvipc_shm_proc_show);
 125}
 126
 127/*
 128 * shm_lock_(check_) routines are called in the paths where the rw_mutex
 129 * is not necessarily held.
 130 */
 131static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id)
 132{
 133        struct kern_ipc_perm *ipcp = ipc_lock(&shm_ids(ns), id);
 134
 135        if (IS_ERR(ipcp))
 136                return (struct shmid_kernel *)ipcp;
 137
 138        return container_of(ipcp, struct shmid_kernel, shm_perm);
 139}
 140
 141static inline void shm_lock_by_ptr(struct shmid_kernel *ipcp)
 142{
 143        rcu_read_lock();
 144        spin_lock(&ipcp->shm_perm.lock);
 145}
 146
 147static inline struct shmid_kernel *shm_lock_check(struct ipc_namespace *ns,
 148                                                int id)
 149{
 150        struct kern_ipc_perm *ipcp = ipc_lock_check(&shm_ids(ns), id);
 151
 152        if (IS_ERR(ipcp))
 153                return (struct shmid_kernel *)ipcp;
 154
 155        return container_of(ipcp, struct shmid_kernel, shm_perm);
 156}
 157
 158static inline void shm_rmid(struct ipc_namespace *ns, struct shmid_kernel *s)
 159{
 160        ipc_rmid(&shm_ids(ns), &s->shm_perm);
 161}
 162
 163
 164/* This is called by fork, once for every shm attach. */
 165static void shm_open(struct vm_area_struct *vma)
 166{
 167        struct file *file = vma->vm_file;
 168        struct shm_file_data *sfd = shm_file_data(file);
 169        struct shmid_kernel *shp;
 170
 171        shp = shm_lock(sfd->ns, sfd->id);
 172        BUG_ON(IS_ERR(shp));
 173        shp->shm_atim = get_seconds();
 174        shp->shm_lprid = task_tgid_vnr(current);
 175        shp->shm_nattch++;
 176        shm_unlock(shp);
 177}
 178
 179/*
 180 * shm_destroy - free the struct shmid_kernel
 181 *
 182 * @ns: namespace
 183 * @shp: struct to free
 184 *
 185 * It has to be called with shp and shm_ids.rw_mutex (writer) locked,
 186 * but returns with shp unlocked and freed.
 187 */
 188static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
 189{
 190        ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
 191        shm_rmid(ns, shp);
 192        shm_unlock(shp);
 193        if (!is_file_hugepages(shp->shm_file))
 194                shmem_lock(shp->shm_file, 0, shp->mlock_user);
 195        else if (shp->mlock_user)
 196                user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size,
 197                                                shp->mlock_user);
 198        fput (shp->shm_file);
 199        security_shm_free(shp);
 200        ipc_rcu_putref(shp);
 201}
 202
 203/*
 204 * shm_may_destroy - identifies whether shm segment should be destroyed now
 205 *
 206 * Returns true if and only if there are no active users of the segment and
 207 * one of the following is true:
 208 *
 209 * 1) shmctl(id, IPC_RMID, NULL) was called for this shp
 210 *
 211 * 2) sysctl kernel.shm_rmid_forced is set to 1.
 212 */
 213static bool shm_may_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
 214{
 215        return (shp->shm_nattch == 0) &&
 216               (ns->shm_rmid_forced ||
 217                (shp->shm_perm.mode & SHM_DEST));
 218}
 219
 220/*
 221 * remove the attach descriptor vma.
 222 * free memory for segment if it is marked destroyed.
 223 * The descriptor has already been removed from the current->mm->mmap list
 224 * and will later be kfree()d.
 225 */
 226static void shm_close(struct vm_area_struct *vma)
 227{
 228        struct file * file = vma->vm_file;
 229        struct shm_file_data *sfd = shm_file_data(file);
 230        struct shmid_kernel *shp;
 231        struct ipc_namespace *ns = sfd->ns;
 232
 233        down_write(&shm_ids(ns).rw_mutex);
 234        /* remove from the list of attaches of the shm segment */
 235        shp = shm_lock(ns, sfd->id);
 236        BUG_ON(IS_ERR(shp));
 237        shp->shm_lprid = task_tgid_vnr(current);
 238        shp->shm_dtim = get_seconds();
 239        shp->shm_nattch--;
 240        if (shm_may_destroy(ns, shp))
 241                shm_destroy(ns, shp);
 242        else
 243                shm_unlock(shp);
 244        up_write(&shm_ids(ns).rw_mutex);
 245}
 246
 247/* Called with ns->shm_ids(ns).rw_mutex locked */
 248static int shm_try_destroy_current(int id, void *p, void *data)
 249{
 250        struct ipc_namespace *ns = data;
 251        struct kern_ipc_perm *ipcp = p;
 252        struct shmid_kernel *shp = container_of(ipcp, struct shmid_kernel, shm_perm);
 253
 254        if (shp->shm_creator != current)
 255                return 0;
 256
 257        /*
 258         * Mark it as orphaned to destroy the segment when
 259         * kernel.shm_rmid_forced is changed.
 260         * It is noop if the following shm_may_destroy() returns true.
 261         */
 262        shp->shm_creator = NULL;
 263
 264        /*
 265         * Don't even try to destroy it.  If shm_rmid_forced=0 and IPC_RMID
 266         * is not set, it shouldn't be deleted here.
 267         */
 268        if (!ns->shm_rmid_forced)
 269                return 0;
 270
 271        if (shm_may_destroy(ns, shp)) {
 272                shm_lock_by_ptr(shp);
 273                shm_destroy(ns, shp);
 274        }
 275        return 0;
 276}
 277
 278/* Called with ns->shm_ids(ns).rw_mutex locked */
 279static int shm_try_destroy_orphaned(int id, void *p, void *data)
 280{
 281        struct ipc_namespace *ns = data;
 282        struct kern_ipc_perm *ipcp = p;
 283        struct shmid_kernel *shp = container_of(ipcp, struct shmid_kernel, shm_perm);
 284
 285        /*
 286         * We want to destroy segments without users and with already
 287         * exit'ed originating process.
 288         *
 289         * As shp->* are changed under rw_mutex, it's safe to skip shp locking.
 290         */
 291        if (shp->shm_creator != NULL)
 292                return 0;
 293
 294        if (shm_may_destroy(ns, shp)) {
 295                shm_lock_by_ptr(shp);
 296                shm_destroy(ns, shp);
 297        }
 298        return 0;
 299}
 300
 301void shm_destroy_orphaned(struct ipc_namespace *ns)
 302{
 303        down_write(&shm_ids(ns).rw_mutex);
 304        if (shm_ids(ns).in_use)
 305                idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_orphaned, ns);
 306        up_write(&shm_ids(ns).rw_mutex);
 307}
 308
 309
 310void exit_shm(struct task_struct *task)
 311{
 312        struct ipc_namespace *ns = task->nsproxy->ipc_ns;
 313
 314        if (shm_ids(ns).in_use == 0)
 315                return;
 316
 317        /* Destroy all already created segments, but not mapped yet */
 318        down_write(&shm_ids(ns).rw_mutex);
 319        if (shm_ids(ns).in_use)
 320                idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_current, ns);
 321        up_write(&shm_ids(ns).rw_mutex);
 322}
 323
 324static int shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 325{
 326        struct file *file = vma->vm_file;
 327        struct shm_file_data *sfd = shm_file_data(file);
 328
 329        return sfd->vm_ops->fault(vma, vmf);
 330}
 331
 332#ifdef CONFIG_NUMA
 333static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
 334{
 335        struct file *file = vma->vm_file;
 336        struct shm_file_data *sfd = shm_file_data(file);
 337        int err = 0;
 338        if (sfd->vm_ops->set_policy)
 339                err = sfd->vm_ops->set_policy(vma, new);
 340        return err;
 341}
 342
 343static struct mempolicy *shm_get_policy(struct vm_area_struct *vma,
 344                                        unsigned long addr)
 345{
 346        struct file *file = vma->vm_file;
 347        struct shm_file_data *sfd = shm_file_data(file);
 348        struct mempolicy *pol = NULL;
 349
 350        if (sfd->vm_ops->get_policy)
 351                pol = sfd->vm_ops->get_policy(vma, addr);
 s="285"> 285        v05t kern_ipc_pe;data)
datapol = v05t kern_ipc_pe;addr);
 284
 275               addr);
 276}
 276}
 328
 279static int (struct file * vma, struct vm_area_s">pol = v05de=vm_ops" clas6c/shm.cpc/shm.c#3260" id="L260" class="li3e" na36="L280"> 280{
 281        struct shm_file_data *sfd = shm_file_data(file);
 262<static int de=rw_mutex" claet="sr">addr);
 263
 264de=rw_mutex" claet="sref">pol = sfd->->pol = sfd->vma, v05d">addr);
 275<285        de=rw_mutex" claet="sre!n_use == 0)
 296     /a>               de=rw_mutex" claet="sr">addr);
 237        sfd->pol = v05t addr);
 332#ifdef  263
 239               if (!sfd->vm_ops->addr);
 276}
 321        v05t (&addr);
 262        get_policy(addr);
 263
 274               de=rw_mutex" claet="sr">addr);
 245}
 316
 279static int (struct pc_perm *vma, struct file * 280{
 229        struct shm_file_data *sfd = shm_file_data(file);
 300
 321        sfd->ns);
 262        shm_file_data(pol = NULL;
 283<>pol = (ns);
 274    >err = 0;
 245}
 316
 279static int ->vma, de=rw_mutex" clloff_>"srefstatic int vma, de=rw_mutex" clloff_>"srefstatic int static int shsyncm_file_data" cl">shsync"srese == 0)
 280{
 229        struct shm_file_data *sfd = shm_file_data(file);
 300
 291        if (!sfd->-> == 0)
 292            -le->NULL;
 274          if (!sfd->->pol = sfd->vma, vma, shsyncm_file_data" cl">shsync"sresf">NULL;
 245}
 245}
 226  unsigned long ->vma, de=rw_mutex" clloff_>"srefstatic int de=rw_mutex" cloffsa>"sree"> 245}
 217               ">vma, de=rw_mutex" clloff_>"srefstatic int getse == 0)
 280{
 229        struct shm_file_data *sfd = shm_file_data(file);
 300
 291        if (!sfd->-> == 0)
 292            -le->NULL;
 274          if (!sfd->->(vma, vma, de=rw_mutex" cloffsa>"sreefstatic int getsf">NULL;
 245}
 245}
 226           unsigned long (struct -> 245}
 217<           unsigned long get,<           unsigned long  245}
 217<           unsigned long  == 0)
 249{
 230        struct shm_file_data *sfd = shm_file_data(file);
 274          if (!sfd->->sfd->vma, get,>file);
 292                                     igned long file);
 245}
 284
 226constf">vma, struct  2oref="+code=ns" clref==="er> 2ore"srefstatic int  2oref="+code=ns" clrss="sref="er> 2ore="sref"9"> 249{
 296ns).sfd = file);
 317ns).sfd =  318ns).sfd = file);
 263
 320ns).sfd = file);
 276}
 320ns).sfd = file);
 317ns).sfd = file);
 245}
 226constf">vma, struct  2oref="+code=ns" clref==="er> 2ore"srefstatic int  2ore_hugode=up_write" class="sref="er> 2ore_hugo="sref"9"> 249{
 317ns).sfd = file);
 318ns).sfd =  329ns).sfd = file);
 320ns).sfd = file);
 320ns).sfd = file);
 320ns).sfd = file);
 284
-> 249{
 337          if (!in__write(& 2ore_hugode=up_write" class="sref="er> 2ore_hugo="sr">file);
 245}
 349
 226constf">vma, struct  249{
 320ns).sfd = get, 320         320ns).sfd = get, 320/a>        
 317ns).sfd = sh,>file);
pol = CONFse == 0)
 317ns).set f">sfd = shm_set,>file);
 296ns).get f">sfd = shm_get,>file);
 276}
file);
 349
 290         *
 290 290ipc_        *
data)
 290 290
 290/* Csss="srshm_ids(nsheld as a ="srershp locking.
 286
 277
 279static int (struct ipc_namespace *vma, struct  * == 0)
 249{
 320 *de=rw_mutex" clkey_>"srefstatic int get f">sfd = ->get">file);
 281<static int sfd = ->file);
 262        de=rw_mutex" clrize_>"srefstatic int sfd = ->ns).file);
 281<static int file);
 264        struct shmid_kernel *file);
 275<2/a>static int pol = static int static int file);
 346        struct file);
 237static int file);
 275<2/a>static int file);
 239        de=rw_mutex" class=lage_>"srefstatic int err = 0;
 300
 291 >pol = static int static int shp-> 292            -le->NULL;
 263
 274 >pol = shp->static int shp-> 315            -le->NULL;
 316
 237        sfd =  *file);
 338        if (! 339            -le->NULL;
 300
 321        shp->ns).get f">sfd = get">file);
 262        shp->ns).pol = static int file);
 283<>pol = shp->sfd = NULL;
 284
 262        shp->ns).get f">sfd = NULL;
 306        sfd = pol = NULL;
 338 /a>         249{
 339     >sfd = pol = NULL;
 339            static int file);
 320<5"> 245}
 331
 262        pol = "SYSV%08x"x lockeesigned long get)f">NULL;
 274        if (static int  249{
 344     /a>        ict account2/g=tex locked */
 315     /a>        if (static int  296     2"> 262                NULL;
 217         struct         vma, vma, file);
 339                             _write(&shp->vma, get)f">NULL;
 229<}285"> 9"> 249{
 320      a>         290glocked */
 290it's asked=forshp locking.
 290
 344     /a> (        if (static int  315     0"> 320            if (         296     2"> 262                NULL;
 217         struct         vma, vma, NULL;
 217<5"> 245}
 239        sfd = pol = file);
 230        if (pol =  274<<<<<<<<sfd = NULL;
 342
 283<>pol = sfd = (&pol = shp->vma, shp->file);
 274 >pol = 0)"9"> 249{
 315     /a>        sfd = file);
 296     goto">sfd = file);
 317<5"> 245}
 328
 239        shp->sfd = pol = file);
 320 *shp->err = 0;
 321        shp->        shp->err = 0;
 262        shp->        file);
 283<>pol = shp->        file);
 264shp->err = 0;
 262        shp->        file);
 306        shp->        file);
 317< a>         290 290
 290
 321        ->->        shp->ns).file);
 342
 283<>pol = shp->sfd = ns). 306                shp->ns). =/a>
->pol =  339            static int  249<5a>{
file);
 296     goto">sfd =  ugopage/a>(int pol =  283<>pol = shp-> 3495/a>
->vma,  283<>pol = shp-> 249<5a>{
ns).pol =  274<<<<<<<<sfd =  283<>pol = 8ss=sllocc_na3"> creator" cltask_tgidtr" _get_>pol = pol =  339            static int file);
 317t,>file);
 276<5a>}
file);
 290 3495/a>
 =  27peroc_naef">ns). 34e=shref="ef">shp->L345"ss=rcu_slloc_getclap/a> =  281<static int 0)     *
55"L323" class="li4e" na4e="L264"> 264        struct shmid_kernel * 262         =  =  264        struct shp-> 339   ass=sllocc_namssocisfd = pol = static int  317277"> 2775/a>
 249<5a>{
 290file);
file);
 =  27more_checkrite(& 34e=shref="ef">shp->L345"ss=rcu_slloc_getclap/a> = );
vma, struct  *file);
0)r">file);
 264        struct shmid_kernel *file);
file);
 237         =  =  264        struct shp->file);
 283<>pol = shp->sfd = ->ns). =5>);
 339            -le-> 3005/a>
 =5 0)
 317ef">NULL<5a>;
 2635/a>
 339    SYSCALL_DEFINE3  -le->vma,  320 *YSV%08x"x lockeesigned long vma, static int file0)ef">NULL<5a>;
 34i_policy(struct ipc_namespace *file
 34i_poefstatic int file);
vma, struct , struct  =5>);
NULL<5a>;
        , struct  * 3005/a>
file);
newtatic int new* 279static int NULL<5>);
setroc_naef">ns). 2635a>;
(&file
NULL<5a>;
ns).get f">sfd = g5)f">NULL<5a>;
->static int g5)">file{
->ns).        NULL<5a>;
file);
 339   i4egsreef">vma, ipc_namespace *(&pol =  245<5a>}
 317331"> 3315/a>
NULL<5a>;
 =  217<     copocc_nid_tof">shp->shd+codvoidL217"> 217<     _f">shp-> =  26464_write(&64_wrL345"ss=rcu_slloc_getcf">sfd = versiof">sfd =  249<5a>{
0)ked */
sfd = 0)r)>file);
IPC_>);
)L296:" class="li4e" na45="5rf">NULL<5a>;
 339   copoctof">shp->shd+code" class="sref"bu = sfd = sfd = IPC_OLD;
NULL<5a>;
06 9"> 249<6a>{
 264 write(&_wrL345"na4e="L264"> 26ou317ns).ouclashm_creator" clcurrcla"s6ked */
vma, ns).ouclash=codece" claode=ns" class="ou317ns).ouclashef="+code=shp" class="sr6cking.
 339   i4e64_=perctofef="ef">shp->d+codf="+code=ns" class="cf">sfd = shp->ns).ouclasha huc_namespace" 3sref">shp->ns).ouclasha huc_namespace" 3sref">shp->sfd = shp->ns).ouclasha huc_namespace" 3sr=ati>shp->de=ex+code=fault" class=cf">sfd = ns).ouclasha huc_namespace" 3srdati>shp->de=ex+code=fault" class=cf">sfd =  217ou317ns).ouclasha huc_namespace" 3srcati>shp->de=ex+code=fault" class=cf">sfd =  339ou317ns).ouclasha huc_namespace" 3srcp>shp->sfd =  339ou317ns).ouclasha huc_namespace" 3srlp>shp->sfd = file);
ns).ouclasha huc_namespace" 3sref">shp->sfd = shp->NULL<6a>;
 339   copoctof">shp->shd+code" class="sref"bu = ns).ouclash=cce" claode=ns" class="ou317ns).ouclashef="+code=shp" class="sr6342"> 3426/a>
 316f">file);
 249<6a>{
 339            -le->file);
 316f7d */);
 316<5"> 245<6a>}
 3286/a>
 = file);
 217<     copocc_nid_fromf">shp->shd+cod"li4e" na4e="L264"> 26464_write(&64_wrL345"ss=rcu_slloc_getou317ns).ouclash=cvoidL217"> 217<     _f">shp-> = versiof">sfd = 06>err 6 0;
sfd = 06f">file);
IPC_>);
)L296:" class="li4e" na45="6t">file);
shp->shd+cods=rcu_slloc_getou317ns).ouclash=ce" class="sref"bu = ns).ouclashef"" class="li4e" na47="6>9"> 249<6 0;
 339     FAULstatic int file);
file);
IPC_OLD;
06f28"> 3286an>
 264 write(&_wrL345"na4e="L264"> 26tbu<_olshp->shp->shd+codf="+code=ns" class="tbu<_olshp-> = file);
 339     FAULstatic int  3426/a>
);
ns).ouclashhf="+code=shp" class="sref">shp->shp->->shp->shp-> 249<6/a>
ns).ouclashhf="+code=shp" class="sref">shp->shp->->shp->shp->filens).ouclashef="+code=shp" class="sref">shp->ns).->shp->ns).file{
file);
}
 316349"> 3496/a>
 249<6a>{
 339            -le-> 316342"> 3426an>
 3163href="+c6>);
 =  217<     copocc_ninfo_tof">shp->shd+codvoidL217"> 217<     _f">shp-> =  264);
)hm_crce" class="sref"cf">sfd = versiof">sfd = 06t,>file);
sfd = 06if"> 276<6a>}
IPC_>);
)L296:" class="li4e" na45="6}">file);
 339   copoctof">shp->shd+code" class="sref"bu = sfd = sfd =  3496/a>
IPC_OLD;
06     *
 264 26ou317ns).ouclashm_creator" clcurrcla"s6     *
65"L273" class="li4e" na47="6     *
sfd = ns).ouclasha huc_namespace" 3s>shp->file
file
ns).ouclasha huc_namespace" 3s>shp->sfd =  276<6/a>
 339ou317ns).ouclasha huc_namespace" 3smcf">sfd = sfd = sfd =  249<6a>{
ns).ouclasha huc_namespace" 3s>shp->sfd = );
ns).ouclasha huc_namespace" 3s79static int < 3s79sfd = );
ns).ouclasha huc_namespace" 3sal  struct sfd = );
file);
 339   copoctof">shp->shd+code" class="sref"bu = ns).ouclash=cce" claode=ns" class="ou317ns).ouclashef="+code=shp" class="sr6r">file);
 316r">file);
file);
 339            -le->file);
 216tse =6>);
 216>err 6 0;
 3006/a>
 =6 0)
 culatenisatadd====d RSSnisatswap c_ns" of aspan2/g=isis will bl ak9is mshp l6ef">NULL<6a>;
 290file
file 217<     pan add_rss_swapshp-> 264        struct shmid_kernel *NULL<6a>;
file
06a">file);
->NULL<6a>;
        shp->->-> 3006/a>
file);
 ugopage/a>(int         shp->063f">NULL<6>);
static int ->static int <"smappin<+cod+code=NULL" clEINVA="s63">file;
->->shp-> claset_policy" clISe""sreff"/a>        shp->file
c_ns"f=peee=ip_c_ns claset_policy" clIShp->static int sfd = ns).NULL<6a>;
063">file;
sfd = file{
 264-> 339spin_ocksshp->->file);
static int <"smappin<+cod_namespace" clparamsnret +f">sfd = ns). 245<6a>}
swapped   ns).file
->NULL<6a>;
 249<6a>{
static int <"smappin<+cod_namespace" clparamsnret +f">sfd = ns).file
ns).NULL<6>);
 316rf">NULL<6a>;
 316t,>file);
NULL<6a>;
 249<7a>{
 290
 217<     pan resec clshp-> 26i_policy(struct ipc_namespace *07k5d */
next  goto">sfd = ns).tota  struct sfile->s   ns).;
;
file);
sfile->s   (&pol = sfile->s   ns).NULL<7a>;
 3427/a>
tota  struct sfd = tota  struct sfile->s   sfd = 07f">file);
shp->L345"ss=rcu_slloc_getclastruct ns).{
 264        struct shmid_kernel *file);
 217clastruct ns)r_fine clasf="+code=ns" class="    _write(&pol = ->sfd =  245<7a>}
 lastruct -> 3287/a>
file);
 237         =  264        struct shp-> 237        rssa hrinli4e" na44="L29hwphmid_kernelswpflg_"f="+code=shp" class="s7>42"> 3427>);
file);
tota  struct  317e">file);
 317e">file);
 3287an>
         3427/a>
 2ctl_dowf">sfd =  26i_policy(struct ipc_namespace * 2>shp->-> 264 write(&_wrL345"na4e="L264"> 26_f">shp-> = versiof">sfd =  249<7/a>
073">file 34e=shref="ef">shp->L345"ss=rcu_slloc_getclap/a> = file{
 34s64_write(&64_wrL345"na46="L346"> 34s64ite(&64;m_ff="+code=shp" class="s73ed */);
shmid_kernel *erhp-> 3497/a>
 249<7a>{
07yet */
shp->shd+codf="+code=ns" class="   a>64ite(&64;m_f=ce" class="sref"bu = versiof">sfd =  3427an>
 339     FAULstatic int );
 317Fse =7 0)
sfd = pol = (&pol =  2>shp->->file);
shp-> 276<7a>}
 =  339   PTR_ERRtatic int  =  3497/a>
 237         =  =  264        struct shp->75"L283" class="li4e" na4e="L2erhp->-> 237        ->
07 ,>file
IPC_RMID;
 276<7/a>
 339docc_n_r2>shp->sd+code=vm_ops" clref=id+_get_>pol =  =  249<7a>{
IPC_SEstatic int shp->d+codf="+code=ns" class="   a>64ite(&64;m_fa huc_namespace" 3sref">shp-> =         (&);
file);
 339            -le->file);
 317e">file);
 276<7>);
 237        pol = r=* omme ahr"f="+code=shp" class="s7300"> 3007/a>
 339   erhp-> 317ef">NULL<7a>;
file
 339   SYSCALL_DEFINE3p->-> 2>shp->-> 264 write(&_wrL345"na4e="L264"> 26_f">shp-> = file07ef">NULL<7a>;
 344        struct shmid_kernel *file
erhp->versiof">sfd =  276<7>);
ipc_namespace *NULL<7a>;
 2>shp->07300"> 3007/a>
-> 339            -le->file);
NULL<7>);
 3173">file;
file
versiof">sfd = sfd = NULL<7a>;
->file;
file{
 =7a>;
IPC_INFOtatic int file);
07<5"> 245<7a>}
 264);
)hm_crna4e="L264"> 264file
NULL<7a>;
 339   erhp->->->-> 249<7a>{
file
 339   erhp->NULL<7>);
NULL<7a>;
 217memse="p-> 339   anfo;
shp->static int < 3s79ipc_namespace * 339s  anfo;
shp->ipc_namespace * 249<8a>{
ipc_namespace * 249<8a>}
cf">sfd = shp->shd+coi4"li5e" na52="L2bu = versiof">sfd =  339     FAULstatic int pol = r=* omme ahr"f="+code=shp" class="s8k7d */;
 217erhp->sh>shp->sh>sd+codf="+code=ns" class="    _write(&pol =  339up_a4adtatic int pol = r=* omme ahr"f="+code=shp" class="s8k9d */;
file);
-> 217erhp->NULL<8a>;
 3428/a>
 318f">file);
SHM_INFOtatic int 08e">file);
 264 264);
 245<8a>}
 339   erhp->->->-> 3288/a>
file);
 339   erhp->-> 3428>);
 339   dowf_a4adtatic int pol = r=* omme ahr"f="+code=shp" class="s8t">file);
   _anfo;
(&(&pol = sfile->s   ns).5d */4sfile);
->ipc_namespace * 217get__nfo;
4wap_attemptsa hrta"shm" clref=nattch"sreff8ked */
 339   __nfo;
sfd =  3288an>
 339erhp->sh>shp->sh>sd+codf="+code=ns" class="    _write(&pol = pol = r=* omme ahr"f="+code=shp" class="s8ked */
shp->shd+code" class="sref"bu = 08kerr 8>);
 339erhp-> 339     FAULstatic int  3428/a>
);
 31839"> 249<8/a>
file->-> 339   erhp->file{
 218rking.}
SHM_STAstatic int  3498/a>
IPC_STAstatic int 08yet */
 34s64_write(&64_wrL345"na46="L346"> 34tbu =  3428an>
resul3/a> = );
08t,>file);
 237        ->pol = shp-> 237        08ted */}
 237         3498/a>
 218     *
 217resul3/a> =         shp->ns)VA="+code=NULL" clEINVA="s83et */
08     *
85"L263" class=================ode=ns" class="37"> 237        ->pol = shp->
 237        08     *
 237         218 ed */
 21849"> 249<8a>{
-> 339     ACCEStatic int  la=perpol =         shp->-> 237        ->);
file);
->file);
 217e=shmictofp" 64"ef">shp->d+codf="+code=ns" class="  "sreff"/a>        shp->shp-> 339tbu = s         339tbu = ->         = ->         = ->        shp->sL272" chm_creator" clerre""sreff"/a>        NULL<8a>;
shp->sL272" chm_creator" clerre""sreff"/a>        
tbu = ->        file-> 237        NULL<8a>;
shp->shd+coi4"li5e" na52="L2bu = sfd = file
-> 339     FAULstatic int  276<8>);
);
 = NULL<8a>;
 3008/a>
 218t">file);
SHM_LOCKtatic int NULL<8>);
SHM_UNLOCKtatic int ;
083">file
 34filsfile->m_filsfile->m_filsVA="+code=NULL" clEINVA="s83f">NULL<8a>;
file;
 217ge"> 237        ->pol = shp->file{
IS_ERRtatic int  237        083se =8a>;
 237        file);
 245<8a>}
 218<">file
NULL<8a>;
 339   auditref="obj/a> =  237        shp-> 249<8a>{
file
->pol = shodshod< 08NULL<8>);
shp->sd+cod"f="+code=shp" class="s8"">file;
 339     PERMtatic int file);
        shp->shp->sa hrtf="+cf="+ccode=NULL" clEINVA="s8 =8a>;
        shp->shp-> 249<9a>{
 249<9a>}
 =  219ked */
-> 237        -> 339s  _filsfile->m_filsVA="rhm_creator" clerre""sreff"/a>        m_filsVA="+code=NULL" clEINVA="s9f">file);
 s_fils_hugepag+f">sfd = ->m_filsVA="""" class="li4e" na47="9fed */);
NULL<9a>;
 3429/a>
09f">file);
 34">sho"li4e"a hrs="srefass=">sho"li4e"L315"nel" class="sref">shp->shd+coia" cl>_get    curr50=_">shp->shd+cod"f="+code=shp" class="s9r5d */{
->->m_filsVA=", 1ede=rw_mutex" clr">shp->shd+co"f="+code=shp" class="s9r6d */);
-> 237        shp->->0937d */);
        shp->->        shp->sha hrta"code=shp" class">shp->shd+cof="+code=shp" class="s9r9d */
 219f">file);
 219>err 9 0;
 3429>);
file);
 237        shp->->->m_filsVA=", 0hre" class=rcu_pus "sreff"/a>        shp->sha hr"f="+code=shp" class="s9t7d */);
 217ge"> 237        shp->-> 339  "sreff"/a>        shp->sha hrta"code=shp" classNUL   -le-> 339resefilsfile->->m_filsVA=""f="+code=shp" class="s9cking.
-> 237        ->m_filsVA="hf="+code=shp" classf_mappinstatic int  = ->m_filsVA=""f="+code=shp" class="s9c42"> 3429/a>
);
 21939"> 249<9/a>
IPC_RMID/a> = fileIPC_SEstatic int file{
->mctl_dowfd+codaode=shp" class=id+_get_>pol =  2>shp-> = sfd =  339   erhp-> 3499/a>
 339            -le-> 219yet */
 3429an>
);
-> 237        file);
 339   erhp-> 219yed */}
 3499/a>
 3429an>
95"L2633 class="li5e" na52="L * "raddr"=thing points tone=shmi pc_na, and=there has tonbe a wrapper arounda> 339   do_ 3sclshp->> 2>shp->__">shp->sha hrtnel" class="sref">maddrhp->> 2flstatic int < 3sfl<;m_f,_ode=ns" class="ulongp-> 339   =*elba/a>static int < 3slbaa hr" class=========*ex lo9 ed */
093king. 34s_e=shmihp->"> 237         249<9a>{
 339   addrhp-> 339   =izsfile-> 34filsfile-> 34filsfile-> 3429>);
);
 339   flagid+_get_>polflagia href="+code=shp" class="94se =9>);
 339   prolshp->acc_mrefshp-> 339   ">shoaddrhp->shoaddra href="+code=shp" class="94ed */);
 34ef="shm.pc_nahp-> 34sstatic int < 3s_fils_dataa hrtnel" class="sref"fshp-> 34pathhp-> 34pathhp-> 339   fmref_ta hrs="srefass=fmref_tL300"na46="L346"> 34f_mrefshp->NULL<9a>;
 339            -le->
file = NULL<9a>;
maddrhp->09a">file
09aed */);
);
NULL<9a>;

__ARCH_FORCE_SHMLBAp->file);
NULL<9>);
file
 2193f">NULL<9a>;
file;
09t">file{
09tking.;
file);
file
 219tf">NULL<9a>;
 219thref="+c9a>{
09<">file
 339   prolshp->NULL<9>);
acc_mrefshp->file;
 34f_mrefshp->file);
09 =9a>;
 339   prolshp-> 249<10 9">10 9L306" class="li5e" ne" na46="L281">acc_mrefshp->ode=NULL" clEINVA="s10 1"> 249<10 >}
 249<10 a>
 2110 3"> 249<10 >;
010 4"> 249<10 >{
prolshp-> 249<10 n>
 339   acc_mrefshp-> 249<10 );
 2110 7"> 249<10 >;
 2110 8"> 249<10 );
 249<10 >;
 249<10>);
1"> 249<10>);
2"> 249<10a>;
polcurr50= pol =proxy  249<10/a>
 237        ->pol = shp-> 249<10>);
 237        010>5"> 249<10a>{
 237         249<10>);
 249<10>);
 211018"> 249<10a>}
 249<10/a>
 339     ACCEStatic int  249<10>);
pol =         shp->->010>1"> 249<10 0;
 249<10 0;
 249<10>);
-> 237        -> 249<10>);
 249<10 0;
 249<10>);
 249<10>);
        m_filsVA="hf="+code=shp" classf_pathhp-> 249<10an>
-> 249<10an>
         249<10an>
ns_"izs_reaeespace" class=rcu_pupathhp->->-> 249<10an>
 339   san unocksshp-> 237         249<10>);
 249<10/a>
 339     NOMEMtatic int  249<10>);
->->-> 249<10/a>
-> 249<10 0)
 249<10a>{
 211038"> 249<10>);
-> 249<10a>}
sfd =         m_filsVA=") ? class=========*ex lo1049"> 249<10/a>
m_fils_o=peations_hugeL289":" class="li4e" na45="10/1"> 249<10a>{
m_fils_o=peationsa hr"f="+code=shp" class="s1042"> 249<10an>
-> 249<10an>
 249<10>);
 249<10 0)
static int -> 249<10>);
static int         m_filsVA="hf="+code=shp" classf_mappinstatic int  249<10>);
ns)VA=""hm_creator" clerrge"> 237        shp->ns)VA="+code=NULL" clEINVA="s10/8"> 249<10a>}
pol = pol =  249<10>);
->        m_filsVA="+code=NULL" clEINVA="s1059"> 249<10/a>
polvm_o=iL315"hm_creator" clerrNUL   -le-> 249<10an>
 249<10an>
->-> 249<10an>
 249<10an>
 249<10an>
 249<10an>
shp->aprse>shp->a hr"f="+code=shp" class="s1057"> 249<10an>
static int < 3sfl<;m_ftd="+cm_creator" clerrSHM_REMAP;
01058"> 249<10/a>
 339erhp-> 339            -le-> 249<10 0)
sfd = polcurr50= shp->->->01069"> 249<10a>{
nsnvaleeVA="+code=NULL" clEINVA="s1061"> 249<10>);
 249<10>);
 249<10>);
 249<10>);
 249<10>);
shp->-> 249<10>);
shp->->01067"> 249<10>);
nsnvaleeVA="+code=NULL" clEINVA="s1068"> 249<10>);
 249<10>);
 249<10 0;
shoaddrhp->shoaddra hrta"code=shp" classdocmmaprpgof = ->-> 249<10/a>
shoaddrhp->shoaddra href="+code=shp" class="10 2"> 249<10 0)
 249<10a>;
shoaddrhp->shoaddra hr""aned" clid"sre &lfi>01074"> 249<10/a>
erhp->shoaddrhp->shoaddra href="+code=shp" class="10 5"> 249<10 0)
nsnvaleeVA=":" class="li4e" na45="1076"> 249<10a>;
shp->aprse>shp->a hr"f="+code=shp" class="s1077"> 249<10/a>
 211078"> 249<10>);
 249<10>);
-> 249<10a>;
 211081"> 249<10/a>
 249<10>);
m_idsfile->m_idsd+codaode=shp" class=id+_get_>pol = -> 249<10>);
 237        ->m_ocksd+codaode=shp" class=id+_get_>pol = shp-> 249<10a>;
-> 237         249<10/a>
         249<10a>;
pol =  237         249<10a>;
 217gem_destroyhp-> 2_destroyd+codaode=shp" class=id+_get_>pol =  237         249<10a>{
 249<10a>;
 339s  _unocksshp-> 237         249<10>);
m_idsfile->m_idsd+codaode=shp" class=id+_get_>pol = -> 249<10a>}
 249<10/a>
 249<10a>;
 339   erhp-> 249<10a>{
 249<10an>
 249<10>);
 237         249<10a>;
 249<10>);
 249<10a>;
 249<11 9">110)L263" class="li4e" na4e="L2kfresfile->-> 249<11 >}
 249<11 a>
 249<11 >;
 249<11 >{
 249<11 n>
 249<11 );
-> 2>shp->__">shp->sha hrtnhre" class=rcu_pus 2addrhp-> 2flstatic int < 3sfl<;m_f"" class="li4e" na48="11 7"> 249<11 >;
011 8"> 249<11 );
 339   re="p-> 249<11 >;
 339   erhp-> 249<11>);
 2111>1"> 249<11>);
 339   erhp->-> 2>shp->-> 2flstatic int < 3sfl<;m_fhrf="+code=ns" class="re="p->-> 249<11a>;
 339   erhp-> 249<11/a>
 339   erhp-> 249<11>);
 249<11a>{
-> 249<11>);
 249<11>);
 211118"> 249<11a>}
 249<11/a>
 249<11>);
 249<11 0;
 249<11 0;
 2dlshp->__">shp->sha hrtnhre" class=rcu_pus 2addrhp-> 249<11>);
01124"> 249<11>);
 34mm_"li4e"shp->shp->polcurr50= shp-> 249<11 0;
 34vm_area_"li4e"shp->static int  249<11>);
 339   addrhp->maddrhp-> 249<11>);
re3vaihp-> 339            -le-> 249<11an>
CONFIG_MMU  -le-> 211129"> 249<11an>
-> 249<11an>
 34vm_area_"li4e"shp->-> 249<11an>
 249<11>);
 249<11/a>
 249<11>);
 339   re3vaihp-> 249<11/a>
 249<11 0)
aprse>shp->a hr"f="+code=shp" class="s1137"> 249<11a>{
 211138"> 249<11>);
 249<11a>}
 249<11/a>
 249<11a>{
 249<11an>
 249<11an>
 249<11>);
 249<11 0)
 249<11>);
 249<11>);
 249<11a>}
 249<11>);
 249<11/a>
 249<11an>
 249<11an>
 249<11an>
 249<11an>
 249<11an>
 249<11an>
 249<11an>
 249<11/a>
->shp->-> 249<11 0)
 249<11a>{
CONFIG_MMU  -le-> 211161"> 249<11>);
01162"> 249<11>);
->static int -> 249<11>);
 211164"> 249<11>);
 249<11>);
 249<11>);
 249<11>);
 249<11>);
 249<11>);
polvm_o=iL315"h= f="+code=ns" class="  s_vm_o=id+_get_>pol  s_vm_o=i  249<11 0;
polvm_slartL311"-="li4e" na4e="L2addrhp->static int  = 01171"> 249<11/a>
 249<11 0)
 249<11a>;
->static int ->->->->-> 249<11/a>
shp->static int polvm_slartL311hre" class=rcu_puvma/a>static int ->polvm_slartL311"f="+code=shp" class="s11 5"> 249<11 0)
 249<11a>;
 249<11/a>
 249<11>);
 249<11>);
 249<11a>;
 249<11/a>
re3vaihp-> 249<11>);
vma/a>static int -> 249<11>);
 249<11a>;
 249<11/a>
vma/a>static int -> 249<11a>;
 211187"> 249<11a>;
 211188"> 249<11a>{
 249<11a>;
 249<11>);
 249<11a>}
 249<11/a>
 249<11a>;
->cod3e" na38="L279"eizsfile-> 249<11a>{
->->01195"> 249<11an>
nex"shp->static int -> 249<11>);
 249<11a>;
 249<11>);
polvm_o=iL315"h= f="+code=ns" class="  s_vm_o=id+_get_>pol  s_vm_o=i  249<11a>;
polvm_slartL311"-="li4e" na4e="L2addrhp->static int  =  249<12 9">120>L263li5e" na508"L217"> 2112 1"> 249<12 >}
docmunmapshp->cod3e" na38="L279"m>shp->static int polvm_slartL311hre" class=rcu_puvma/a>static int ->polvm_slartL311"f="+code=shp" class="s12 2"> 249<12 a>
static int -> 249<12 >;
 2112 4"> 249<12 >{
 249<12 n>
 249<12 );
 249<12 >;
 249<12 );
 339            -le-> 249<12 >;
polvm_slartL311"=a" cl>_get    addrhp->polvm_o=iL315"h= f="+code=ns" class="  s_vm_o=id+_get_>pol  s_vm_o=i 01219"> 249<12>);
docmunmapshp->cod3e" na38="L279"m>shp->static int polvm_slartL311hre" class=rcu_puvma/a>static int ->polvm_slartL311"f="+code=shp" class="s12>1"> 249<12>);
re3vaihp-> 249<12a>;
 2112>3"> 249<12/a>
 2112>4"> 249<12>);
5"> 249<12a>{
 249<12>);
aprse>shp->a hr"f="+code=shp" class="s12>7"> 249<12>);
 339   re3vaihp-> 249<12a>}
 2112>9"> 249<12/a>
 249<12>);
CONFIG_PROC_FShp-> 249<12 0;
sysvp" _ 3s_pro _ 3owd+_get_>pol ysvp" _ 3s_pro _ 3owespac"li4e" na46="L346"> 34seqrfilsfile->pol L311hrvoidtncode=shp" classitd+_get_>polit 2"> 249<12 0;
012>3"> 249<12>);
 34sefid_kerneihp-> 237        polit  249<12>);
 339   rsid+_get_>polrsi* 237       wp* 249<12 0;
 249<12>);
 237         237       wp* 249<12>);
 2112>8"> 249<12an>
 237      BITS_PER_LONG* 2112>9"> 249<12an>
 237      SIZE_SPEC*"%10lu"a> 249<12an>
 249<12an>
 237      SIZE_SPEC*"%21lu"a> 249<12>);
 249<12/a>
 211234"> 249<12>);
 339   "eq_piint = cod3e" na38="L279"ed+_get_>pol L311hli5e" na508"L217"> 211235"> 249<12/a>
"%10d %10d  %4o "a> 237      SIZE_SPEC*" %5u %5u  "a> 249<12 0)
"%5lu %5u %5u %5u %5u %10lu %10lu %10lu "a> 249<12a>{
" "a> 237      SIZE_SPEC*"\n"a> 211238"> 249<12>);
 237        shp->-> 211239"> 249<12a>}
 237        shp->nsdL311hli5e" na508"L217"> 211249"> 249<12/a>
 237        shp->-> 211241"> 249<12a>{
 237         211242"> 249<12an>
 237         211243"> 249<12an>
 237         211244"> 249<12>);
         211245"> 249<12 0)
 237        shp->-> 211246"> 249<12>);
 237        shp->-> 211247"> 249<12>);
 237        shp->-> 211248"> 249<12a>}
 237        shp->-> 211249"> 249<12>);
 237         211259"> 249<12/a>
 237         211251"> 249<12an>
 237         211252"> 249<12an>
 211253"> 249<12an>
 237       wp* 249<12an>
 249<12an>
 249<12an>

The original LXR software by the class====http://sourceforge.net/projects/lxr">LXR " naunityL311h this ex=peia52=al versiof by class====mailto:lxr@="4ux.no">lxr@="4ux.noode=e
3/div>
lxr.="4ux.no kindly hosted by class====http://www.redpill-="4pro.no">Redpill L"4pro ASL311h provider of L"4ux consulting and o=peatiofs services since 1995. 3/div>