Re: [PATCHv3 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Scott Bauer
> } > > +static bool response_token_matches(const struct opal_resp_tok *token, u8 > match) > +{ > + if (IS_ERR_OR_NULL(token) || > + token->type != OPAL_DTA_TOKENID_TOKEN || > + token->pos[0] != match) > + return false; > + return true; > +} > + This is sorta pedantic but from my reading of the code token can never be null. It will either be a valid pointer or ERR_PTR(-EINVAL), but never null. So maybe change this to IS_ERR(token) etc. Other than that little nit: Reviewed-by: Scott Bauer <scott.ba...@intel.com>

Re: [PATCHv3 3/4] block/sed: Check received header lengths

2017-02-15 Thread Scott Bauer
On Wed, Feb 15, 2017 at 12:42:08PM -0700, Jon Derrick wrote: > Add a buffer size check against discovery and response header lengths > before we loop over their buffers. > > Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com>

Re: [PATCHv3 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Scott Bauer
ntel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com>

Re: [PATCH] block: sed-opal: reduce stack size of ioctl handler

2017-02-08 Thread Scott Bauer
On Wed, Feb 08, 2017 at 02:58:28PM -0700, Scott Bauer wrote: > On Wed, Feb 08, 2017 at 10:15:28PM +0100, Arnd Bergmann wrote: > > When CONFIG_KASAN is in use, the sed_ioctl function uses unusually large > > stack, > > as each possible ioctl argument gets its own st

Re: [PATCH] block: sed-opal: reduce stack size of ioctl handler

2017-02-08 Thread Scott Bauer
and. In the future we will have in-kernel callers and I don't want to have to do any get_fs(KERNEL_DS) wizardry. Instead I think we can use a union to lessen the stack burden. I tested this patch just now with config_ksasan and was able to build. >From dfa6a2c842a6e45cab198c9058e753835a81521e M