Re: [PATCH 2/2] block: sed-opal: fix sparse warning: convert __be64 data

2019-10-03 Thread Scott Bauer
incorrect type in assignment (different > base types) > ../block/sed-opal.c:376:25:expected unsigned long long [usertype] > lowest_lba > ../block/sed-opal.c:376:25:got restricted __be64 const [usertype] > lowest_aligned_lba > > Fixes: 455a7b238cd6 ("block: Add Sed-opal

Re: [PATCH 1/2] block: sed-opal: fix sparse warning: obsolete array init.

2019-10-03 Thread Scott Bauer
size of shadow mbr") > Signed-off-by: Randy Dunlap > Cc: Jens Axboe > Cc: linux-bl...@vger.kernel.org > Cc: Jonas Rabenstein > Cc: David Kozub > --- Un cc'd David and Jonas, +CC'd Jon and Revanth. This looks fine to me too. Reviewed-by: Scott Bauer

Re: [PATCH 0/3] block: sed-opal: add support for shadow MBR done flag and write

2019-05-05 Thread Scott Bauer
On Fri, May 03, 2019 at 10:32:19PM +0200, David Kozub wrote: > On Wed, 1 May 2019, Christoph Hellwig wrote: > > > > I successfully tested toggling the MBR done flag and writing the shadow > > > MBR > > > using some tools I hacked together[4] with a Samsung SSD 850 EVO drive. > > > > Can you subm

Re: [PATCH v4 10/16] block: sed-opal: add ioctl for done-mark of shadow mbr

2019-02-10 Thread Scott Bauer
On Fri, Feb 08, 2019 at 12:44:14AM +, Derrick, Jonathan wrote: > On Thu, 2019-02-07 at 23:56 +0100, David Kozub wrote: > > On Mon, 4 Feb 2019, Christoph Hellwig wrote: > > > > static int opal_enable_disable_shadow_mbr(struct opal_dev *dev, > > > > stru

Re: [PATCH v4 10/16] block: sed-opal: add ioctl for done-mark of shadow mbr

2019-02-07 Thread Scott Bauer
he shadow > > > > mbr stores the required boot files. Of course, this saves also the > > > > (few) commands required to enable the feature if it is already enabled > > > > and one only wants to mark the shadow mbr as done. > > > > > &g

Re: [PATCH v4 00/16] block: sed-opal: support shadow MBR done flag and write

2019-02-04 Thread Scott Bauer
On Mon, Feb 04, 2019 at 07:04:15AM -0800, Christoph Hellwig wrote: > On Fri, Feb 01, 2019 at 09:50:07PM +0100, David Kozub wrote: > > This patch series extends SED OPAL support: it adds IOCTL for setting the > > shadow > > MBR done flag which can be useful for unlocking an OPAL disk on boot and it

Re: [PATCH v3 00/16] block: sed-opal: support shadow MBR done flag and write

2019-01-27 Thread Scott Bauer
x86-64 and arm64 systems. > > The series applies on v5.0-rc3. > > Changes from v2 to v3: > * review suggestions from Scott Bauer > > As Scott suggested I tried to do a more thorough testing, esp. with things > like > wrong passwords/invalid values. I did not observe an

Re: [PATCH v3 15/16] block: sed-opal: don't repeat opal_discovery0 in each steps array

2019-01-27 Thread Scott Bauer
On Tue, Jan 22, 2019 at 11:31:46PM +0100, David Kozub wrote: > Originally each of the opal functions that call next include > opal_discovery0 in the array of steps. This is superfluous and > can be done always inside next. > > Signed-off-by: David Kozub Reviewed-by: Scott Bauer

Re: [PATCH v3 14/16] block: sed-opal: pass steps via argument rather than via opal_dev

2019-01-27 Thread Scott Bauer
e function that set opal_dev.steps returns. > If opal_dev.steps was not set to NULL before return it would become > a dangling pointer. When the steps are passed as argument this > becomes easier to see and more difficult to misuse. > > Signed-off-by: David Kozub Reviewed-by: Scott Bauer

Re: [PATCH v3 13/16] block: sed-opal: check size of shadow mbr

2019-01-27 Thread Scott Bauer
rappy firmwares. > > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 12/16] block: sed-opal: unify retrieval of table columns

2019-01-27 Thread Scott Bauer
Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 11/16] block: sed-opal: ioctl for writing to shadow mbr

2019-01-27 Thread Scott Bauer
and unlocking a locking range the > actual content is accessible. > > Co-authored-by: David Kozub > Signed-off-by: Jonas Rabenstein > Signed-off-by: David Kozub Reviewed-by: Scott Bauer

