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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <6be11122-7cf2-641f-abd8-6e379ee1b88f@sberdevices.ru>
Date:   Tue, 6 Dec 2022 20:47:19 +0000
From:   Arseniy Krasnov <AVKrasnov@...rdevices.ru>
To:     Stefano Garzarella <sgarzare@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>
CC:     Bobby Eshleman <bobby.eshleman@...edance.com>,
        Arseniy Krasnov <AVKrasnov@...rdevices.ru>,
        Krasnov Arseniy <oxffffaa@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        kernel <kernel@...rdevices.ru>
Subject: [RFC PATCH v4 0/4] vsock: update tools and error handling

Patchset consists of two parts:

1) Kernel patch
One patch from Bobby Eshleman. I took single patch from Bobby:
https://lore.kernel.org/lkml/d81818b868216c774613dd03641fcfe63cc55a45
.1660362668.git.bobby.eshleman@...edance.com/ and use only part for
af_vsock.c, as VMCI and Hyper-V parts were rejected.

I used it, because for SOCK_SEQPACKET big messages handling was broken -
ENOMEM was returned instead of EMSGSIZE. And anyway, current logic which
always replaces any error code returned by transport to ENOMEM looks
strange for me also(for example in EMSGSIZE case it was changed to
ENOMEM).

2) Tool patches
Since there is work on several significant updates for vsock(virtio/
vsock especially): skbuff, DGRAM, zerocopy rx/tx, so I think that this
patchset will be useful.

This patchset updates vsock tests and tools a little bit. First of all
it updates test suite: two new tests are added. One test is reworked
message bound test. Now it is more complex. Instead of sending 1 byte
messages with one MSG_EOR bit, it sends messages of random length(one
half of messages are smaller than page size, second half are bigger)
with random number of MSG_EOR bits set. Receiver also don't know total
number of messages. Message bounds control is maintained by hash sum
of messages length calculation. Second test is for SOCK_SEQPACKET - it
tries to send message with length more than allowed. I think both tests
will be useful for DGRAM support also.

Third thing that this patchset adds is small utility to test vsock
performance for both rx and tx. I think this util could be useful as
'iperf', because:
1) It is small comparing to 'iperf()', so it very easy to add new
   mode or feature to it(especially vsock specific).
2) It is located in kernel source tree, so it could be updated by the
   same patchset which changes related kernel functionality in vsock.

I used this util very often to check performance of my rx zerocopy
support(this tool has rx zerocopy support, but not in this patchset).

Patchset was rebased and tested on skbuff v5 patch from Bobby Eshleman:
https://lore.kernel.org/netdev/20221202173520.10428-1-bobby.eshleman@bytedance.com/

Changelog:
 v3 -> v4:
 - Kernel patch: update commit message by adding error case description
 - Message bounds test:
   - Typo fix: s/contols/controls
   - Fix error output on 'setsockopt()'s
 - vsock_perf:
   - Add 'vsock_perf' target to 'all' in Makefile
   - Fix error output on 'setsockopt()'s
   - Swap sender/receiver roles: now sender does 'connect()' and sends
     data, while receiver accepts connection.
   - Update arguments names: s/mb/bytes, s/so_rcvlowat/rcvlowat
   - Update usage output and description in README

 v2 -> v3:
 - Patches for VMCI and Hyper-V were removed from patchset(commented by
   Vishnu Dasa and Dexuan Cui)
 - In message bounds test hash is computed from data buffer with random
   content(in v2 it was size only). This approach controls both data
   integrity and message bounds.
 - vsock_perf:
   - grammar fixes
   - only long parameters supported(instead of only short)

 v1 -> v2:
 - Three new patches from Bobby Eshleman to kernel part
 - Message bounds test: some refactoring and add comment to describe
   hashing purpose
 - Big message test: check 'errno' for EMSGSIZE and  move new test to
   the end of tests array
 - vsock_perf:
   - update README file
   - add simple usage example to commit message
   - update '-h' (help) output
   - use 'stdout' for output instead of 'stderr'
   - use 'strtol' instead of 'atoi'

Bobby Eshleman(1):
 vsock: return errors other than -ENOMEM to socket

Arseniy Krasnov(3):
 test/vsock: rework message bound test
 test/vsock: add big message test
 test/vsock: vsock_perf utility

 net/vmw_vsock/af_vsock.c         |   3 +-
 tools/testing/vsock/Makefile     |   3 +-
 tools/testing/vsock/README       |  34 +++
 tools/testing/vsock/control.c    |  28 +++
 tools/testing/vsock/control.h    |   2 +
 tools/testing/vsock/util.c       |  13 ++
 tools/testing/vsock/util.h       |   1 +
 tools/testing/vsock/vsock_perf.c | 434 +++++++++++++++++++++++++++++++++++++++
 tools/testing/vsock/vsock_test.c | 197 ++++++++++++++++--
 9 files changed, 698 insertions(+), 17 deletions(-)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