[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221115095941.787250-1-dvyukov@google.com>
Date: Tue, 15 Nov 2022 10:59:41 +0100
From: Dmitry Vyukov <dvyukov@...gle.com>
To: bongsu.jeon@...sung.com, krzysztof.kozlowski@...aro.org,
netdev@...r.kernel.org
Cc: syzkaller@...glegroups.com, Dmitry Vyukov <dvyukov@...gle.com>,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH net-next] NFC: nci: Extend virtual NCI deinit test
Extend the test to check the scenario when NCI core tries to send data
to already closed device to ensure that nothing bad happens.
Signed-off-by: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Bongsu Jeon <bongsu.jeon@...sung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org
---
tools/testing/selftests/nci/nci_dev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c
index 162c41e9bcae8..272958a4ad102 100644
--- a/tools/testing/selftests/nci/nci_dev.c
+++ b/tools/testing/selftests/nci/nci_dev.c
@@ -888,6 +888,16 @@ TEST_F(NCI, deinit)
&msg);
ASSERT_EQ(rc, 0);
EXPECT_EQ(get_dev_enable_state(&msg), 0);
+
+ // Test that operations that normally send packets to the driver
+ // don't cause issues when the device is already closed.
+ // Note: the send of NFC_CMD_DEV_UP itself still succeeds it's just
+ // that the device won't actually be up.
+ close(self->virtual_nci_fd);
+ self->virtual_nci_fd = -1;
+ rc = send_cmd_with_idx(self->sd, self->fid, self->pid,
+ NFC_CMD_DEV_UP, self->dev_idex);
+ EXPECT_EQ(rc, 0);
}
TEST_HARNESS_MAIN
base-commit: f12ed9c04804eec4f1819097a0fd0b4800adac2f
prerequisite-patch-id: 214c5357c652cee65ee803d0f45f4b15cfcc9861
--
2.38.1.431.g37b22c650d-goog
Powered by blists - more mailing lists