Re: [PATCH v3 10/16] block: sed-opal: add ioctl for done-mark of shadow mbr

2019-01-27 Thread Scott Bauer
between and the shadow > mbr stores the required boot files. Of course, this saves also the > (few) commands required to enable the feature if it is already enabled > and one only wants to mark the shadow mbr as done. > > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 07/16] block: sed-opal: reuse response_get_token to decrease code duplication

2019-01-27 Thread Scott Bauer
er functions. > > Co-authored-by: Jonas Rabenstein > Signed-off-by: David Kozub > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 09/16] block: sed-opal: split generation of bytestring header and content

2019-01-27 Thread Scott Bauer
rom_user may be > used without an intermediate buffer. > > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 08/16] block: sed-opal: print failed function address

2019-01-27 Thread Scott Bauer
On Tue, Jan 22, 2019 at 11:31:39PM +0100, David Kozub wrote: > From: Jonas Rabenstein > > Add function address (and if available its symbol) to the message if a > step function fails. > > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 02/16] block: sed-opal: use correct macro for method length

2019-01-27 Thread Scott Bauer
On Tue, Jan 22, 2019 at 11:31:33PM +0100, David Kozub wrote: > From: Jonas Rabenstein > > Also the values of OPAL_UID_LENGTH and OPAL_METHOD_LENGTH are the same, > it is weird to use OPAL_UID_LENGTH for the definition of the methods. > > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 03/16] block: sed-opal: unify space check in add_token_*

2019-01-27 Thread Scott Bauer
cation. > > Co-authored-by: David Kozub > Signed-off-by: Jonas Rabenstein > Signed-off-by: David Kozub Reviewed-by: Scott Bauer

Re: [PATCH v3 05/16] block: sed-opal: unify cmd start

2019-01-27 Thread Scott Bauer
the opening and closing tokens for the argument list are already > emitted by cmd_start and cmd_finalize respectively and thus must not be > additionally added. > > Co-authored-by: Jonas Rabenstein > Signed-off-by: David Kozub > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 06/16] block: sed-opal: unify error handling of responses

2019-01-27 Thread Scott Bauer
> Co-authored-by: Jonas Rabenstein > Signed-off-by: David Kozub > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 04/16] block: sed-opal: close parameter list in cmd_finalize

2019-01-27 Thread Scott Bauer
> Signed-off-by: David Kozub > Signed-off-by: Jonas Rabenstein Reviewed-by: Scott Bauer

Re: [PATCH v3 01/16] block: sed-opal: fix typos and formatting

2019-01-27 Thread Scott Bauer
On Tue, Jan 22, 2019 at 11:31:32PM +0100, David Kozub wrote: > This should make no change in functionality. > The formatting changes were triggered by checkpatch.pl. > > Signed-off-by: David Kozub Reviewed-by: Scott Bauer

Re: [PATCH v2 11/16] block: sed-opal: ioctl for writing to shadow mbr

