> On Oct 15, 2018, at 6:10 AM, Gleb Smirnoff <[email protected]> wrote: > > Enji, > > can you please check that with this patch all your tests pass?
Hi Gleb!
It almost compiled. I just needed to dereference the `so` pointer:
$ git diff /usr/src/sys/kern/kern_sendfile.c
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 438069aa721..50404ce5745 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct file
**sock_fp,
*so = (*sock_fp)->f_data;
if ((*so)->so_type != SOCK_STREAM)
return (EINVAL);
+ if (SOLISTENING(*so))
+ return (ENOTCONN);
return (0);
}
After I applied that and rebuilt the kernel, it doesn’t panic anymore
(and it fails with the correct errno).
Thank you so very much :)!
-Enji
signature.asc
Description: Message signed with OpenPGP
