Displaying 4 results from an estimated 4 matches for "8dc1925".
Did you mean:
81925
2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...lag computation between
old and new style handshakes.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
src/connections.c | 120 +++++++++++++++++++++---------------------------------
1 file changed, 47 insertions(+), 73 deletions(-)
diff --git a/src/connections.c b/src/connections.c
index 8dc1925..f9edea7 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -237,13 +237,57 @@ free_connection (struct connection *conn)
}
static int
+compute_eflags (struct connection *conn, uint16_t *flags)
+{
+ uint16_t eflags = NBD_FLAG_HAS_FLAGS;
+ int fl;
+
+ fl = plugin_can_write (conn);
+ if...
2017 Nov 15
1
[nbdkit PATCH] connections: Improve error responses
...return bool instead. And finally,
fix a comment typo.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
src/connections.c | 53 ++++++++++++++++++++++++-----------------------------
1 file changed, 24 insertions(+), 29 deletions(-)
diff --git a/src/connections.c b/src/connections.c
index 8dc1925..264037d 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -666,7 +666,7 @@ negotiate_handshake (struct connection *conn)
return r;
}
-static int
+static bool
valid_range (struct connection *conn, uint64_t offset, uint32_t count)
{
uint64_t exportsize = conn->exportsize;
@@ -67...
2017 Nov 15
0
[nbdkit PATCH 2/2] connections: Hang up early on insanely large WRITE requests
...ge reply, we'd still
be out of sync for further reads, so the simplest option is to
just silently disconnect.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
src/connections.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/connections.c b/src/connections.c
index d0ef6a5..8dc1925 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -879,6 +879,11 @@ skip_over_write_buffer (int sock, size_t count)
char buf[BUFSIZ];
ssize_t r;
+ if (count > MAX_REQUEST_SIZE * 2) {
+ nbdkit_error ("write request too large to skip");
+ return -1;
+ }
+
while...
2017 Nov 15
3
[nbdkit PATCH 0/2] Better response to bogus NBD_CMD_READ
When facing a malicious client that is sending bogus NBD_CMD_READ,
we should make sure that we never end up in a situation where we
could try to treat the tail from a command that we diagnosed as
bad as being further commands.
Eric Blake (2):
connections: Report mid-message EOF as fatal
connections: Hang up early on insanely large WRITE requests
src/connections.c | 35