2019-01-20 Thread Scott Bauer
On Sun, Jan 20, 2019 at 11:27:30AM +0100, David Kozub wrote: > On Sat, 19 Jan 2019, Scott Bauer wrote: > > > On Thu, Jan 17, 2019 at 09:31:51PM +, David Kozub wrote: > > > > > +static int write_shadow_mbr(struct opal_dev *dev, void *data) > > > +{ &g

Re: [PATCH v2 15/16] block: sed-opal: don't repeat opal_discovery0 in each steps array

2019-01-19 Thread Scott Bauer
On Thu, Jan 17, 2019 at 09:31:55PM +, David Kozub wrote: > - for (state = 0; !error && state < n_steps; state++) { > - step = &steps[state]; > - > - error = step->fn(dev, step->data); > - if (error) { > - pr_debug("Step %zu (%pS) fail

Re: [PATCH v2 13/16] block: sed-opal: check size of shadow mbr

2019-01-19 Thread Scott Bauer
On Thu, Jan 17, 2019 at 09:31:53PM +, David Kozub wrote: > From: Jonas Rabenstein > > Check whether the shadow mbr does fit in the provided space on the > target. Also a proper firmware should handle this case and return an > error we may prevent problems or even damage with crappy firmwares.

Re: [PATCH v2 11/16] block: sed-opal: ioctl for writing to shadow mbr

2019-01-19 Thread Scott Bauer
On Thu, Jan 17, 2019 at 09:31:51PM +, David Kozub wrote: > +static int write_shadow_mbr(struct opal_dev *dev, void *data) > +{ > + struct opal_shadow_mbr *shadow = data; > + const u8 __user *src; > + u8 *dst; > + size_t off = 0; > + u64 len; > + int err = 0; > + > +

Re: [PATCH v2 09/16] block: sed-opal: split generation of bytestring header and content

2019-01-19 Thread Scott Bauer
On Thu, Jan 17, 2019 at 09:31:49PM +, David Kozub wrote: > - > - memcpy(&cmd->cmd[cmd->pos], bytestring, len); > + start = &cmd->cmd[cmd->pos]; > cmd->pos += len; This is somewhat pendatic, but it helps me review patches if we keep things together. Since we're no longer doing th

Re: [PATCH 00/16] block: sed-opal: support shadow MBR done flag and write

2019-01-17 Thread Scott Bauer
On Wed, Jan 16, 2019 at 09:56:51PM +, David Kozub wrote: > block: sed-opal: rename next to execute_steps I don't see this change anywhere on the lists. I have 0->15, but am missing 16/16. Please resend v2 with the changes Christoph requested, so it's easier to review. Lastly, please CC me

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-04-05 Thread Scott Bauer
On Thu, Mar 29, 2018 at 08:27:30PM +0200, catch...@ghostav.ddnss.de wrote: > On Thu, Mar 29, 2018 at 11:16:42AM -0600, Scott Bauer wrote: > > Yeah, having to autheticate to write the MBR is a real bummer. Theoretically > > you could dd a the pw struct + the shador MBR into sysfs. B

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-29 Thread Scott Bauer
On Thu, Mar 29, 2018 at 07:30:02PM +0200, Jonas Rabenstein wrote: > Hi, > On Wed, Mar 21, 2018 at 02:43:21AM +0100, Jonas Rabenstein wrote: > > On Tue, Mar 20, 2018 at 04:09:08PM -0600, Scott Bauer wrote: > > > On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-20 Thread Scott Bauer
On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote: > On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: > > On Mon, Mar 19, 2018 at 07:36:50PM +0100, Jonas Rabenstein wrote: > > > Allow modification of the shadow mbr. If the shadow mbr is not marked as > > > done, thi

Re: [PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content

2018-03-19 Thread Scott Bauer
On Mon, Mar 19, 2018 at 08:59:45PM +0100, Christoph Hellwig wrote: > > +static u8 *add_bytestring_header(int *err, struct opal_dev *cmd, size_t > > len) > > { > > size_t header_len = 1; > > bool is_short_atom = true; > > - > > - if (*err) > > - return; > > + char *start; >

Re: [PATCH v2 00/11] block: sed-opal support write to shadow mbr

2018-03-19 Thread Scott Bauer
On Mon, Mar 19, 2018 at 08:53:35PM +0100, Christoph Hellwig wrote: > On Mon, Mar 19, 2018 at 07:36:42PM +0100, Jonas Rabenstein wrote: > > Hi, > > I was advised to resend the patchset as a v2 where all the patches are > > in a flat hierarchy. So here is a complete set which hopefully pleases > > al

Re: [PATCH v2] block: sed-opal: fix u64 short atom length

2018-03-16 Thread Scott Bauer
le changed, 4 insertions(+), 7 deletions(-) Reviewed-by: Scott Bauer Tested-by: Scott Bauer Hi Jens, When you get time can you apply this if you have no objections? Thanks

Re: [PATCH 0/8] block: sed-opal: support write to shadow mbr

2018-03-13 Thread Scott Bauer
On Tue, Mar 13, 2018 at 02:08:53PM +0100, Jonas Rabenstein wrote: > Hi, > this patchset adds support to write data into the shadow mbr of sed-opal > enabled devices. They apply cleanly on today next-tree (next-20180313) > and requires the u64 short atom length fix from [0] as that is still > missin

Re: [PATCH 8/8] block: sed-opal: ioctl for writing to shadow mbr

2018-03-13 Thread Scott Bauer
On Tue, Mar 13, 2018 at 02:09:01PM +0100, Jonas Rabenstein wrote: > Allow modification of the shadow mbr. If the shadow mbr is not marked as > done, this data will be presented read only as the device content. Only > after marking the shadow mbr as done and unlocking a locking range the > actual co

Re: [PATCH 3/8] block: sed-opal: unify cmd start and finalize

2018-03-13 Thread Scott Bauer
On Tue, Mar 13, 2018 at 02:08:56PM +0100, Jonas Rabenstein wrote: > Every step starts with resetting the cmd buffer as well as the comid and > constructs the appropriate OPAL_CALL command. Consequently, those > actions may be combined into one generic function. > > Signed-off-by: Jonas Rabenstein

Re: [PATCH v2] block: sed-opal: fix u64 short atom length

2018-03-07 Thread Scott Bauer
le changed, 4 insertions(+), 7 deletions(-) > Reviewed-by: Scott Bauer Your two patches should be sent to stable for 4.14. I can queue those up and do it, or if you want to you can do it as well. Let me know what you prefer!

Re: [PATCH][RESEND] block: sed-opal: fix response string extraction

2018-03-07 Thread Scott Bauer
On Tue, Mar 06, 2018 at 04:23:24PM -0800, Derrick, Jonathan wrote: > This looks correct. > > Adding my Ack unless Scott has objections > > Acked-by: Jonathan Derrick Reviewed-by: Scott Bauer Nice catch Jonas! Sorry you had to resend, my message filtering was a little too agr

Re: [PATCH v4 1/2] dm-unstripe: unstripe RAID 0/dm-striped device

2017-12-18 Thread Scott Bauer
> > +config DM_UN_STRIPE > > + tristate "Transpose IO to individual drives on a raid device" > > + depends on BLK_DEV_DM > > + ---help--- > > + Enable this feature if you with to unstripe I/O on a RAID 0 > > + device to the respective drive. If your hardware has physical

[PATCH v4 1/2] dm-unstripe: unstripe RAID 0/dm-striped device

2017-12-18 Thread Scott Bauer
-off-by: Scott Bauer Acked-by: Keith Busch --- drivers/md/Kconfig | 10 +++ drivers/md/Makefile | 1 + drivers/md/dm-unstripe.c | 204 +++ 3 files changed, 215 insertions(+) create mode 100644 drivers/md/dm-unstripe.c diff --git a/drivers

[PATCH v4 2/2] dm-unstripe: Add documentation for unstripe target

2017-12-18 Thread Scott Bauer
Signed-off-by: Scott Bauer --- Documentation/device-mapper/dm-unstripe.txt | 130 1 file changed, 130 insertions(+) create mode 100644 Documentation/device-mapper/dm-unstripe.txt diff --git a/Documentation/device-mapper/dm-unstripe.txt b/Documentation/device

[PATCH v4 0/2] dm-unstripe

2017-12-18 Thread Scott Bauer
Change log: v3->v4: Addressed comments from Randy. Modified documentation to be clearer, and fixed small off by one in bounds checking in constructor. v2->v3: 1) Renamed variables in-code to reflect correct terminology with respect to the dm-stripe target. 2) Fixed a __must_check missing

Re: [PATCH v3 1/2] dm-unstripe: unstripe RAID 0/dm-striped device

2017-12-15 Thread Scott Bauer
[snip] On Wed, Dec 13, 2017 at 04:11:44PM -0800, Randy Dunlap wrote: > > >= > Thanks, good catch. > > + tot_sec = i_size_read(bbdev->bd_inode) >> SECTOR_SHIFT; > > + mod = tot_sec % target->chunk_sectors; > > Did you build this on 32-bit also? Is th

Re: [PATCH v3 2/2] dm unstripe: Add documentation for unstripe target

2017-12-13 Thread Scott Bauer
On Wed, Dec 13, 2017 at 04:18:06PM -0800, Randy Dunlap wrote: > Use ASCII characters ___ or ---, not whatever those bottom block characters > are. Argh, sorry, I removed those for an internal review but forgot to remove them here. > > > + > > +The purpose of this unstriping is to provide

[PATCH v3 1/2] dm-unstripe: unstripe RAID 0/dm-striped device

2017-12-13 Thread Scott Bauer
-off-by: Scott Bauer Acked-by: Keith Busch --- drivers/md/Kconfig | 10 +++ drivers/md/Makefile | 1 + drivers/md/dm-unstripe.c | 204 +++ 3 files changed, 215 insertions(+) create mode 100644 drivers/md/dm-unstripe.c diff --git a/drivers

[PATCH v3 0/2] dm-unstripe

2017-12-13 Thread Scott Bauer
Changes from v2->v3: 1) Renamed variables in-code to reflect correct terminology with respect to the dm-stripe target. 2) Fixed a __must_check missing check in the constructor. 3) Used correct types for working with sector remaping. 3) Fixed documentation to reflect the correct termonolog

[PATCH v3 2/2] dm unstripe: Add documentation for unstripe target

2017-12-13 Thread Scott Bauer
Signed-off-by: Scott Bauer --- Documentation/device-mapper/dm-unstripe.txt | 130 1 file changed, 130 insertions(+) create mode 100644 Documentation/device-mapper/dm-unstripe.txt diff --git a/Documentation/device-mapper/dm-unstripe.txt b/Documentation/device

Re: [PATCH v2 2/2] dm unstripe: Add documentation for unstripe target

2017-12-12 Thread Scott Bauer
On Tue, Dec 12, 2017 at 01:10:13PM -0500, Mike Snitzer wrote: > On Mon, Dec 11 2017 at 11:00am -0500, > Scott Bauer wrote: > > OK, but I'm left wondering: why doesn't the user avoid striping across > the cores? > > Do the Intel NVMe drives not provide the ability

[PATCH v2 0/2] dm-unstripe

2017-12-11 Thread Scott Bauer
V1->v2 Changes: 1) Fixed up some spelling errors in documentation. 2) Cleaned up some variable names to something more appropriate.

[PATCH v2 2/2] dm unstripe: Add documentation for unstripe target

2017-12-11 Thread Scott Bauer
Signed-off-by: Scott Bauer --- Documentation/device-mapper/dm-unstripe.txt | 82 + 1 file changed, 82 insertions(+) create mode 100644 Documentation/device-mapper/dm-unstripe.txt diff --git a/Documentation/device-mapper/dm-unstripe.txt b/Documentation/device-mapper

[PATCH v2 1/2] dm-unstripe: unstripe of IO across RAID 0

2017-12-11 Thread Scott Bauer
writes and I/O on opposite cores have lower completion times, and better tail latencies. Signed-off-by: Scott Bauer --- drivers/md/Kconfig | 10 +++ drivers/md/Makefile | 1 + drivers/md/dm-unstripe.c | 197 +++ 3 files changed, 208 insertions

[PATCH 2/2] dm unstripe: Add documentation for unstripe target

2017-12-04 Thread Scott Bauer
Signed-off-by: Scott Bauer --- Documentation/device-mapper/dm-unstripe.txt | 82 + 1 file changed, 82 insertions(+) create mode 100644 Documentation/device-mapper/dm-unstripe.txt diff --git a/Documentation/device-mapper/dm-unstripe.txt b/Documentation/device-mapper

