Changeset c377c5e4 in mainline for kernel/generic/src/ipc/ipcrsc.c


Ignore:
Timestamp:
2018-03-11T07:35:05Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Children:
813fc8c
Parents:
2736ef9b
git-author:
Jakub Jermar <jakub@…> (2018-03-04 19:36:57)
git-committer:
Jakub Jermar <jakub@…> (2018-03-11 07:35:05)
Message:

Allow only connecting phones to connect

If a phone is not in the IPC_PHONE_CONNECTING state, refuse to connect
it. An attempt to do so might be a result of a race between the kernel
expecting a connecting phone under a known handle and the user fiddling
with phone capabilites handles from userspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipcrsc.c

    r2736ef9b rc377c5e4  
    216216                return false;
    217217
    218         if (phone_obj->phone->state != IPC_PHONE_CONNECTING) {
    219                 /*
    220                  * This looks like another phone. The one we were expecting
    221                  * under this handle must be in the IPC_PHONE_CONNECTING state.
    222                  */
    223                 kobject_put(phone_obj);
    224                 return false;
    225         }
    226 
    227218        /* Hand over phone_obj reference to the answerbox */
    228219        return ipc_phone_connect(phone_obj->phone, box);
Note: See TracChangeset for help on using the changeset viewer.