Re: [PATCH 1/1] tty: set_termios/set_termiox should not return -EINTR

From: Jiri Slaby
Date: Tue Jan 29 2013 - 14:35:27 EST


On 01/29/2013 08:07 PM, Oleg Nesterov wrote:
> See https://bugzilla.redhat.com/show_bug.cgi?id=904907
> read command causes bash to abort with double free or corruption (out).
>
> A simple test-case from Roman:
>
> // Compile the reproducer and send sigchld ti that process.
> // EINTR occurs even if SA_RESTART flag is set.
>
> void handler(int sig)
> {
> }
>
> main()
> {
> struct sigaction act;
> act.sa_handler = handler;
> act.sa_flags = SA_RESTART;
> sigaction (SIGCHLD, &act, 0);
> struct termio ttp;
> ioctl(0, TCGETA, &ttp);
> while(1)
> {
> if (ioctl(0, TCSETAW, ttp) < 0)
> {
> if (errno == EINTR)
> {
> fprintf(stderr, "BUG!"); return(1);
> }
> }
> }
> }
>
> Change set_termios/set_termiox to return -ERESTARTSYS to fix this
> particular problem.

This looks reasonable. However given the link above says:
You are not authorized to access bug #904907.
the description above is poor. What problem exactly does this fix? Why
this should go to stable at all?

--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/