[PATCH 1/2] dm-unstripe: unstripe of IO across RAID 0

2017-12-04 Thread Scott Bauer
writes and I/O on opposite cores have lower completion times, and better tail latencies. Signed-off-by: Scott Bauer --- drivers/md/Kconfig | 10 +++ drivers/md/Makefile | 1 + drivers/md/dm-unstripe.c | 197 +++ 3 files changed, 208 insertions

[PATCH] MAINTAINERS: Remove Rafael from Opal maintainers.

2017-10-31 Thread Scott Bauer
He is no longer working on storage. Signed-off-by: Scott Bauer --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index af0cb69f6a3e..5c0864d7d7ad 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12052,7 +12052,6 @@ F: drivers/mmc/host/sdhci-spear.c

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

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 Reviewed-by: Scott Bauer

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

2017-02-15 Thread Scott Bauer
On Wed, Feb 15, 2017 at 12:42:06PM -0700, Jon Derrick wrote: > The short atom parser can return an errno from decoding but does not > currently return the error as a signed value. Convert all of the parsers > to ssize_t. > > Signed-off-by: Jon Derrick Reviewed-by: Scott Bauer

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

2017-02-15 Thread Scott Bauer
On Wed, Feb 15, 2017 at 12:38:53PM -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 > --- > block/sed-opal.c | 35 +-- > 1 file changed, 21 inserti

[PATCH V6 1/3] uapi: sed-opal fix IOW for activate lsp to use correct struct

2017-02-14 Thread Scott Bauer
The IOC_OPAL_ACTIVATE_LSP took the wrong strcure which would give us the wrong size when using _IOC_SIZE, switch it to the right structure. Fixes: 058f8a2 ("Include: Uapi: Add user ABI for Sed/Opal") Signed-off-by: Scott Bauer --- include/uapi/linux/sed-opal.h | 2 +- 1 file

[PATCH V6 2/3] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-14 Thread Scott Bauer
_IOC_SIZE() Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Reported-by: Arnd Bergmann Signed-off-by: Scott Bauer --- block/sed-opal.c | 133 --- drivers/nvme/host/core.c | 3 +- include/linux/sed-opal.h | 4 +- 3 files ch

[PATCH V6 3/3] Maintainers: Modify SED list from nvme to block

2017-02-14 Thread Scott Bauer
Signed-off-by: Scott Bauer --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index e325373..b983b25 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11094,7 +11094,7 @@ SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER M: Scott Bauer M

Re: [PATCH V5 3/4] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-13 Thread Scott Bauer
On Mon, Feb 13, 2017 at 04:30:36PM +, David Laight wrote: > From: Scott Bauer Sent: 13 February 2017 16:11 > > When CONFIG_KASAN is enabled, compilation fails: > > > > block/sed-opal.c: In function 'sed_ioctl': > > block/sed-opal.c:2447:1: error: the fr

