Re: [PATCH] tty: limit TCSBRKP break duration

From: Greg Kroah-Hartman

Date: Wed Jul 29 2026 - 08:18:48 EST


On Wed, Jul 29, 2026 at 07:19:27PM +0800, Xincheng Wang wrote:
> Hi Greg,
>
> Thanks for the review.
>
> You are right. The RCU stall I observed does not by itself justify
> clamping long break intervals in the tty core, so I will drop that
> patch.
>
> While looking at this path, I noticed that tty_ioctl() multiplies the
> TCSBRKP argument by 100 and passes the result to send_break(), whose
> duration argument is unsigned int. Values whose product exceeds UINT_MAX
> are silently truncated to an unintended duration.
>
> Do you think it is worth fixing that separately by rejecting TCSBRKP
> values that cannot fit in the unsigned-int millisecond duration used by
> send_break()?

Wouldn't that break userspace that is currently relying on that
truncation?

thanks,

greg k-h