From 75915c31349cdb48ef695ec524f6549c75cc98d1 Mon Sep 17 00:00:00 2001 From: lesl Date: Mon, 30 Nov 2020 19:09:31 +0800 Subject: [PATCH] wifi: ignore SIGPIPE when dumping stats to dumpstate If dumpstate closes the reading end of the pipe (likely due to timeout) and wifi vendor hal attempts to write to the fd it received from dumpstate, it will receive sig 13 (SIGPIPE), and is then killed. We should protect wifi vendor hal from the abnormally behaved clients. Sync patch from ag/12321138. Reference from b/172972545 & b/161336019#comment29 Bug: 161336019 Bug: 172972545 Test: Manuel Test, Wifi works normally Change-Id: Ie7de040ac4320f83500c18e74e3c58d63b4df1b7 --- wifi/1.5/default/service.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wifi/1.5/default/service.cpp b/wifi/1.5/default/service.cpp index 8539a37647..23e2b47ee4 100644 --- a/wifi/1.5/default/service.cpp +++ b/wifi/1.5/default/service.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ const bool kLazyService = false; #endif int main(int /*argc*/, char** argv) { + signal(SIGPIPE, SIG_IGN); android::base::InitLogging( argv, android::base::LogdLogger(android::base::SYSTEM)); LOG(INFO) << "Wifi Hal is booting up...";