dhb@rayssd.UUCP (11/09/83)
Does anyone know of a way to determine the end of the users address space from within the kernel on 4.1BSD? In particular, we have a locally developed device driver which massages the data being transmitted before sending it (the device on the VAX end swaps bytes around but the device on the other end does not). Every once in a while a user will develop a new program and inadvertently pass the driver an absurd number for the byte count. When this happens, the driver starts merrily swapping bytes around to get ready for the transfer and eventually blows the system out of the water. Putting restrictions on the size of transfers doesn't work because we have legimate reasons to transfer 64K at a shot and if the user specifies a buffer which is near the end of his address space and gives a byte count of 64K it will still screw up. What we need is a way to check if the sum of the start of the buffer and the byte count go past the end of the users address space. I noticed entries in a couple of the "per process" structures for the data size, stack size, and text size but it's not clear how to get from there to where I want to be. If anyone out there can help me on this (maybe somebody at UCB that worked on 4.1) I would greatly appreciate. Some of our users are starting to get annoyed (fortunately they aim their discontent at the poor fellow who is writing the new user programs). Please MAIL replies because I am three weeks behind in reading the news and I need this info right away. -- Dave Brierley Raytheon Co.; Portsmouth RI; (401)-847-8000 x4073 ...!decvax!brunix!rayssd!dhb ...!allegra!rayssd!dhb ...!linus!rayssd!dhb
mark@umcp-cs.UUCP (11/11/83)
It seems to me that the byte swapping massaging should be done at the user level, not in the device driver. Then the system won't be blown out of the water when things go wrong, just the one user. Of course this doesn't answer your original question, so I'll be quiet now.-- spoken: mark weiser UUCP: {seismo,allegra,brl-bmd}!umcp-cs!mark CSNet: mark@umcp-cs ARPA: mark.umcp-cs@CSNet-Relay