diff --git a/repos/dde_rump/src/server/rump_fs/main.cc b/repos/dde_rump/src/server/rump_fs/main.cc index b3b197d451..d1f916978b 100644 --- a/repos/dde_rump/src/server/rump_fs/main.cc +++ b/repos/dde_rump/src/server/rump_fs/main.cc @@ -348,8 +348,8 @@ class File_system::Root : public Root_component char root[ROOT_MAX_LEN]; root[0] = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -393,6 +393,11 @@ class File_system::Root : public Root_component size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer. diff --git a/repos/libports/src/server/ffat_fs/main.cc b/repos/libports/src/server/ffat_fs/main.cc index e4c2b795dd..75daa90768 100644 --- a/repos/libports/src/server/ffat_fs/main.cc +++ b/repos/libports/src/server/ffat_fs/main.cc @@ -881,8 +881,8 @@ namespace File_system { char root[ROOT_MAX_LEN]; root[0] = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -964,6 +964,11 @@ namespace File_system { size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer. diff --git a/repos/libports/src/server/fuse_fs/fuse_fs_main.cc b/repos/libports/src/server/fuse_fs/fuse_fs_main.cc index fc95b28323..0c8a4bd348 100644 --- a/repos/libports/src/server/fuse_fs/fuse_fs_main.cc +++ b/repos/libports/src/server/fuse_fs/fuse_fs_main.cc @@ -447,8 +447,8 @@ class File_system::Root : public Root_component char root[ROOT_MAX_LEN]; root[0] = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -493,6 +493,11 @@ class File_system::Root : public Root_component size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer. diff --git a/repos/os/src/server/lx_fs/main.cc b/repos/os/src/server/lx_fs/main.cc index 38de41aaa8..5e256898cf 100644 --- a/repos/os/src/server/lx_fs/main.cc +++ b/repos/os/src/server/lx_fs/main.cc @@ -337,8 +337,8 @@ class File_system::Root : public Root_component char root[ROOT_MAX_LEN]; root[0] = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -385,6 +385,11 @@ class File_system::Root : public Root_component size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer. diff --git a/repos/os/src/server/ram_fs/main.cc b/repos/os/src/server/ram_fs/main.cc index d8c7fe5c12..41399e0b41 100644 --- a/repos/os/src/server/ram_fs/main.cc +++ b/repos/os/src/server/ram_fs/main.cc @@ -436,8 +436,8 @@ namespace File_system { char root[ROOT_MAX_LEN]; root[0] = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -486,6 +486,11 @@ namespace File_system { size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer. diff --git a/repos/os/src/server/tar_fs/main.cc b/repos/os/src/server/tar_fs/main.cc index e3acce7da4..f8a698cdd3 100644 --- a/repos/os/src/server/tar_fs/main.cc +++ b/repos/os/src/server/tar_fs/main.cc @@ -468,8 +468,8 @@ namespace File_system { char root[ROOT_MAX_LEN]; root[0] = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -517,6 +517,11 @@ namespace File_system { size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer. diff --git a/repos/os/src/server/trace_fs/main.cc b/repos/os/src/server/trace_fs/main.cc index c8697e48d8..854a42d5f0 100644 --- a/repos/os/src/server/trace_fs/main.cc +++ b/repos/os/src/server/trace_fs/main.cc @@ -949,8 +949,8 @@ class File_system::Root : public Root_component Genode::Number_of_bytes buffer_size_max = 1 * (1 << 20); /* 1 MiB */ unsigned trace_parent_levels = 0; + Session_label label(args); try { - Session_label label(args); Session_policy policy(label); /* @@ -1004,6 +1004,11 @@ class File_system::Root : public Root_component size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0); + if (!tx_buf_size) { + PERR("%s requested a session with a zero length transmission buffer", label.string()); + throw Root::Invalid_args(); + } + /* * Check if donated ram quota suffices for session data, * and communication buffer.