~ubuntu-branches/ubuntu/precise/apparmor/precise-security

« back to all changes in this revision

Viewing changes to parser/parser_policy.c

  • Committer: Package Import Robot
  • Author(s): Steve Beattie, Jamie Strandboge, Serge Hallyn, Steve Beattie
  • Date: 2012-04-12 06:17:42 UTC
  • Revision ID: package-import@ubuntu.com-20120412061742-9v75hjko2mjtbewv
Tags: 2.7.102-0ubuntu3
[ Jamie Strandboge ]
* debian/patches/0007-ubuntu-manpage-updates.patch: update apparmor(5)
  to describe Ubuntu's two-stage policy load and how to add utilize it
  when developing policy (LP: #974089)

[ Serge Hallyn ]
* debian/apparmor.init: do nothing in a container.  This can be
  removed once stacked profiles are supported and used by lxc.
  (LP: #978297)

[ Steve Beattie ]
* debian/patches/0008-apparmor-lp963756.patch: Fix permission mapping
  for change_profile onexec (LP: #963756)
* debian/patches/0009-apparmor-lp959560-part1.patch,
  debian/patches/0010-apparmor-lp959560-part2.patch: Update the parser
  to support the 'in' keyword for value lists, and make mount
  operations aware of 'in' keyword so they can affect the flags build
  list (LP: #959560)
* debian/patches/0011-apparmor-lp872446.patch: fix logprof missing
  exec events in complain mode (LP: #872446)
* debian/patches/0012-apparmor-lp978584.patch: allow inet6 access in
  dovecot imap-login profile (LP: #978584)
* debian/patches/0013-apparmor-lp800826.patch: fix libapparmor
  log parsing library from dropping apparmor network events that
  contain ip addresses or ports in them (LP: #800826)
* debian/patches/0014-apparmor-lp979095.patch: document new mount rule
  syntax and usage in apparmor.d(5) manpage (LP: #979095)
* debian/patches/0015-apparmor-lp963756.patch: Fix change_onexec
  for profiles without attachment specification (LP: #963756,
  LP: #978038)
* debian/patches/0016-apparmor-lp968956.patch: Fix protocol error when
  loading policy to kernels without compat patches (LP: #968956)
* debian/patches/0017-apparmor-lp979135.patch: Fix change_profile to
  grant access to /proc/attr api (LP: #979135)

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
        cod->entries = entry;
173
173
}
174
174
 
175
 
void post_process_nt_entries(struct codomain *cod)
 
175
void post_process_file_entries(struct codomain *cod)
176
176
{
177
177
        struct cod_entry *entry;
 
178
        int cp_mode = 0;
178
179
 
179
180
        list_for_each(cod->entries, entry) {
180
181
                if (entry->nt_name) {
193
194
                        entry->namespace = NULL;
194
195
                        entry->nt_name = NULL;
195
196
                }
 
197
                /* FIXME: currently change_profile also implies onexec */
 
198
                cp_mode |= entry->mode & (AA_CHANGE_PROFILE);
 
199
        }
 
200
 
 
201
        /* if there are change_profile rules, this implies that we need
 
202
         * access to /proc/self/attr/current
 
203
         */
 
204
        if (cp_mode & AA_CHANGE_PROFILE) {
 
205
                /* FIXME: should use @{PROC}/@{PID}/attr/{current,exec} */
 
206
                struct cod_entry *new_ent;
 
207
                char *buffer = strdup("/proc/*/attr/{current,exec}");
 
208
                if (!buffer) {
 
209
                        PERROR("Memory allocation error\n");
 
210
                        exit(1);
 
211
                }
 
212
                new_ent = new_entry(NULL, buffer, AA_MAY_WRITE, NULL);
 
213
                if (!new_ent) {
 
214
                        PERROR("Memory allocation error\n");
 
215
                        exit(1);
 
216
                }
 
217
                add_entry_to_policy(cod, new_ent);
196
218
        }
197
219
}
198
220