From f0a4cb059d9232448766cd257e3485d1a9779f44 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Sun, 15 Mar 2020 22:36:18 -0700 Subject: [PATCH] drivers: uart: Add uart_configure verification handler uart_configure verification handler was missing what would cause a crash if called from a user thread. Signed-off-by: Flavio Ceolin --- drivers/serial/uart_handlers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/serial/uart_handlers.c b/drivers/serial/uart_handlers.c index 6619c2d9f1b..6c100dd4a7c 100644 --- a/drivers/serial/uart_handlers.c +++ b/drivers/serial/uart_handlers.c @@ -51,6 +51,16 @@ static inline int z_vrfy_uart_config_get(struct device *dev, } #include +static inline int z_vrfy_uart_configure(struct device *dev, + const struct uart_config *cfg) +{ + Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, config_get)); + Z_OOPS(Z_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config))); + + return z_impl_uart_configure(dev, cfg); +} +#include + #ifdef CONFIG_UART_ASYNC_API /* callback_set() excluded as we don't allow ISR callback installation from * user mode