Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-09-03 Thread Rusty Russell
Dmitry Kasatkin writes: > +#else > +static inline int integrity_module_check(const void *buf, unsigned long len) > +{ > + return 0; > +} > +#endif ... > + err = integrity_module_check(hdr, len); > + if (err < 0) > + goto free_hdr; > + > + /* cut signature tail */ > +

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-09-03 Thread Rusty Russell
Dmitry Kasatkin dmitry.kasat...@intel.com writes: +#else +static inline int integrity_module_check(const void *buf, unsigned long len) +{ + return 0; +} +#endif ... + err = integrity_module_check(hdr, len); + if (err 0) + goto free_hdr; + + /* cut

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-16 Thread Kasatkin, Dmitry
On Thu, Aug 16, 2012 at 12:13 AM, Kasatkin, Dmitry wrote: > On Wed, Aug 15, 2012 at 11:16 PM, Serge Hallyn > wrote: >> Quoting Dmitry Kasatkin (dmitry.kasat...@intel.com): >>> IMA measures/appraises modules when modprobe or insmod opens and read them. >>> Unfortunately, there are no guarantees

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-16 Thread Kasatkin, Dmitry
On Thu, Aug 16, 2012 at 9:49 PM, Josh Boyer wrote: > On Wed, Aug 15, 2012 at 2:43 PM, Dmitry Kasatkin > wrote: >> @@ -2437,6 +2438,14 @@ static int copy_and_check(struct load_info *info, >> >> info->hdr = hdr; >> info->len = len; >> + >> + err = integrity_module_check(hdr,

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-16 Thread Josh Boyer
On Wed, Aug 15, 2012 at 2:43 PM, Dmitry Kasatkin wrote: > @@ -2437,6 +2438,14 @@ static int copy_and_check(struct load_info *info, > > info->hdr = hdr; > info->len = len; > + > + err = integrity_module_check(hdr, len); > + if (err < 0) > + goto free_hdr;

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-16 Thread Josh Boyer
On Wed, Aug 15, 2012 at 2:43 PM, Dmitry Kasatkin dmitry.kasat...@intel.com wrote: @@ -2437,6 +2438,14 @@ static int copy_and_check(struct load_info *info, info-hdr = hdr; info-len = len; + + err = integrity_module_check(hdr, len); + if (err 0) +

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-16 Thread Kasatkin, Dmitry
On Thu, Aug 16, 2012 at 9:49 PM, Josh Boyer jwbo...@gmail.com wrote: On Wed, Aug 15, 2012 at 2:43 PM, Dmitry Kasatkin dmitry.kasat...@intel.com wrote: @@ -2437,6 +2438,14 @@ static int copy_and_check(struct load_info *info, info-hdr = hdr; info-len = len; + + err =

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-16 Thread Kasatkin, Dmitry
On Thu, Aug 16, 2012 at 12:13 AM, Kasatkin, Dmitry dmitry.kasat...@intel.com wrote: On Wed, Aug 15, 2012 at 11:16 PM, Serge Hallyn serge.hal...@canonical.com wrote: Quoting Dmitry Kasatkin (dmitry.kasat...@intel.com): IMA measures/appraises modules when modprobe or insmod opens and read them.

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-15 Thread Kasatkin, Dmitry
On Wed, Aug 15, 2012 at 11:16 PM, Serge Hallyn wrote: > Quoting Dmitry Kasatkin (dmitry.kasat...@intel.com): >> IMA measures/appraises modules when modprobe or insmod opens and read them. >> Unfortunately, there are no guarantees between what is read by userspace and >> what is passed to the

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-15 Thread Serge Hallyn
Quoting Dmitry Kasatkin (dmitry.kasat...@intel.com): > IMA measures/appraises modules when modprobe or insmod opens and read them. > Unfortunately, there are no guarantees between what is read by userspace and > what is passed to the kernel via load_module system call. This patch adds a > hook

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-15 Thread Serge Hallyn
Quoting Dmitry Kasatkin (dmitry.kasat...@intel.com): IMA measures/appraises modules when modprobe or insmod opens and read them. Unfortunately, there are no guarantees between what is read by userspace and what is passed to the kernel via load_module system call. This patch adds a hook called

Re: [RFC v2 4/7] modsig: add integrity_module_check hook

2012-08-15 Thread Kasatkin, Dmitry
On Wed, Aug 15, 2012 at 11:16 PM, Serge Hallyn serge.hal...@canonical.com wrote: Quoting Dmitry Kasatkin (dmitry.kasat...@intel.com): IMA measures/appraises modules when modprobe or insmod opens and read them. Unfortunately, there are no guarantees between what is read by userspace and what is