21 Jun, 2018

1 commit

  • 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

    Dan Carpenter
     

06 Apr, 2018

1 commit

  • Pull block layer updates from Jens Axboe:
    "It's a pretty quiet round this time, which is nice. This contains:

    - series from Bart, cleaning up the way we set/test/clear atomic
    queue flags.

    - series from Bart, fixing races between gendisk and queue
    registration and removal.

    - set of bcache fixes and improvements from various folks, by way of
    Michael Lyle.

    - set of lightnvm updates from Matias, most of it being the 1.2 to
    2.0 transition.

    - removal of unused DIO flags from Nikolay.

    - blk-mq/sbitmap memory ordering fixes from Omar.

    - divide-by-zero fix for BFQ from Paolo.

    - minor documentation patches from Randy.

    - timeout fix from Tejun.

    - Alpha "can't write a char atomically" fix from Mikulas.

    - set of NVMe fixes by way of Keith.

    - bsg and bsg-lib improvements from Christoph.

    - a few sed-opal fixes from Jonas.

    - cdrom check-disk-change deadlock fix from Maurizio.

    - various little fixes, comment fixes, etc from various folks"

    * tag 'for-4.17/block-20180402' of git://git.kernel.dk/linux-block: (139 commits)
    blk-mq: Directly schedule q->timeout_work when aborting a request
    blktrace: fix comment in blktrace_api.h
    lightnvm: remove function name in strings
    lightnvm: pblk: remove some unnecessary NULL checks
    lightnvm: pblk: don't recover unwritten lines
    lightnvm: pblk: implement 2.0 support
    lightnvm: pblk: implement get log report chunk
    lightnvm: pblk: rename ppaf* to addrf*
    lightnvm: pblk: check for supported version
    lightnvm: implement get log report chunk helpers
    lightnvm: make address conversions depend on generic device
    lightnvm: add support for 2.0 address format
    lightnvm: normalize geometry nomenclature
    lightnvm: complete geo structure with maxoc*
    lightnvm: add shorten OCSSD version in geo
    lightnvm: add minor version to generic geometry
    lightnvm: simplify geometry structure
    lightnvm: pblk: refactor init/exit sequences
    lightnvm: Avoid validation of default op value
    lightnvm: centralize permission check for lightnvm ioctl
    ...

    Linus Torvalds
     

17 Mar, 2018

1 commit


07 Mar, 2018

1 commit

  • Tokens are prefixed by a variable length of bytes. If a bytestring is
    not stored in an tiny or short atom, we have to skip more than one byte
    in order to have the actual bytes not prefixed by the bytes describing
    the actual length of the string.

    Acked-by: Jonathan Derrick
    Signed-off-by: Jonas Rabenstein
    Signed-off-by: Jens Axboe

    Jonas Rabenstein
     

22 Feb, 2018

1 commit

  • On lkml suggestions were made to split up such trivial typo fixes into per subsystem
    patches:

    --- a/arch/x86/boot/compressed/eboot.c
    +++ b/arch/x86/boot/compressed/eboot.c
    @@ -439,7 +439,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height)
    struct efi_uga_draw_protocol *uga = NULL, *first_uga;
    efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
    unsigned long nr_ugas;
    - u32 *handles = (u32 *)uga_handle;;
    + u32 *handles = (u32 *)uga_handle;
    efi_status_t status = EFI_INVALID_PARAMETER;
    int i;

    This patch is the result of the following script:

    $ sed -i 's/;;$/;/g' $(git grep -E ';;$' | grep "\.[ch]:" | grep -vwE 'for|ia64' | cut -d: -f1 | sort | uniq)

    ... followed by manual review to make sure it's all good.

    Splitting this up is just crazy talk, let's get over with this and just do it.

    Reported-by: Pavel Machek
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

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

    Scott Bauer
     

08 Apr, 2017

1 commit


30 Mar, 2017

1 commit


09 Mar, 2017

1 commit


24 Feb, 2017

2 commits


23 Feb, 2017

4 commits


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

    Christoph Hellwig
     
  • 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

    Christoph Hellwig
     

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

    Scott Bauer
     

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

    Scott Bauer