Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [RFC v2 4/7] modsig: add integrity_module_check hook | Date | Tue, 04 Sep 2012 08:36:28 +0930 |
| |
Dmitry Kasatkin <dmitry.kasatkin@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 signature tail */ > + info->len = err;
This is a bug.
Firstly, you want the 'long' not 'int' as the return vale from integrity_module_check(). But mainly, you want it to return 'len' not 0.
I'd also prefer it to be *immediately* after we copy from userspace.
Cheers, Rusty.
| |