# Create NCI NFC device. r0 = openat$nci(AUTO, &AUTO, AUTO, AUTO) ioctl$IOCTL_GET_NCIDEV_IDX(r0, AUTO, &AUTO=0x0) # Up the device. r2 = syz_init_net_socket$nl_generic(AUTO, AUTO, AUTO) r3 = syz_genetlink_get_family_id$nfc(&AUTO, r2) sendmsg$NFC_CMD_DEV_UP(r2, &AUTO={0x0, 0x0, &AUTO={&AUTO={AUTO, r3, 0x1, 0x123, 0x234, {AUTO, 0x0, 0x0}, [@NFC_ATTR_DEVICE_INDEX={AUTO, AUTO, r1, nil}]}, AUTO}, 0x1, 0x0, 0x0, 0x0}, 0x0) # Mock communication with the device. # NCI core should send reset, init and discover commands. read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_CORE_RESET_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, {0x0, 0x0, 0x0}}, AUTO) read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_CORE_INIT_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, {{0x0, 0x0, 0x0, ""}, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}, AUTO) read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_RF_DISCOVER_MAP_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, 0x0}, AUTO) # Enable polling. sendmsg$NFC_CMD_START_POLL(r2, &AUTO={0x0, 0x0, &AUTO={&AUTO={AUTO, r3, 0x1, 0x123, 0x234, {AUTO, 0x0, 0x0}, [@NFC_ATTR_DEVICE_INDEX={AUTO, AUTO, r1, nil}, @NFC_ATTR_PROTOCOLS={AUTO, AUTO, 0xffffffff, nil}]}, AUTO}, 0x1, 0x0, 0x0, 0x0}, 0x0) read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_CORE_SET_CONFIG_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, {0x0, 0x0, ""}}, AUTO) read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_CORE_SET_CONFIG_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, {0x0, 0x0, ""}}, AUTO) read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_RF_DISCOVER_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, 0x0}, AUTO) # Pretend we discovered target 0. write$nci(r0, &AUTO=@NCI_OP_RF_DISCOVER_NTF={AUTO, 0x0, AUTO, AUTO, 0x0, @b={0x0, 0x1, AUTO, 0x1, {0x1, "aa"}, 0x0}}, AUTO) # Activate target 0. sendmsg$NFC_CMD_ACTIVATE_TARGET(r2, &AUTO={0x0, 0x0, &AUTO={&AUTO={AUTO, r3, 0x1, 0x123, 0x234, {AUTO, 0x0, 0x0}, [@NFC_ATTR_DEVICE_INDEX={AUTO, AUTO, r1, nil}, @NFC_ATTR_TARGET_INDEX={AUTO, AUTO, 0x0, nil}, @NFC_ATTR_PROTOCOLS={AUTO, AUTO, 0x1, nil}]}, AUTO}, 0x1, 0x0, 0x0, 0x0}, 0x0) read$nci(r0, &AUTO=""/100, AUTO) write$nci(r0, &AUTO=@NCI_OP_CORE_CONN_CREATE_RSP={AUTO, 0x0, AUTO, AUTO, 0x0, {0x0, 0x0, 0x0, 0x1}}, AUTO)