Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1201560
| From | David Herrmann <dh.herrmann@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/9] kdbus: reduce stack buffer to 256 bytes |
| Date | 2015-08-06 10:30 +0200 |
| Message-ID | <pUoIP-3l2-35@gated-at.bofh.it> (permalink) |
| References | <pUoIN-3l2-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This reduces the stack-buffer for small ioctl payloads to 256 bytes. As
seen during real workloads, this is more than enough. And we really
should reduce stack pressure. Hence, lets limit the stack buffers to 256
bytes.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
ipc/kdbus/handle.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ipc/kdbus/handle.h b/ipc/kdbus/handle.h
index 8a36c05..5dde2c1 100644
--- a/ipc/kdbus/handle.h
+++ b/ipc/kdbus/handle.h
@@ -45,7 +45,7 @@ struct kdbus_arg {
* @argv: array of items this command supports
* @user: set by parser to user-space location of current command
* @cmd: set by parser to kernel copy of command payload
- * @cmd_buf: 512 bytes inline buf to avoid kmalloc() on small cmds
+ * @cmd_buf: inline buf to avoid kmalloc() on small cmds
* @items: points to item array in @cmd
* @items_size: size of @items in bytes
* @is_cmd: whether this is a command-payload or msg-payload
@@ -55,7 +55,7 @@ struct kdbus_arg {
* the object to kdbus_args_parse(). The parser will copy the command payload
* into kernel-space and verify the correctness of the data.
*
- * We use a 512 bytes buffer for small command payloads, to be allocated on
+ * We use a 256 bytes buffer for small command payloads, to be allocated on
* stack on syscall entrance.
*/
struct kdbus_args {
@@ -65,7 +65,7 @@ struct kdbus_args {
struct kdbus_cmd __user *user;
struct kdbus_cmd *cmd;
- u8 cmd_buf[512];
+ u8 cmd_buf[256];
struct kdbus_item *items;
size_t items_size;
--
2.5.0
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/9] kdbus: set of random fixes David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 7/9] kdbus: consolidate common code David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 4/9] kdbus: move privilege checking in kdbus_conn_new() David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 9/9] kdbus/tests: properly parse KDBUS_CMD_LIST objects David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 1/9] kdbus: return EBADSLT on replies without slot David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 2/9] kdbus: reduce stack buffer to 256 bytes David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 3/9] kdbus: use separate counter for message IDs David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 5/9] kdbus: perform accounting on proxied uids David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200 [PATCH 6/9] kdbus: inline privilege checks David Herrmann <dh.herrmann@gmail.com> - 2015-08-06 10:30 +0200
csiph-web