Re: [PATCH V5 1/4] block: sed-opal: change ioctl to take user pointer instead of unsinged long

2017-02-13 Thread Scott Bauer
esOn Mon, Feb 13, 2017 at 09:11:09AM -0700, Scott Bauer wrote: > Signed-off-by: Scott Bauer > --- > block/sed-opal.c | 6 -- > drivers/nvme/host/core.c | 3 ++- > include/linux/sed-opal.h | 4 ++-- > 3 files changed, 8 insertions(+), 5 deletions(-) > > diff

[PATCH V5 1/4] block: sed-opal: change ioctl to take user pointer instead of unsinged long

2017-02-13 Thread Scott Bauer
Signed-off-by: Scott Bauer --- block/sed-opal.c | 6 -- drivers/nvme/host/core.c | 3 ++- include/linux/sed-opal.h | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index bf1406e..2448d4a 100644 --- a/block/sed-opal.c +++ b

[PATCH V5 2/4] uapi: sed-opal fix IOW for activate lsp to use correct struct

2017-02-13 Thread Scott Bauer
the IOW for the IOC_OPAL_ACTIVATE_LSP took the wrong strcure which would give us the wrong size when using _IOC_SIZE, switch it to the right structure. Fixes: 058f8a2 ("Include: Uapi: Add user ABI for Sed/Opal") Signed-off-by: Scott Bauer --- include/uapi/linux/sed-opal.h | 2

SED Opal Fixups

2017-02-13 Thread Scott Bauer
So we have a few patches here, they're pretty small. First patch changes the sed-opal ioctl function parameters to take a void __user* instead of an unsigned long, this required a small cast in the nvme driver. Patch 2 is a UAPI fixup for the IOW to make an ioctl the right size. Patch 3 fixes a com

[PATCH V5 3/4] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-13 Thread Scott Bauer
_IOC_SIZE() Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Reported-by: Arnd Bergmann Signed-off-by: Scott Bauer --- block/sed-opal.c | 130 +++ 1 file changed, 45 insertions(+), 85 deletions(-) diff --git a/block/sed-opal.

[PATCH V5 4/4] Maintainers: Modify SED list from nvme to block

2017-02-13 Thread Scott Bauer
Signed-off-by: Scott Bauer --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index e325373..b983b25 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11094,7 +11094,7 @@ SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER M: Scott Bauer M

[PATCH V4 2/2] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-10 Thread Scott Bauer
_IOC_SIZE() Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Reported-by: Arnd Bergmann Signed-off-by: Scott Bauer --- block/sed-opal.c | 132 --- 1 file changed, 48 insertions(+), 84 deletions(-) diff --git a/block/sed-opal.

[PATCH V4 1/2] uapi: sed-opal fix IOW for activate lsp to use correct struct

2017-02-10 Thread Scott Bauer
the IOW for the IOC_OPAL_ACTIVATE_LSP took the wrong strcure which would give us the wrong size when using _IOC_SIZE, switch it to the right structure. Fixes: 058f8a2 ("Include: Uapi: Add user ABI for Sed/Opal") Signed-off-by: Scott Bauer --- include/uapi/linux/sed-opal.h | 2

Sed-opal Fixes

2017-02-10 Thread Scott Bauer
changes from v3->v4: Changed manual kzalloc + copy from user to memdup_user. This small series fixes a small ABI issue when using the _IOC_SIZE with the Activate Locking SP ioctl. I had put the wrong structure in the IOW macro in the uapi header which caused issues when trying to copy in the cont

Re: [PATCH V3 2/2] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-10 Thread Scott Bauer
On Fri, Feb 10, 2017 at 09:01:23AM +0100, Arnd Bergmann wrote: > On Thursday, February 9, 2017 10:20:01 AM CET Scott Bauer wrote: > > When CONFIG_KASAN is enabled, compilation fails: > > > > block/sed-opal.c: In function 'sed_ioctl': > > block/sed-opal.c:

Re: Sed-opal fixups

2017-02-09 Thread Scott Bauer
e0;136;0csOn Thu, Feb 09, 2017 at 11:24:58AM -0700, Jens Axboe wrote: > On 02/09/2017 10:45 AM, Scott Bauer wrote: > > On Thu, Feb 09, 2017 at 05:43:20PM +, David Laight wrote: > >> From: Scott Bauer > >>> Sent: 09 February 2017 17:20 > >>> It may

Re: Sed-opal fixups

2017-02-09 Thread Scott Bauer
On Thu, Feb 09, 2017 at 05:43:20PM +, David Laight wrote: > From: Scott Bauer > > Sent: 09 February 2017 17:20 > > It may be too late to change anyhting in the uapi header. When we > > switched over to using IOC_SIZE I found a bug where I had switched > > up a str

