Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1175819

[PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS

From David Herrmann <dh.herrmann@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS
Date 2015-07-02 10:40 +0200
Message-ID <pHIci-jZ-13@gated-at.bofh.it> (permalink)
References <pHI2C-gz-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We already limit the size of the message object, there's no reason to add
an arbitrary additional limit on the number of items. We don't do this for
other item-arrays, so lets stop restricting the messages in this way.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
 ipc/kdbus/limits.h  | 3 ---
 ipc/kdbus/message.c | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/ipc/kdbus/limits.h b/ipc/kdbus/limits.h
index 6450f58..c54925a 100644
--- a/ipc/kdbus/limits.h
+++ b/ipc/kdbus/limits.h
@@ -19,9 +19,6 @@
 /* maximum size of message header and items */
 #define KDBUS_MSG_MAX_SIZE		SZ_8K
 
-/* maximum number of message items */
-#define KDBUS_MSG_MAX_ITEMS		128
-
 /* maximum number of memfd items per message */
 #define KDBUS_MSG_MAX_MEMFD_ITEMS	16
 
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index 066e816..c499014 100644
--- a/ipc/kdbus/message.c
+++ b/ipc/kdbus/message.c
@@ -263,9 +263,6 @@ static int kdbus_msg_scan_items(struct kdbus_kmsg *kmsg,
 		size_t payload_size = KDBUS_ITEM_PAYLOAD_SIZE(item);
 		struct iovec *iov = kmsg->iov + kmsg->iov_count;
 
-		if (++n > KDBUS_MSG_MAX_ITEMS)
-			return -E2BIG;
-
 		switch (item->type) {
 		case KDBUS_ITEM_PAYLOAD_VEC: {
 			struct kdbus_msg_data *d = res->data + res->data_count;
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Miscellaneous kdbus fixes and code removal David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 3/6] kdbus: drop unused 'bloom_generation' field David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 4/6] kdbus: drop support for required attach-flags on buses David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
    Re: [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann <dh.herrmann@gmail.com> - 2015-07-05 11:10 +0200
  [PATCH 6/6] kdbus: fix NULL-deref in activator cleanup David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
  [PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
    [PATCH v2 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann <dh.herrmann@gmail.com> - 2015-07-05 10:40 +0200

csiph-web