From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751716AbdFFKzO (ORCPT ); Tue, 6 Jun 2017 06:55:14 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35723 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbdFFKzJ (ORCPT ); Tue, 6 Jun 2017 06:55:09 -0400 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , Tony Luck , Fenghua Yu , Samuel Ortiz , "David S. Miller" , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-serial@vger.kernel.org, Johan Hovold Subject: [PATCH 1/9] serial: rate limit custom-speed deprecation notice Date: Tue, 6 Jun 2017 12:54:33 +0200 Message-Id: <20170606105441.689-2-johan@kernel.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170606105441.689-1-johan@kernel.org> References: <20170606105441.689-1-johan@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Contrary to what a comment claimed, the ASYNC_SPD flags and custom divisor can be set by a non-privileged user so rate limit the deprecation notice as was intended. Signed-off-by: Johan Hovold --- drivers/tty/serial/serial_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 13bfd5dcffce..f534a40aebde 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -954,11 +954,10 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, old_custom_divisor != uport->custom_divisor) { /* * If they're setting up a custom divisor or speed, - * instead of clearing it, then bitch about it. No - * need to rate-limit; it's CAP_SYS_ADMIN only. + * instead of clearing it, then bitch about it. */ if (uport->flags & UPF_SPD_MASK) { - dev_notice(uport->dev, + dev_notice_ratelimited(uport->dev, "%s sets custom speed on %s. This is deprecated.\n", current->comm, tty_name(port->tty)); -- 2.13.0