[PATCH V3 2/2] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-09 Thread Scott Bauer
_IOC_SIZE() Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Reported-by: Arnd Bergmann Signed-off-by: Scott Bauer --- block/sed-opal.c | 134 +-- 1 file changed, 50 insertions(+), 84 deletions(-) diff --git a/block/sed-opal.

[PATCH V3 1/2] uapi: sed-opal fix IOW for activate lsp to use correct struct

2017-02-09 Thread Scott Bauer
the IOW for the IOC_OPAL_ACTIVATE_LSP took the wrong strcure which would give us the wrong size when using _IOC_SIZE, switch it to the right structure. Fixes: 058f8a2 ("Include: Uapi: Add user ABI for Sed/Opal") Signed-off-by: Scott Bauer --- include/uapi/linux/sed-opal.h | 2

Sed-opal fixups

2017-02-09 Thread Scott Bauer
It may be too late to change anyhting in the uapi header. When we switched over to using IOC_SIZE I found a bug where I had switched up a structure in one of the series from v4 to v5 but never changed the structure in the IOW. The structure that was in there was to small so when we kzalloc on it we

[PATCH] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-08 Thread Scott Bauer
oversized stack frame size. Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Reported-by: Arnd Bergmann Signed-off-by: Scott Bauer --- block/sed-opal.c | 187 ++- 1 file changed, 102 insertions(+), 85 deletions(-) diff --git a/bloc

[PATCH v2] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN

2017-02-08 Thread Scott Bauer
oversized stack frame size. Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Reported-by: Arnd Bergmann Signed-off-by: Scott Bauer --- block/sed-opal.c | 187 ++- 1 file changed, 102 insertions(+), 85 deletions(-) diff --git a/bloc

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

2017-02-08 Thread Scott Bauer
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 Mon Sep

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 v3 1/5] include: Add definitions for sed

