lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1520455010.git.shuahkh@osg.samsung.com>
Date:   Wed,  7 Mar 2018 13:42:23 -0700
From:   Shuah Khan <shuahkh@....samsung.com>
To:     valentina.manea.m@...il.com, shuah@...nel.org,
        gregkh@...uxfoundation.org
Cc:     Shuah Khan <shuahkh@....samsung.com>, yuyang.du@...el.com,
        k.opasiak@...sung.com, nobuo.iwata@...ixerox.co.jp,
        julien.boibessot@...adeus.com, jdieter@...bg.com,
        peter.senna@...il.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 0/3] More error codes for usbip request/reply messages

Currently ST_OK and ST_NA are the only values defined to communicate
status of a request from a client. Client doesn't know what failed
and prints a cryptic error message that something failed.

This patch series adds more error codes to clearly indicate what failed.
For example, when client sends request to import a device that isn't
export-able, server can send a specific error code to the client.

The first patch moves existing error codes to a common library header
and adds more codes. It also adds an interface to map the code to a
string to print messages from tools.

The second patch changes the server/host to return the right codes
in reply messages when client request fails.

The third patch changes the clinet tools to recognize the new error
codes and print messages.

With this change the messages say why a request failed:
    
    - when a client requests a device that is already exported:
    
    usbip attach -r server_name -b 3-10.2
    usbip: error: Attach Request for 3-10.2 failed - Device busy (exported)
    
    - when a client requests a device that isn't exportable,
    
    usbip attach -r server_name -b 3-10.4
    usbip: error: Attach Request for 3-10.4 failed - Device not found

Shuah Khan (3):
  usbip: tools: add more error codes for usbip request/reply messages
  usbip: usbip_host_common: Use new error codes to return request status
  usbip: tools: change to use new error codes in server reply messages

 tools/usb/usbip/libsrc/usbip_common.c      | 23 +++++++++++++++++++++++
 tools/usb/usbip/libsrc/usbip_common.h      | 11 +++++++++++
 tools/usb/usbip/libsrc/usbip_host_common.c |  5 ++++-
 tools/usb/usbip/src/usbip_attach.c         | 11 +++++------
 tools/usb/usbip/src/usbip_list.c           |  6 ++++--
 tools/usb/usbip/src/usbip_network.c        |  6 +++++-
 tools/usb/usbip/src/usbip_network.h        |  6 ++----
 tools/usb/usbip/src/usbipd.c               | 18 +++++++++---------
 8 files changed, 63 insertions(+), 23 deletions(-)

-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