Commit graph

6193 commits

Author SHA1 Message Date
Andreas Kling
a885719af5 Kernel: Keep SMAP protection enabled in Thread::backtrace_impl() 2020-01-12 10:47:01 +01:00
Andreas Kling
a6cef2408c Kernel: Add sigreturn() to "stdio" with all the other signal syscalls 2020-01-12 10:32:56 +01:00
Andreas Kling
7b53699e6f Kernel: Require the "thread" pledge promise for futex() 2020-01-12 10:31:21 +01:00
Andreas Kling
c32d65ae9f Kernel: Put some more syscalls in the "stdio" bucket
yield() and get_kernel_info_page() seem like decent fits for "stdio".
2020-01-12 10:31:21 +01:00
Andreas Kling
f6c0fccc01 Kernel: Fix busted backtraces when a thread backtraces itself
When the current thread is backtracing itself, we now start walking the
stack from the current EBP register value, instead of the TSS one.

Now SystemMonitor always appears to be running Thread::backtrace() when
sampled, which makes perfect sense. :^)
2020-01-12 10:19:37 +01:00
Andreas Kling
0d961ece94 SystemMonitor: Add "proc" pledge so we can send signals to processes 2020-01-12 10:07:42 +01:00
Andreas Kling
1b9f4c7c40 Shell: Fix broken debug logging about waiting on children 2020-01-12 10:03:06 +01:00
Andreas Kling
4edbcebeb4 Kernel: Put termios debug spam behind TTY_DEBUG 2020-01-12 10:02:02 +01:00
Andreas Kling
cb59f9e0f2 Kernel: Put some VFS debug spam behind VFS_DEBUG 2020-01-12 10:01:22 +01:00
Andreas Kling
ca609ce5a3 Kernel: Put fcntl() debug spam behind DEBUG_IO 2020-01-12 10:01:22 +01:00
Andreas Kling
45e7c2ba69 LibDraw: Remove debug spam about loading system themes 2020-01-12 10:01:22 +01:00
Shannon Booth
c66a6f131e WindowServer: Send key events to menu manager is there is a current menu
If there is a current menu, we now redirect all key events from window
manager to the menu manager. This allows us to properly navigate a menu
even when there is a current menu open.

Menu key navigation is now a lot more pleasant to use :^)

The action of pressing escape to close a menu has also been moved to its
proper home in menu manager in this commit.
2020-01-12 09:52:40 +01:00
Shannon Booth
e6c826ffc3 WindowServer: Fix non-submenus being closed when set as current menu
set_current_menu() was indiscriminately closing all menus when the
current menu is not a submenu. We should only close menus not in lineage
to the one being closed.
2020-01-12 09:52:40 +01:00
Shannon Booth
4f6b9b64c3 WindowServer: Fix incorrect current menu when switching to new item
We were forgetting to update the current menu when switching to a new
item.