2016-12-27 Thread Scott Bauer
On Sun, Dec 25, 2016 at 03:15:53PM +0100, Jethro Beekman wrote: > On 19-12-16 20:35, Scott Bauer wrote: > > diff --git a/include/linux/sed.h b/include/linux/sed.h > > > > +/* > > + * These constant values come from: > > + * TCG Storage Architecture Core Spec v2.01

Re: [PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code.

2016-12-27 Thread Scott Bauer
On Sun, Dec 25, 2016 at 03:15:52PM +0100, Jethro Beekman wrote: > On 19-12-16 20:35, Scott Bauer wrote: > > @@ -1796,6 +1797,13 @@ static void nvme_reset_work(struct work_struct *work) > > if (result) > > goto out; > > > > + result = nvme_opal_i

Re: [PATCH v3 2/5] lib: Add Sed-opal library

2016-12-20 Thread Scott Bauer
> > + > > +int fdev_sed_ioctl(struct file *filep, unsigned int cmd, > > + unsigned long arg) > > +{ > > + struct sed_key key; > > + struct sed_context *sed_ctx; > > + > > + if (!capable(CAP_SYS_ADMIN)) > > + return -EACCES; > > + > > + if (!filep->f_sedctx || !filep->

Re: [PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code.

2016-12-20 Thread Scott Bauer
On Tue, Dec 20, 2016 at 07:46:39AM -0800, Christoph Hellwig wrote: > On Tue, Dec 20, 2016 at 10:49:16AM -0500, Keith Busch wrote: > > On Mon, Dec 19, 2016 at 10:17:44PM -0800, Christoph Hellwig wrote: > > > As far as I can tell Security Send / Receive has always been intended to > > > apply to the

Re: [PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code.

2016-12-20 Thread Scott Bauer
On 12/20/2016 08:46 AM, Christoph Hellwig wrote: > On Tue, Dec 20, 2016 at 10:49:16AM -0500, Keith Busch wrote: >> On Mon, Dec 19, 2016 at 10:17:44PM -0800, Christoph Hellwig wrote: >>> As far as I can tell Security Send / Receive has always been intended to >>> apply to the whole controller, eve

Re: [PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code.

2016-12-19 Thread Scott Bauer
On Mon, Dec 19, 2016 at 04:59:54PM -0500, Keith Busch wrote: > On Mon, Dec 19, 2016 at 12:35:48PM -0700, Scott Bauer wrote: > > +static int nvme_sec_submit(struct nvme_ctrl *ctrl, u16 spsp, u8 secp, > > + void *buffer, size_t len, u8 opcode) > > +{ > &

[PATCH v3 1/5] include: Add definitions for sed

2016-12-19 Thread Scott Bauer
This patch adds the definitions and structures for the SED Opal code. Signed-off-by: Scott Bauer Signed-off-by: Rafael Antognolli --- include/linux/sed-opal.h | 38 + include/linux/sed.h | 76 ++ include/uapi/linux/sed-opal.h | 94

[PATCH v3 2/5] lib: Add Sed-opal library

2016-12-19 Thread Scott Bauer
This patch implements the necessary logic to bring an Opal enabled drive out of a factory-enabled into a working Opal state. This patch set also enables logic to save a password to be replayed during a resume from suspend. Signed-off-by: Scott Bauer Signed-off-by: Rafael Antognolli --- lib

[PATCH v3 3/5] fs: Wire up SED/Opal to ioctl

2016-12-19 Thread Scott Bauer
Adds a new sed_context pointer to file struct, for char devs who wish to suppor SED. Adds ioctl handling code. Signed-off-by: Scott Bauer Signed-off-by: Rafael Antognolli --- fs/ioctl.c | 3 +++ include/linux/fs.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/fs/ioctl.c b/fs

[PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code.

2016-12-19 Thread Scott Bauer
This patch implements the necessary logic to unlock a SED enabled device coming back from an S3. The patch also implements the necessary logic to allocate the appropriate opal_dev structures to support the OPAL protocol. Signed-off-by: Scott Bauer Signed-off-by: Rafael Antognolli --- drivers

[PATCH v3 5/5] Maintainers: Add Information for SED Opal library

2016-12-19 Thread Scott Bauer
Signed-off-by: Scott Bauer Signed-off-by: Rafael Antognolli --- MAINTAINERS | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f6eb97b..76d542c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11051,6 +11051,16 @@ L: linux-...@vger.kernel.org S

[PATCH v3 0/5] SED OPAL Library

2016-12-19 Thread Scott Bauer
All commands are exported through the Fs ioctl. Scott Bauer (5): include: Add definitions for sed lib: Add Sed-opal library fs: Wire up SED/Opal to ioctl nvme: Implement resume_from_suspend and SED Allocation code. Maintainers: Add Information for SED Opal library MAINTAINERS

Re: BUG: KASAN: stack-out-of-bounds in unwind_get_return_address

2016-11-30 Thread Scott Bauer
On Wed, Nov 30, 2016 at 12:35:07PM -0600, Josh Poimboeuf wrote: > On Tue, Nov 29, 2016 at 11:13:01AM -0700, Scott Bauer wrote: > > This is super easy to repro ontop of 4.9-rc7: > > run pm-suspend and it hits every time > > &

BUG: KASAN: stack-out-of-bounds in unwind_get_return_address

2016-11-29 Thread Scott Bauer
This is super easy to repro ontop of 4.9-rc7: run pm-suspend and it hits every time [ 968.667086] == [ 968.667091] BUG: KASAN: stack-out-of-bounds in unwind_get_return_address+0x11d/0x130 at addr 8803867d7878 [ 968.667092] R

[PATCH] Validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands.

2016-06-23 Thread Scott Bauer
This patch validates the num_values parameter from userland during the HIDIOCGUSAGES and HIDIOCSUSAGES commands. Previously, if the report id was set to HID_REPORT_ID_UNKNOWN, we would fail to validate the num_values parameter leading to a heap overflow. Signed-off-by: Scott Bauer --- drivers

[PATCH v4 0/4] SROP Mitigation: Sigreturn Cookies

2016-03-29 Thread Scott Bauer
okie calculation from using restored regs->sp to using frame pointer from before restoration. v1->v2 Miscellaneous nits and code cleanup. Scott Bauer (4): SROP Mitigation: Architecture independent code for signal cookies x86: SROP Mitigation: Implement Signal

[PATCH v4 2/4] x86: SROP Mitigation: Implement Signal Cookies

2016-03-29 Thread Scott Bauer
Balasubramanian Signed-off-by: Scott Bauer Signed-off-by: Scott Bauer --- arch/x86/ia32/ia32_signal.c | 65 +++--- arch/x86/include/asm/fpu/signal.h | 2 + arch/x86/kernel/fpu/signal.c | 10 + arch/x86/kernel/signal.c | 83

[PATCH v4 3/4] Sysctl: SROP Mitigation: Add Sysctl argument to disable SROP.

2016-03-29 Thread Scott Bauer
This patch adds a sysctl argument to disable SROP protection. Cc: Abhiram Balasubramanian Signed-off-by: Scott Bauer Signed-off-by: Scott Bauer --- include/linux/signal.h | 1 + kernel/signal.c| 13 +++-- kernel/sysctl.c| 8 3 files changed, 20 insertions

  1   2   >