[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] mini-os: Avoid segfaults in tc{g,s}etattr
On Mon, Apr 27, 2020 at 09:54:29AM +0200, Samuel Thibault wrote: > Jason Andryuk, le dim. 26 avril 2020 23:40:19 -0400, a ecrit: > > Commit c96c22f1d94 "mini-os: minimal implementations of some termios > > functions" introduced implementations of tcgetattr and tcsetattr. > > However, they do not check if files[fildes].cons.dev is non-NULL before > > dereferencing. This is not a problem for FDs allocated through > > alloc_fd, but the files array pre-allocates FDs 0-2 for stdio. Those > > entries have a NULL .dev, so tc{g,s}etattr on them segfault. > > > > ioemu-stubdom segfaults when term_init() calls tcgetattr on FD 0. > > > > Restore tcgetattr and tcsetattr behavior when .dev is NULL equivalent to > > unsupported_function as it was before c96c22f1d94. > > > > Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx> > > Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> > > Thanks! Applied. Thanks.
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |