l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small fixes in string item support in libhurd-cap-server.


From: Matthieu Lemerre
Subject: Small fixes in string item support in libhurd-cap-server.
Date: Thu, 10 Feb 2005 16:32:05 +0000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

Hi,

Here is one more patch which fix mistakes in my previous patch on
string item support in libhurd-cap-server.

The assertion that the ipc_error in the manager thread can only be
ipc_canceled, ipc_aborted or ipc_timeout are not true anymore: There
can be a buffer overflow or a xfer timeout in each address space. In
each case the client has done something wrong, so we just ignore the
message.

There was also some xfer timeouts security problems. The use of
l4_zero_time instead of l4_never makes the simplest pistachio string
item patch mandatory, though.


2005-02-10  Matthieu Lemerre  <address@hidden>

        * bucket-manage-mt.c (hurd_cap_bucket_manage_mt): Fix xfer timeout
        and add checks to ipc_error.
        (manage_mt_worker): Fix xfer timeouts.
--- hurd-l4-bak/libhurd-cap-server/bucket-manage-mt.c   2005-02-04 
02:09:02.000000000 +0000
+++ hurd-l4/libhurd-cap-server/bucket-manage-mt.c       2005-02-10 
16:28:10.000000000 +0000
@@ -459,6 +459,10 @@ manage_mt_worker (void *arg, bool async)
       acceptor = L4_UNTYPED_WORDS_ACCEPTOR;
     }
 
+  /* We do not want to block when returning a string item to the
+     client */
+  l4_set_xfer_timeouts (l4_timeouts (L4_ZERO_TIME, L4_NEVER));
+
   if (EXPECT_FALSE (async))
     {
       /* We have to add ourselves to the free list and inform the
@@ -1090,9 +1094,10 @@ hurd_cap_bucket_manage_mt (hurd_cap_buck
       /* Because we do not accept any string items, we do not actually
         need to set the Xfer timeouts.  But this is what we want to set
         them to when we eventually do support string items.  */
-      /* FIXME: separate setting the local and remote timeouts */
-      /* Only works with the first pistachio patch for now */
-      l4_set_xfer_timeouts (l4_timeouts (L4_NEVER, L4_NEVER));
+      /* FIXME: separate setting the local and remote timeouts if
+        using the more complete pistachio patch*/
+      /* Only works with the simplest pistachio patch for now */
+      l4_set_xfer_timeouts (l4_timeouts (L4_ZERO_TIME, L4_ZERO_TIME));
 
       /* FIXME: Make sure we have enabled deferred cancellation, and
         use an L4 ipc() stub that supports that.  In fact, this must
@@ -1119,6 +1124,12 @@ hurd_cap_bucket_manage_mt (hurd_cap_buck
              err = ECANCELED;
              break;
            }
+         else if (ipc_err == L4_IPC_MSG_OVERFLOW
+                  || ipc_err == L4_IPC_XFER_TIMEOUT_PARTNER
+                  || ipc_err == L4_IPC_XFER_TIMEOUT_INVOKER)
+           {
+             continue;
+           }
          else
            {
              assert (((err_code >> 1) & 0x7) == L4_IPC_TIMEOUT);

Thanks,
Matthieu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]