943c1fd security, apparmor: add (Set|Restore)InputLabel

Authored and Committed by Christian Ehrhardt 6 years ago
    security, apparmor: add (Set|Restore)InputLabel
    
    d8116b5a "security: Introduce functions for input device hot(un)plug"
    implemented the code (Set|Restore)InputLabel for several security modules,
    this patch adds an AppArmor implementation for it as well.
    
    That fixes hot-plugging event input devices by generating a rule for the
    path that needs to be accessed.
    
    Example hot adding:
      <input type='passthrough' bus='virtio'>
         <source evdev='/dev/input/event0' />
      </input>
    Creates now:
      "/dev/input/event0" rwk,
    
    Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1755153
    
    Acked-by: Jamie Strandboge <jamie@canonical.com>
    Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>