We also rename the function from implying that only a redraw is
happening, as is actually not the case. It is now more correctly named:
update_for_new_hovered_item()
2020-01-12 09:52:40 +01:00
Andreas Kling
0d2bfc4ea0 WindowServer: Actually don't bring up system menu during move/resize
It was still possible to pop up the system menu by letting go of the
mouse button before letting go of the Logo key. This patch fixes that.
2020-01-12 02:33:24 +01:00
Andreas Kling
17135c9704 SoundPlayer: Use pledge() 2020-01-12 02:28:26 +01:00
Andreas Kling
b79711786c Help: Use pledge() 2020-01-12 02:23:55 +01:00
Andreas Kling
017b34e1ad Kernel: Add "video" pledge for accessing framebuffer devices
WindowServer becomes the only user.
2020-01-12 02:18:30 +01:00
Andreas Kling
bb6b9d9059 QuickShow: Use pledge() 2020-01-12 02:02:44 +01:00
Andreas Kling
9e51291aed Kernel: Disable SMAP protection while capturing profile samples 2020-01-12 02:02:29 +01:00
Andreas Kling
ef05bb61a0 WindowServer: Don't show system menu on Logo KeyUp during move/resize 2020-01-12 01:46:41 +01:00
0xtechnobabble
49e8d34f0e TextEditor: Replace text in find textbox with selection
This patch makes it so that if the find/replace widget is opened while
some text is selected, the find textbox's content is overrided with the
selected text.
2020-01-12 01:41:36 +01:00
0xtechnobabble
ecf58ddd4f TextEditor: Implement replacement functionality
This patch adds a new replace widget that cooperates with the find
widget, the replace widget takes the input in the find textbox, searches
for occurences of that input, and replaces them with the input provied
in the replace textbox.
2020-01-12 01:41:36 +01:00
Andreas Kling
2b20e8e187 IRCClient: Use pledge() 2020-01-11 23:53:54 +01:00
Andreas Kling
2067c003ff TextEditor: Use pledge() 2020-01-11 23:50:05 +01:00
Andreas Kling
f187374c1b Kernel: fork()ed children should inherit pledge promises :^)
Update various places that now need wider promises as they are not
reset by fork() anymore.
2020-01-11 23:28:41 +01:00
Andreas Kling
b39e732eb3 FileManager: Use pledge() 2020-01-11 22:13:38 +01:00
Andreas Kling
75c5e9af56 LibGUI: Fix assertion failure in GItemView::mouse_up() 2020-01-11 22:12:36 +01:00
Andreas Kling
d2e49719c4 WindowServer: Use pledge() 2020-01-11 21:35:01 +01:00
Andreas Kling
0ad491a854 ProtocolServer: Use pledge() 2020-01-11 21:35:01 +01:00
Andreas Kling
1c755d848e SystemServer: Use pledge() 2020-01-11 21:35:01 +01:00
Andreas Kling
a84aac86b1 AudioServer: Use pledge() 2020-01-11 21:35:01 +01:00
Andreas Kling
5f5791cac8 TTYServer: Use pledge() 2020-01-11 21:35:01 +01:00
Andreas Kling
7b6b1bae02 MenuApplets: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
457c7d9efd HackStudio: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
c13328bd2b Taskbar: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
f848faeec8 SystemMonitor: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
ec1ae37f69 SystemMonitor+LibCore: Show process pledges in SystemMonitor :^) 2020-01-11 21:33:12 +01:00
Andreas Kling
4132f713c8 Terminal: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
b36608f47c ProcFS: Expose process pledge promises in /proc/all 2020-01-11 21:33:12 +01:00
Andreas Kling
2f880a047f Browser: Use pledge()
This is the first complex app to use pledge(), and it was extremely
easy to get it working.

The main trickiness comes from the RPC sockets that get set up inside
the GApplication constructor. Since it wants to unlink any old RPC
socket with the same filename and change the file mode of the new
socket, it needs both "cpath" and "fattr".

Once the GApplication has been constructed, it seems we can safely
drop those promises. Pretty cool!
2020-01-11 21:33:12 +01:00
Andreas Kling
e131a401e8 cat: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
1934a1ec0b Shell: Use pledge() 2020-01-11 21:33:07 +01:00
Andreas Kling
8c2009c5be host: Use pledge() 2020-01-11 20:49:31 +01:00
Andreas Kling
d30d3fac6f id: Use pledge() 2020-01-11 20:49:25 +01:00
Andreas Kling
409a4f7756 ping: Use pledge() 2020-01-11 20:48:43 +01:00
Andreas Kling
41c504a33b Kernel: Add pledge() syscall :^)
This patch implements basic support for OpenBSD-style pledge().
pledge() allows programs to incrementally reduce their set of allowed
syscalls, which are divided into categories that each make up a subset
of POSIX functionality.

If a process violates one of its pledged promises by attempting to call
a syscall that it previously said it wouldn't call, the process is
immediately terminated with an uncatchable SIGABRT.

This is by no means complete, and we'll need to add more checks in
various places to ensure that promises are being kept.

But it is pretty cool! :^)
2020-01-11 20:45:51 +01:00
Shannon Booth
529a65c283 WSWindowManager: Improve opening and closing the system menu
The system menu can now be opened by pressing the window key even while
in a focused window. The current menu can also now be closed by pressing
escape.

We still cannot navigate a menu using arrow keys while there is an
active window, but this is another step towards that.
2020-01-11 18:58:59 +01:00
Shannon Booth
2f0eb3e28e WSMenuManager: Fix set_current_menu() not setting the current menu
m_current_menu was being set and then immediately cleared by
close_everyone(). Furthermore, since the menu being set can be a
nullptr, we now also make sure to handle that.

Finally, the logic can be simplified. close on the current menu is not
required, as that is also done by close_everyone().
2020-01-11 18:58:59 +01:00
Sergey Bugaev
b37bd28053 Base: Document mount(2) and mount(8) 2020-01-11 18:57:53 +01:00