24 Aug, 2018
1 commit
-
[ Upstream commit ce042c183bcb94eb2919e8036473a1fc203420f9 ]
resp->num is the number of tokens in resp->tok[]. It gets set in
response_parse(). So if n == resp->num then we're reading beyond the
end of the data.Fixes: 455a7b238cd6 ("block: Add Sed-opal library")
Reviewed-by: Scott Bauer
Tested-by: Scott Bauer
Signed-off-by: Dan Carpenter
Signed-off-by: Jens Axboe
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
11 Sep, 2017
1 commit
-
Users who are booting off their Opal enabled drives are having
issues when they have a shadow MBR set up after s3/resume cycle.
When the Drive has a shadow MBR setup the MBRDone flag is set to
false upon power loss (S3/S4/S5). When the MBRDone flag is false
I/O to LBA 0 -> LBA_END_MBR are remapped to the shadow mbr
of the drive. If the drive contains useful data in the 0 -> end_mbr
range upon s3 resume the user can never get to that data as the
drive will keep remapping it to the MBR. To fix this when we unlock
on S3 resume, we need to tell the drive that we're done with the
shadow mbr (even though we didnt use it) by setting true to MBRDone.
This way the drive will stop the remapping and the user can access
their data.Acked-by Jon Derrick:
Signed-off-by: Scott Bauer
Signed-off-by: Jens Axboe
08 Apr, 2017
1 commit
-
Lets not flood the kernel log with messages unless
the user requests so.Signed-off-by: Scott Bauer
Signed-off-by: Jens Axboe
30 Mar, 2017
1 commit
-
trivial fix to spelling mistake in pr_err error message
Signed-off-by: Colin Ian King
Signed-off-by: Jens Axboe
09 Mar, 2017
1 commit
-
Fixes check that the opal user is within the range, and cleans up unused
method variables.Signed-off-by: Jon Derrick
Reviewed-by: Scott Bauer
Signed-off-by: Jens Axboe
24 Feb, 2017
2 commits
-
During an error on a comannd, ex: user provides wrong pw to unlock
range, we will gracefully terminate the opal session. We want to
propagate the original error to userland instead of the result of
the session termination, which is almost always a success.Signed-off-by: Scott Bauer
Signed-off-by: Jens Axboe -
Before we free the opal structure we need to clean up any saved
locking ranges that the user had told us to unlock from a suspend.Signed-off-by: Scott Bauer
Reviewed-by: Christoph Hellwig
Signed-off-by: Jens Axboe
23 Feb, 2017
4 commits
-
By embedding the function data with the function sequence, we can
eliminate the external function data and state variable code. It also
made obvious some other small cleanups.Signed-off-by: Jon Derrick
Reviewed-by: Scott Bauer
Signed-off-by: Jens Axboe -
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
Reviewed-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
Add helper which verifies the response token is valid and matches the
expected value. Merges token_type and response_get_token.Signed-off-by: Jon Derrick
Reviewed-by: Scott Bauer
Reviewed-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
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
Reviewed-by: Christoph Hellwig
Signed-off-by: Jens Axboe
18 Feb, 2017
2 commits
-
Insted of bloating the containing structure with it all the time this
allocates struct opal_dev dynamically. Additionally this allows moving
the definition of struct opal_dev into sed-opal.c. For this a new
private data field is added to it that is passed to the send/receive
callback. After that a lot of internals can be made private as well.Signed-off-by: Christoph Hellwig
Tested-by: Scott Bauer
Reviewed-by: Scott Bauer
Signed-off-by: Jens Axboe -
Not having OPAL or a sub-feature supported is an entirely normal
condition for many drives, so don't warn about it. Keep the messages,
but tone them down to debug only.Signed-off-by: Christoph Hellwig
Reviewed-by: Scott Bauer
Signed-off-by: Jens Axboe
15 Feb, 2017
1 commit
-
When CONFIG_KASAN is enabled, compilation fails:
block/sed-opal.c: In function 'sed_ioctl':
block/sed-opal.c:2447:1: error: the frame size of 2256 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]Moved all the ioctl structures off the stack and dynamically allocate
using _IOC_SIZE()Fixes: 455a7b238cd6 ("block: Add Sed-opal library")
Reported-by: Arnd Bergmann
Signed-off-by: Scott Bauer
Signed-off-by: Jens Axboe
07 Feb, 2017
1 commit
-
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
Reviewed-by: Christoph Hellwig
Signed-off-by: Jens Axboe