NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-macppc/52864: executing luactl after creating a Lua state causes panic



The following reply was made to PR port-macppc/52864; it has been noted by GNATS.

From: Sevan Janiyan <venture37%geeklan.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-macppc/52864: executing luactl after creating a Lua state
 causes panic
Date: Tue, 26 Dec 2017 04:35:15 +0000

 In src/sbin/luactl/luactl.c, the function getinfo()[1] calls LUAINFO
 with ioctl() and if the number of states in the kernel is greater than
 0, it allocates memory based on that number with calloc() and calls
 ioctl() again, with the same parameters. upon the second call is where
 the crash happens.
 
 From the lua kernel model side, handling the LUAINFO ioctl with
 luaioctl()[2] seems to be the case of stepping through the list of
 states and copying out their details with copyoutstr().
 
 If I only call ioctl once in my test, after calloc(), I'm able to fetch
 the number of states before the program crashes, the system still stays up.
 
 I will try and put together a test using ioctls using something else to
 rule out the lua module.
 
 [1] https://nxr.netbsd.org/xref/src/sbin/luactl/luactl.c#120
 [2] https://nxr.netbsd.org/xref/src/sys/modules/lua/lua.c#299
 
 
 Sevan
 


Home | Main Index | Thread Index | Old Index