Skip to content
  1. Jun 06, 2023
  2. Jun 04, 2023
    • Ming Lei's avatar
      ublk: add control command of UBLK_U_CMD_GET_FEATURES · b5bbc52f
      Ming Lei authored
      
      
      Add control command of UBLK_U_CMD_GET_FEATURES for returning driver's
      feature set or capability.
      
      This way can simplify userspace for maintaining compatibility because
      userspace doesn't need to send command to one device for querying driver
      feature set any more. Such as, with the queried feature set, userspace
      can choose to use:
      
      - UBLK_CMD_GET_DEV_INFO2 or UBLK_CMD_GET_DEV_INFO,
      - UBLK_U_CMD_* or UBLK_CMD_*
      
      Userspace code:
      	https://github.com/ming1/ubdsrv/commits/features-cmd
      
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20230603040601.775227-1-ming.lei@redhat.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b5bbc52f
  3. Jun 01, 2023
    • Azeem Shaikh's avatar
      block: Replace all non-returning strlcpy with strscpy · 20d09975
      Azeem Shaikh authored
      
      
      strlcpy() reads the entire source buffer first.
      This read may exceed the destination size limit.
      This is both inefficient and can lead to linear read
      overflows if a source string is not NUL-terminated [1].
      In an effort to remove strlcpy() completely [2], replace
      strlcpy() here with strscpy().
      No return values were used, so direct replacement is safe.
      
      [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
      [2] https://github.com/KSPP/linux/issues/89
      
      Signed-off-by: default avatarAzeem Shaikh <azeemshaikh38@gmail.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20230530155608.272266-1-azeemshaikh38@gmail.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      20d09975