PFS: remember request information for IOCTLs

Not doing so caused PFS to commit protocol violations by relying on
stale information when sending replies. This stale information always
happened to be correct, which is why the problem went unnoticed.
Change-Id: Ia42ca670718d6e731193cd2c34a3ff455f8a94d3
This commit is contained in:
David van Moolenbroek 2013-08-30 12:18:27 +02:00 committed by Lionel Sambuc
parent 6331e8f845
commit 784cdd4d07

View file

@ -152,7 +152,7 @@ int uds_open(message *dev_m_in, message *dev_m_out)
uds_fd_table[minor].suspended = UDS_NOT_SUSPENDED;
/* and the socket doesn't have an I/O grant initially */
uds_fd_table[minor].io_gr = (cp_grant_id_t) 0;
uds_fd_table[minor].io_gr = GRANT_INVALID;
/* since there is no I/O grant it effectively has no size either */
uds_fd_table[minor].io_gr_size = 0;
@ -813,6 +813,13 @@ int uds_ioctl(message *dev_m_in, message *dev_m_out)
/* update the owner endpoint - yes it's really stored in POSITION */
uds_fd_table[minor].owner = dev_m_in->POSITION;
/* update the process endpoint, which may well be different */
uds_fd_table[minor].endpoint = dev_m_in->USER_ENDPT;
/* save I/O Grant info */
uds_fd_table[minor].io_gr = (cp_grant_id_t) dev_m_in->IO_GRANT;
uds_fd_table[minor].io_gr_size = 0; /* should not be used here */
switch (dev_m_in->COUNT) { /* Handle the ioctl(2) command */
case NWIOSUDSCONN: