From 91d8a13f43cda4e7e650161f232e508ecd60af11 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 18 Mar 2021 13:04:19 -0700 Subject: [PATCH 01/33] FROMGIT: virt_wifi: Return micros for BSS TSF values cfg80211_inform_bss expects to receive a TSF value, but is given the time since boot in nanoseconds. TSF values are expected to be at microsecond scale rather than nanosecond scale. Bug: 181840234 Test: atest CtsWifiTestCases:android.net.wifi.cts.ScanResultTest#testScanResultTimeStamp -- --abi x86_64 Signed-off-by: A. Cody Schuffelen Link: https://lore.kernel.org/r/20210318200419.1421034-1-schuffelen@google.com Signed-off-by: Johannes Berg (cherry picked from commit b57aa17f07c9270e576ef7df09f142978b5a75f0 https: //git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master) Change-Id: Icafc24ad303357926cbe955ffa12e28e0bf31e6f --- drivers/net/wireless/virt_wifi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c index b80f7de39aee..22890cca984b 100644 --- a/drivers/net/wireless/virt_wifi.c +++ b/drivers/net/wireless/virt_wifi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -173,11 +174,11 @@ static void virt_wifi_scan_result(struct work_struct *work) scan_result.work); struct wiphy *wiphy = priv_to_wiphy(priv); struct cfg80211_scan_info scan_info = { .aborted = false }; + u64 tsf = div_u64(ktime_get_boottime_ns(), 1000); informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz, CFG80211_BSS_FTYPE_PRESP, - fake_router_bssid, - ktime_get_boottime_ns(), + fake_router_bssid, tsf, WLAN_CAPABILITY_ESS, 0, (void *)&ssid, sizeof(ssid), DBM_TO_MBM(-50), GFP_KERNEL); From 67e9dbddb51764f7395a43b6993f696362de551e Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Mon, 19 Apr 2021 12:33:25 -0700 Subject: [PATCH 02/33] ANDROID: clang: update to 12.0.5 Bug: 185804542 Signed-off-by: Nick Desaulniers Change-Id: If3d0c122472d8979b326d8a6fece30d8b2af962a --- build.config.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.config.common b/build.config.common index 778e5a7d540a..bdfcee55a9b2 100644 --- a/build.config.common +++ b/build.config.common @@ -6,7 +6,7 @@ LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy DEPMOD=depmod -CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r416183/bin +CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r416183b/bin BUILDTOOLS_PREBUILT_BIN=build/build-tools/path/linux-x86 EXTRA_CMDS='' From b3f413063085159ac967eabe7f61e093c73edfd2 Mon Sep 17 00:00:00 2001 From: Jindong Yue Date: Wed, 21 Apr 2021 10:21:58 +0800 Subject: [PATCH 03/33] ANDROID: ABI: Update symbol list for imx Update imx symbol list according to below changes: - Replace imx_rproc with imx_rpmsg driver - Add two modules: snd-soc-rpmsg-pcm512x.ko and snd-soc-rpmsg-imx-pcm512x.ko Leaf changes summary: 4 artifacts changed (26 filtered out) Changed leaf types summary: 0 (26 filtered out) leaf types changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 4 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 4 Added functions: [A] 'function int snd_interval_ranges(snd_interval*, unsigned int, const snd_interval*, unsigned int)' [A] 'function int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime*, unsigned int, snd_pcm_hw_param_t, const snd_pcm_hw_constraint_ratnums*)' [A] 'function int snd_soc_limit_volume(snd_soc_card*, const char*, int)' [A] 'function int snd_soc_params_to_frame_size(snd_pcm_hw_params*)' Bug: 159736148 Signed-off-by: Jindong Yue Change-Id: I04c696219cdfead30a00201000251bd989814ec5 --- android/abi_gki_aarch64.xml | 3138 ++++++++++++++++++----------------- android/abi_gki_aarch64_imx | 86 +- 2 files changed, 1693 insertions(+), 1531 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 6aa47db183ed..52690283f0ea 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -2856,7 +2856,6 @@ - @@ -3406,7 +3405,6 @@ - @@ -3451,25 +3449,16 @@ - - - - - - - - - @@ -3798,6 +3787,7 @@ + @@ -3816,6 +3806,7 @@ + @@ -3902,6 +3893,7 @@ + @@ -3914,6 +3906,7 @@ + @@ -5032,16 +5025,16 @@ - + - + - + - + @@ -5894,13 +5887,13 @@ - + - + - + @@ -6143,15 +6136,15 @@ - + - + - + @@ -6383,21 +6376,21 @@ - + - + - + - + - + @@ -6611,13 +6604,13 @@ - + - + - + @@ -6864,13 +6857,13 @@ - + - + - + @@ -7173,10 +7166,10 @@ - + - + @@ -8161,10 +8154,10 @@ - + - + @@ -9249,26 +9242,26 @@ - + - + - + - + - + - + @@ -11050,29 +11043,29 @@ - + - + - + - + - + - + - + @@ -12563,42 +12556,42 @@ - + - + - + - + - + - + - + - + - + - + @@ -14732,74 +14725,74 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -17688,106 +17681,106 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -20367,78 +20360,78 @@ - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + @@ -20838,7 +20831,23 @@ - + + + + + + + + + + + + + + + + + @@ -23475,190 +23484,190 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -23688,6 +23697,9 @@ + + + @@ -26167,174 +26179,174 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -27030,7 +27042,65 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -28193,6 +28263,14 @@ + + + + + + + + @@ -28508,59 +28586,59 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -30146,6 +30224,7 @@ + @@ -30202,26 +30281,34 @@ - + - + + + + + + + + + - + - + - - + + - + @@ -30407,6 +30494,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -31187,48 +31294,48 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -31933,21 +32040,21 @@ - + - + - + - + - + @@ -32483,21 +32590,21 @@ - + - + - - + + - + - + @@ -36836,16 +36943,16 @@ - + - + - + - + @@ -36895,10 +37002,10 @@ - + - + @@ -37009,10 +37116,10 @@ - + - + @@ -37281,13 +37388,13 @@ - + - + - + @@ -37303,10 +37410,10 @@ - + - + @@ -37322,28 +37429,28 @@ - + - + - + - + - + - + @@ -37357,10 +37464,10 @@ - + - + @@ -37375,26 +37482,26 @@ - + - + - + - + - + - + @@ -37767,7 +37874,7 @@ - + @@ -37783,13 +37890,13 @@ - + - + - + @@ -38004,10 +38111,10 @@ - + - + @@ -38111,10 +38218,10 @@ - + - + @@ -38894,13 +39001,13 @@ - + - + - + @@ -38965,28 +39072,28 @@ - + - + - + - + - + - + - + - + @@ -39231,16 +39338,16 @@ - + - + - + - + @@ -39366,10 +39473,10 @@ - + - + @@ -39480,10 +39587,10 @@ - + - + @@ -39524,10 +39631,10 @@ - + - + @@ -39543,13 +39650,13 @@ - + - + - + @@ -39608,10 +39715,10 @@ - + - + @@ -39863,10 +39970,10 @@ - + - + @@ -40645,10 +40752,10 @@ - + - + @@ -41135,13 +41242,13 @@ - + - + - + @@ -41186,10 +41293,10 @@ - + - + @@ -41541,27 +41648,27 @@ - + - + - + - + - + - + @@ -41583,10 +41690,10 @@ - + - + @@ -41627,10 +41734,10 @@ - + - + @@ -41674,10 +41781,10 @@ - + - + @@ -42079,18 +42186,18 @@ - + - + - + - + @@ -42115,25 +42222,25 @@ - + - + - + - + - + - + - + @@ -42162,10 +42269,10 @@ - + - + @@ -42207,13 +42314,13 @@ - + - + - + @@ -42263,10 +42370,10 @@ - + - + @@ -42309,10 +42416,10 @@ - + - + @@ -42668,16 +42775,16 @@ - + - + - + - + @@ -43258,26 +43365,26 @@ - + - + - + - + - + - + @@ -43517,13 +43624,13 @@ - + - + - + @@ -43569,19 +43676,19 @@ - + - + - + - + - + @@ -43591,10 +43698,10 @@ - + - + @@ -43607,21 +43714,21 @@ - + - + - + - + - + @@ -43750,13 +43857,13 @@ - + - + - + @@ -43931,10 +44038,10 @@ - + - + @@ -44019,13 +44126,13 @@ - + - + - + @@ -44209,13 +44316,13 @@ - + - + - + @@ -44444,16 +44551,16 @@ - + - + - + - + @@ -44638,10 +44745,10 @@ - + - + @@ -47746,13 +47853,13 @@ - + - + - + @@ -50215,7 +50322,23 @@ - + + + + + + + + + + + + + + + + + @@ -51324,48 +51447,48 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -51411,25 +51534,25 @@ - + - + - + - + - + - + - + @@ -51776,48 +51899,48 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -51848,16 +51971,16 @@ - + - + - + - + @@ -52085,10 +52208,10 @@ - + - + @@ -52226,16 +52349,16 @@ - + - + - + - + @@ -52887,46 +53010,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -53058,10 +53181,10 @@ - + - + @@ -53552,16 +53675,16 @@ - + - + - + - + @@ -55837,7 +55960,7 @@ - + @@ -56315,10 +56438,10 @@ - + - + @@ -56334,36 +56457,36 @@ - + - + - + - + - + - + - + - + - + - + @@ -56678,10 +56801,10 @@ - + - + @@ -57964,10 +58087,10 @@ - + - + @@ -60102,10 +60225,10 @@ - + - + @@ -67258,13 +67381,13 @@ - + - + - + @@ -67804,7 +67927,7 @@ - + @@ -67867,7 +67990,7 @@ - + @@ -68755,22 +68878,22 @@ - + - + - + - + - + - + @@ -70804,7 +70927,7 @@ - + @@ -72293,10 +72416,10 @@ - + - + @@ -73101,13 +73224,13 @@ - + - + - + @@ -73250,10 +73373,10 @@ - + - + @@ -75726,10 +75849,10 @@ - + - + @@ -76160,13 +76283,13 @@ - + - + - + @@ -77374,7 +77497,7 @@ - + @@ -79123,10 +79246,10 @@ - + - + @@ -79642,13 +79765,13 @@ - + - + - + @@ -79777,19 +79900,19 @@ - + - + - + - + - + @@ -80214,40 +80337,40 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -80779,10 +80902,10 @@ - + - + @@ -80851,19 +80974,19 @@ - + - + - + - + - + @@ -80924,10 +81047,10 @@ - + - + @@ -83171,10 +83294,10 @@ - + - + @@ -83243,19 +83366,19 @@ - + - + - + - + - + @@ -83288,10 +83411,10 @@ - + - + @@ -85244,10 +85367,10 @@ - + - + @@ -85817,10 +85940,10 @@ - + - + @@ -86290,13 +86413,13 @@ - + - + - + @@ -88366,19 +88489,19 @@ - + - + - + - + - + @@ -90674,16 +90797,16 @@ - + - + - + - + @@ -91208,16 +91331,16 @@ - + - + - + - + @@ -91259,10 +91382,10 @@ - + - + @@ -91285,10 +91408,10 @@ - + - + @@ -94224,13 +94347,13 @@ - + - + - + @@ -94323,10 +94446,10 @@ - + - + @@ -95056,13 +95179,13 @@ - + - + - + @@ -95340,7 +95463,7 @@ - + @@ -95761,52 +95884,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -96017,29 +96140,29 @@ - + - + - + - + - + - + - + @@ -96354,13 +96477,13 @@ - + - + - + @@ -96379,13 +96502,13 @@ - + - + - + @@ -96398,7 +96521,7 @@ - + @@ -96871,16 +96994,16 @@ - + - + - + - + @@ -97583,52 +97706,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -98480,18 +98603,18 @@ - + - + - + - + @@ -98843,13 +98966,13 @@ - + - + - + @@ -99186,22 +99309,22 @@ - + - + - + - + - + - + @@ -99302,10 +99425,10 @@ - + - + @@ -100184,10 +100307,10 @@ - + - + @@ -100697,10 +100820,10 @@ - + - + @@ -100821,16 +100944,16 @@ - + - + - + - + @@ -101330,28 +101453,28 @@ - + - + - + - + - + - + - + - + @@ -101394,10 +101517,10 @@ - + - + @@ -101451,10 +101574,10 @@ - + - + @@ -101590,16 +101713,16 @@ - + - + - + - + @@ -101621,21 +101744,21 @@ - + - + - + - + - + @@ -101891,7 +102014,7 @@ - + @@ -101910,25 +102033,25 @@ - + - + - + - + - + - + - + @@ -101947,10 +102070,10 @@ - + - + @@ -102071,7 +102194,7 @@ - + @@ -102092,13 +102215,13 @@ - + - + - + @@ -102129,13 +102252,13 @@ - + - + - + @@ -102223,10 +102346,10 @@ - + - + @@ -102282,10 +102405,10 @@ - + - + @@ -103657,52 +103780,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -104271,18 +104394,18 @@ - + - + - + - + @@ -104451,13 +104574,13 @@ - + - + - + @@ -104566,22 +104689,22 @@ - + - + - + - + - + - + @@ -104617,10 +104740,10 @@ - + - + @@ -105018,13 +105141,13 @@ - + - + - + @@ -106716,16 +106839,16 @@ - + - + - + - + @@ -108246,10 +108369,10 @@ - + - + @@ -108595,22 +108718,22 @@ - + - + - + - + - + - + @@ -108649,16 +108772,16 @@ - + - + - + - + @@ -111827,10 +111950,10 @@ - + - + @@ -111844,18 +111967,18 @@ - + - + - + - + @@ -111869,10 +111992,10 @@ - + - + @@ -112149,16 +112272,16 @@ - + - + - + - + @@ -112171,43 +112294,43 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -112473,10 +112596,10 @@ - + - + @@ -112503,18 +112626,18 @@ - + - + - + - + @@ -112663,13 +112786,13 @@ - + - + - + @@ -112939,10 +113062,10 @@ - + - + @@ -113191,16 +113314,16 @@ - + - + - + - + @@ -113260,22 +113383,22 @@ - + - + - + - + - + - + @@ -113374,10 +113497,10 @@ - + - + @@ -113530,10 +113653,10 @@ - + - + @@ -113544,10 +113667,10 @@ - + - + @@ -113572,10 +113695,10 @@ - + - + @@ -113760,10 +113883,10 @@ - + - + @@ -113839,10 +113962,10 @@ - + - + @@ -113888,10 +114011,10 @@ - + - + @@ -114179,13 +114302,13 @@ - + - + - + @@ -116132,10 +116255,6 @@ - - - - @@ -117679,7 +117798,7 @@ - + @@ -119529,11 +119648,11 @@ - - + + - + @@ -121914,44 +122033,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -121999,14 +122080,12 @@ - - @@ -122023,43 +122102,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -122109,11 +122156,6 @@ - - - - - @@ -122164,48 +122206,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -122458,10 +122469,10 @@ - + - + @@ -125975,18 +125986,18 @@ - + - + - + - + @@ -126882,16 +126893,16 @@ - + - + - + - + @@ -126938,10 +126949,10 @@ - + - + @@ -127595,10 +127606,10 @@ - + - + @@ -128378,10 +128389,10 @@ - + - + @@ -129044,13 +129055,13 @@ - + - + - + @@ -130700,10 +130711,10 @@ - + - + @@ -137224,13 +137235,13 @@ - + - + - + @@ -137399,10 +137410,10 @@ - + - + @@ -141289,10 +141300,10 @@ - + - + @@ -142427,10 +142438,10 @@ - + - + @@ -143015,22 +143026,22 @@ - + - + - + - + - + - + @@ -143083,10 +143094,10 @@ - + - + @@ -143765,16 +143776,16 @@ - + - + - + - + @@ -145074,13 +145085,13 @@ - + - + - + @@ -145354,10 +145365,10 @@ - + - + @@ -145367,13 +145378,13 @@ - + - + - + @@ -145741,10 +145752,10 @@ - + - + @@ -145992,44 +146003,44 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -146263,13 +146274,13 @@ - + - + - + @@ -146337,10 +146348,10 @@ - + - + @@ -147213,10 +147224,10 @@ - + - + @@ -148341,10 +148352,10 @@ - + - + @@ -148504,11 +148515,11 @@ - - + + - + @@ -149735,7 +149746,7 @@ - + @@ -150798,10 +150809,10 @@ - + - + @@ -153853,10 +153864,10 @@ - + - + @@ -154035,10 +154046,10 @@ - + - + @@ -154664,10 +154675,10 @@ - + - + @@ -154733,10 +154744,10 @@ - + - + @@ -154861,10 +154872,10 @@ - + - + @@ -155249,10 +155260,10 @@ - + - + @@ -156665,10 +156676,10 @@ - + - + @@ -156716,13 +156727,13 @@ - + - + - + @@ -157800,32 +157811,32 @@ - + - + - + - + - + - + - + - + @@ -157857,10 +157868,10 @@ - + - + @@ -159263,46 +159274,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -159348,22 +159359,22 @@ - + - + - + - + - + - + @@ -159589,10 +159600,10 @@ - + - + @@ -159635,10 +159646,10 @@ - + - + @@ -160141,13 +160152,13 @@ - + - + - + @@ -160529,10 +160540,10 @@ - + - + @@ -163472,10 +163483,10 @@ - + - + @@ -163832,10 +163843,10 @@ - + - + @@ -164361,18 +164372,18 @@ - + - + - + - + @@ -164733,18 +164744,18 @@ - + - + - + - + @@ -165408,10 +165419,10 @@ - + - + @@ -165458,10 +165469,10 @@ - + - + @@ -165828,9 +165839,20 @@ + + + + + + + + + + + @@ -165907,7 +165929,7 @@ - + @@ -165953,17 +165975,6 @@ - - - - - - - - - - - @@ -165974,7 +165985,6 @@ - @@ -167031,6 +167041,18 @@ + + + + + + + + + + + + @@ -167052,6 +167074,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -167674,10 +167725,10 @@ - + - + @@ -168390,10 +168441,10 @@ - + - + @@ -168600,10 +168651,10 @@ - + - + @@ -169136,10 +169187,10 @@ - + - + @@ -169336,10 +169387,10 @@ - + - + @@ -169846,10 +169897,10 @@ - + - + @@ -170327,16 +170378,16 @@ - + - + - + - + @@ -172594,22 +172645,22 @@ - + - + - + - + - + - + @@ -172758,13 +172809,13 @@ - + - + - + @@ -174232,19 +174283,19 @@ - + - + - + - + - + @@ -174266,10 +174317,10 @@ - + - + @@ -174606,65 +174657,65 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -174733,19 +174784,19 @@ - + - + - + - + - + @@ -174755,25 +174806,25 @@ - + - + - + - + - + - + - + @@ -174808,25 +174859,25 @@ - + - + - + - + - + - + - + @@ -174919,22 +174970,22 @@ - + - + - + - + - + - + @@ -175578,10 +175629,10 @@ - + - + @@ -175603,13 +175654,13 @@ - + - + - + @@ -175958,7 +176009,65 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -176046,10 +176155,10 @@ - + - + @@ -176335,10 +176444,10 @@ - + - + @@ -176433,10 +176542,10 @@ - + - + @@ -177071,7 +177180,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -177155,6 +177475,17 @@ + + + + + + + + + + + @@ -177244,7 +177575,6 @@ - @@ -177257,9 +177587,6 @@ - - - @@ -177291,13 +177618,6 @@ - - - - - - - @@ -177553,62 +177873,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -177967,139 +178231,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -180371,10 +180502,10 @@ - + - + @@ -181015,10 +181146,6 @@ - - - - @@ -181043,7 +181170,6 @@ - @@ -181131,13 +181257,7 @@ - - - - - - @@ -181193,13 +181313,6 @@ - - - - - - - @@ -181777,10 +181890,6 @@ - - - - @@ -182853,37 +182962,37 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -182973,55 +183082,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -183907,10 +184016,10 @@ - + - + @@ -184234,19 +184343,19 @@ - + - + - + - + - + @@ -184634,16 +184743,16 @@ - + - + - + - + @@ -184687,10 +184796,10 @@ - + - + @@ -184713,51 +184822,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -184777,10 +184886,10 @@ - + - + @@ -185591,6 +185700,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -185618,6 +185749,10 @@ + + + + @@ -185626,6 +185761,13 @@ + + + + + + + @@ -185633,6 +185775,13 @@ + + + + + + + @@ -185662,6 +185811,9 @@ + + + @@ -185786,10 +185938,10 @@ - + - + @@ -186835,10 +186987,10 @@ - + - + @@ -188126,10 +188278,10 @@ - + - + @@ -188214,10 +188366,10 @@ - + - + @@ -188236,13 +188388,13 @@ - + - + - + @@ -189083,10 +189235,10 @@ - + - + @@ -190259,6 +190411,12 @@ + + + + + + @@ -190323,6 +190481,10 @@ + + + + @@ -191020,6 +191182,6 @@ diff --git a/android/abi_gki_aarch64_imx b/android/abi_gki_aarch64_imx index ce8c8cb823f1..f5d9826fcde9 100644 --- a/android/abi_gki_aarch64_imx +++ b/android/abi_gki_aarch64_imx @@ -255,12 +255,14 @@ fwnode_graph_get_next_endpoint fwnode_handle_put fwnode_property_read_u32_array + gcd generic_handle_irq get_cpu_device __get_free_pages get_random_bytes get_unused_fd_flags gpiod_direction_output_raw + gpiod_set_raw_value gpiod_set_raw_value_cansleep gpiod_set_value_cansleep gpio_request @@ -272,6 +274,7 @@ i2c_add_adapter i2c_del_adapter i2c_del_driver + i2c_put_adapter i2c_register_driver i2c_transfer i2c_transfer_buffer_flags @@ -306,9 +309,9 @@ kmalloc_caches kmalloc_order_trace kmem_cache_alloc_trace - kmemdup kobject_create_and_add kobject_put + kstrtoull kthread_create_on_node kthread_should_stop ktime_get @@ -323,6 +326,7 @@ media_entity_remote_pad memcpy memset + __memset_io mipi_dsi_attach mipi_dsi_detach mipi_dsi_driver_register_full @@ -359,7 +363,6 @@ of_clk_get of_clk_get_by_name of_clk_src_onecell_get - of_count_phandle_with_args of_device_get_match_data of_device_is_available of_device_is_compatible @@ -394,6 +397,7 @@ of_property_read_string of_property_read_u32_index of_property_read_variable_u32_array + of_reserved_mem_device_init_by_idx of_reset_control_array_get param_array_ops param_ops_bool @@ -478,6 +482,7 @@ __register_chrdev register_netdev __register_rpmsg_driver + register_virtio_device register_virtio_driver regmap_attach_dev regmap_read @@ -547,7 +552,9 @@ snd_soc_info_volsw snd_soc_jack_add_gpios snd_soc_of_parse_audio_routing + snd_soc_of_parse_audio_simple_widgets snd_soc_of_parse_card_name + snd_soc_of_parse_daifmt snd_soc_params_to_bclk snd_soc_pm_ops snd_soc_put_enum_double @@ -665,6 +672,9 @@ vmalloc vmalloc_to_page vmemmap + vring_del_virtqueue + vring_interrupt + vring_new_virtqueue vsnprintf wait_for_completion_interruptible_timeout wait_for_completion_timeout @@ -777,7 +787,6 @@ drm_scdc_set_high_tmds_clock_ratio drm_scdc_set_scrambling drm_scdc_write - i2c_put_adapter of_get_i2c_adapter_by_node # required by dw_hdmi-imx.ko @@ -794,6 +803,7 @@ # required by dwc3-qcom.ko devm_extcon_register_notifier + kmemdup of_clk_get_parent_count # required by dwc3.ko @@ -845,7 +855,6 @@ of_mdiobus_register of_phy_connect of_phy_deregister_fixed_link - of_phy_find_device of_phy_is_fixed_link of_phy_register_fixed_link param_ops_byte @@ -977,7 +986,6 @@ clk_notifier_register clk_notifier_unregister dma_request_chan - gpiod_set_raw_value i2c_add_numbered_adapter i2c_generic_scl_recovery i2c_recover_bus @@ -1117,6 +1125,13 @@ # required by imx8mp-ldb.ko devm_of_phy_get +# required by imx_rpmsg.ko + mbox_free_channel + mbox_request_channel_byname + mbox_send_message + of_reserved_mem_device_release + vring_transport_features + # required by imx_rpmsg_tty.ko print_hex_dump put_tty_driver @@ -1132,30 +1147,6 @@ tty_std_termios tty_unregister_driver -# required by imx_rproc.ko - mbox_free_channel - mbox_request_channel_byname - mbox_send_message - of_phandle_iterator_init - of_phandle_iterator_next - of_reserved_mem_lookup - reset_control_status - rproc_add - rproc_add_carveout - rproc_alloc - rproc_coredump_add_segment - rproc_da_to_va - rproc_del - rproc_elf_find_loaded_rsc_table - rproc_elf_get_boot_addr - rproc_elf_load_rsc_table - rproc_elf_load_segments - rproc_elf_sanity_check - rproc_free - rproc_mem_entry_init - rproc_of_resm_mem_entry_init - rproc_vq_interrupt - # required by imxdrm.ko component_bind_all component_master_add_with_match @@ -1225,13 +1216,11 @@ match_token mutex_is_locked notify_change - override_creds pagecache_get_page path_get path_put __put_cred register_filesystem - revert_creds set_anon_super sget simple_getattr @@ -1276,6 +1265,9 @@ i2c_new_dummy regmap_bulk_read +# required by lpa_ctrl.ko + sysfs_create_groups + # required by moal.ko alloc_netdev_mqs __alloc_skb @@ -1626,7 +1618,7 @@ # required by snd-soc-fsl-dsp.ko dev_pm_domain_attach_by_id - __memset_io + of_count_phandle_with_args of_irq_get pm_system_wakeup sysfs_streq @@ -1634,7 +1626,6 @@ # required by snd-soc-fsl-easrc.ko completion_done - gcd snd_pcm_format_big_endian snd_pcm_format_linear snd_pcm_format_unsigned @@ -1643,7 +1634,6 @@ # required by snd-soc-fsl-micfil.ko kobject_uevent_env - kstrtoull snd_soc_get_volsw_sx snd_soc_info_volsw_sx snd_soc_put_volsw_sx @@ -1666,9 +1656,6 @@ snd_pcm_hw_constraint_eld snd_soc_jack_report -# required by snd-soc-imx-rpmsg.ko - of_reserved_mem_device_init_by_idx - # required by snd-soc-imx-wm8960.ko gpiod_get_raw_value_cansleep of_parse_phandle_with_fixed_args @@ -1684,6 +1671,22 @@ # required by snd-soc-rpmsg-cs42xx8.ko regcache_cache_bypass +# required by snd-soc-rpmsg-imx-pcm512x.ko + i2c_get_adapter + i2c_smbus_read_byte + snd_soc_dai_set_bclk_ratio + snd_soc_get_pcm_runtime + snd_soc_limit_volume + snd_soc_unregister_card + +# required by snd-soc-rpmsg-pcm512x.ko + devm_regulator_register_notifier + snd_ctl_boolean_stereo_info + snd_interval_ranges + snd_pcm_hw_constraint_ratnums + snd_pcm_hw_rule_add + snd_soc_params_to_frame_size + # required by snd-soc-simple-card-utils.ko devm_get_clk_from_child devm_kasprintf @@ -1692,14 +1695,15 @@ snd_soc_dapm_get_pin_switch snd_soc_dapm_info_pin_switch snd_soc_dapm_put_pin_switch - snd_soc_of_parse_audio_simple_widgets - snd_soc_of_parse_daifmt # required by snd-soc-simple-card.ko snd_soc_of_get_dai_name snd_soc_of_parse_node_prefix snd_soc_of_parse_tdm_slot +# required by snd-soc-tpa6130a2.ko + devm_gpio_request + # required by snvs_pwrkey.ko devm_input_allocate_device pm_relax @@ -1763,11 +1767,7 @@ panic_notifier_list # required by trusty-virtio.ko - register_virtio_device unregister_virtio_device - vring_del_virtqueue - vring_interrupt - vring_new_virtqueue # required by trusty.ko atomic_notifier_call_chain From ccdcd307cf7e5809dad02e7b5fd926681c3f8313 Mon Sep 17 00:00:00 2001 From: Howard Chen Date: Thu, 22 Apr 2021 11:29:27 +0800 Subject: [PATCH 04/33] ANDROID: Update the KMI for virtual platform modules Leaf changes summary: 1 artifact changed (26 filtered out) Changed leaf types summary: 0 (26 filtered out) leaf types changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 1 Added function: [A] 'function void* vmemdup_user(void*, size_t)' Bug: 184721371 Test: \ BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh \ BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.aarch64 build/build.sh \ BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.aarch64 build/build_abi.sh --update-symbol-list \ BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh --update --print-report Change-Id: Ib945211cb33806687eccdbe52533abf2db04abcf Signed-off-by: Howard Chen --- android/abi_gki_aarch64.xml | 888 ++++++++++++----------------- android/abi_gki_aarch64_cuttlefish | 4 +- 2 files changed, 363 insertions(+), 529 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 52690283f0ea..c3d6fb4f3c40 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -4681,6 +4681,7 @@ + @@ -8153,7 +8154,7 @@ - + @@ -11061,7 +11062,7 @@ - + @@ -20410,7 +20411,7 @@ - + @@ -23283,7 +23284,7 @@ - + @@ -23302,7 +23303,7 @@ - + @@ -23579,7 +23580,7 @@ - + @@ -23587,7 +23588,7 @@ - + @@ -23603,7 +23604,7 @@ - + @@ -23611,7 +23612,7 @@ - + @@ -23619,7 +23620,7 @@ - + @@ -23647,7 +23648,7 @@ - + @@ -23655,7 +23656,7 @@ - + @@ -25858,7 +25859,7 @@ - + @@ -26237,7 +26238,7 @@ - + @@ -26261,7 +26262,7 @@ - + @@ -26269,7 +26270,7 @@ - + @@ -26288,7 +26289,7 @@ - + @@ -26304,7 +26305,7 @@ - + @@ -26331,7 +26332,7 @@ - + @@ -26342,7 +26343,7 @@ - + @@ -27042,65 +27043,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -28218,7 +28161,7 @@ - + @@ -28226,7 +28169,7 @@ - + @@ -28271,7 +28214,7 @@ - + @@ -28620,7 +28563,7 @@ - + @@ -30224,7 +30167,6 @@ - @@ -30288,14 +30230,6 @@ - - - - - - - - @@ -30494,26 +30428,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -31053,7 +30967,7 @@ - + @@ -31293,7 +31207,7 @@ - + @@ -31301,7 +31215,7 @@ - + @@ -31309,7 +31223,7 @@ - + @@ -32039,7 +31953,7 @@ - + @@ -32589,7 +32503,7 @@ - + @@ -32851,7 +32765,7 @@ - + @@ -51598,6 +51512,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51898,44 +51850,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -108368,7 +108282,7 @@ - + @@ -108742,7 +108656,7 @@ - + @@ -108750,7 +108664,7 @@ - + @@ -108758,7 +108672,7 @@ - + @@ -108766,12 +108680,12 @@ - + - + @@ -111949,7 +111863,7 @@ - + @@ -111958,7 +111872,7 @@ - + @@ -111966,7 +111880,7 @@ - + @@ -111974,7 +111888,7 @@ - + @@ -111983,7 +111897,7 @@ - + @@ -111991,7 +111905,7 @@ - + @@ -112271,7 +112185,7 @@ - + @@ -112293,7 +112207,7 @@ - + @@ -112304,7 +112218,7 @@ - + @@ -112312,7 +112226,7 @@ - + @@ -112323,7 +112237,7 @@ - + @@ -112335,7 +112249,7 @@ - + @@ -112346,7 +112260,7 @@ - + @@ -112595,7 +112509,7 @@ - + @@ -112625,7 +112539,7 @@ - + @@ -112633,7 +112547,7 @@ - + @@ -112785,7 +112699,7 @@ - + @@ -113061,7 +112975,7 @@ - + @@ -113106,7 +113020,7 @@ - + @@ -113313,7 +113227,7 @@ - + @@ -113402,7 +113316,7 @@ - + @@ -113410,7 +113324,7 @@ - + @@ -113418,7 +113332,7 @@ - + @@ -113426,7 +113340,7 @@ - + @@ -113496,205 +113410,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -113882,7 +113598,7 @@ - + @@ -113961,7 +113677,7 @@ - + @@ -114010,7 +113726,7 @@ - + @@ -114186,6 +113902,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -114301,7 +114215,7 @@ - + @@ -114312,7 +114226,7 @@ - + @@ -114320,7 +114234,7 @@ - + @@ -114770,7 +114684,7 @@ - + @@ -165625,6 +165539,11 @@ + + + + + @@ -167074,35 +166993,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -167724,7 +167614,7 @@ - + @@ -167732,7 +167622,7 @@ - + @@ -167740,7 +167630,7 @@ - + @@ -170377,7 +170267,7 @@ - + @@ -176009,74 +175899,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - @@ -176130,42 +175956,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -176373,6 +176164,12 @@ + + + + + + @@ -176443,7 +176240,7 @@ - + @@ -176527,6 +176324,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -176541,7 +176370,7 @@ - + @@ -176603,6 +176432,9 @@ + + + diff --git a/android/abi_gki_aarch64_cuttlefish b/android/abi_gki_aarch64_cuttlefish index ed9d96a0557b..cce8b465f8a2 100644 --- a/android/abi_gki_aarch64_cuttlefish +++ b/android/abi_gki_aarch64_cuttlefish @@ -614,8 +614,8 @@ kmalloc_order_trace kvfree kvmalloc_node - memdup_user mutex_trylock + sg_alloc_table __sg_alloc_table_from_pages sg_free_table sg_next @@ -644,6 +644,8 @@ ttm_eu_fence_buffer_objects ttm_eu_reserve_buffers ttm_tt_init + vmalloc_to_page + vmemdup_user vmemmap ww_mutex_lock_interruptible ww_mutex_unlock From 0ade8c4105985bc911b252ccf9f5665139829cbb Mon Sep 17 00:00:00 2001 From: Mukesh Ojha Date: Thu, 22 Apr 2021 14:44:52 +0530 Subject: [PATCH 05/33] ANDROID: ABI: update allowed list for QCOM Update the android/abi_gki_aarch64_qcom with rtc_add_group addition. No need to update the .xml file, as it is already updated with rtc_add_group symbol. Bug: 185539583 Change-Id: I581bcf83a02a4114a9e7a22397fb52934ea0c52b Signed-off-by: Mukesh Ojha --- android/abi_gki_aarch64_qcom | 1 + 1 file changed, 1 insertion(+) diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index af413ee22491..930a3de22c5a 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -2022,6 +2022,7 @@ rpmsg_set_signals rpmsg_trysend rpmsg_unregister_device + rtc_add_group rtc_class_close rtc_class_open rtc_read_time From b6221e349592ef2fd7a1b78cb3cc64459e8dc9c2 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Thu, 22 Apr 2021 13:19:19 -0700 Subject: [PATCH 06/33] Revert "ANDROID: Incremental fs: Fix selinux issues" This reverts commit 75c93eb4397b3fdbc7587e48fb8bb884775747c5. Reason for revert: rolling the three fixes into one with feature flag Bug: 174692664 Test: incfs_test passes Signed-off-by: Paul Lawrence Change-Id: I838bed85d6682aba44165a58c22e6a0e10c49d58 --- fs/incfs/vfs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/incfs/vfs.c b/fs/incfs/vfs.c index d7a750290953..915d8eb6f9b1 100644 --- a/fs/incfs/vfs.c +++ b/fs/incfs/vfs.c @@ -898,7 +898,7 @@ static int init_new_file(struct mount_info *mi, struct dentry *dentry, .dentry = dentry }; new_file = dentry_open(&path, O_RDWR | O_NOATIME | O_LARGEFILE, - current_cred()); + mi->mi_owner); if (IS_ERR(new_file)) { error = PTR_ERR(new_file); @@ -1026,7 +1026,7 @@ static int dir_relative_path_resolve( if (dir_fd < 0) return dir_fd; - dir_f = dentry_open(base_path, O_RDONLY | O_NOATIME, current_cred()); + dir_f = dentry_open(base_path, O_RDONLY | O_NOATIME, mi->mi_owner); if (IS_ERR(dir_f)) { error = PTR_ERR(dir_f); @@ -1904,13 +1904,10 @@ static int file_open(struct inode *inode, struct file *file) struct file *backing_file = NULL; struct path backing_path = {}; int err = 0; - const struct cred *old_cred; get_incfs_backing_path(file->f_path.dentry, &backing_path); - old_cred = override_creds(mi->mi_owner); - backing_file = dentry_open(&backing_path, - O_RDWR | O_NOATIME | O_LARGEFILE, current_cred()); - revert_creds(old_cred); + backing_file = dentry_open( + &backing_path, O_RDWR | O_NOATIME | O_LARGEFILE, mi->mi_owner); path_put(&backing_path); if (IS_ERR(backing_file)) { From dbee4e7bc4e0816a6d84bd22ab6b9a0fbf2a4ab1 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Thu, 22 Apr 2021 13:19:30 -0700 Subject: [PATCH 07/33] Revert "ANDROID: Incremental fs: Set credentials before reading/writing" This reverts commit 28688d32ed31a11f85ab649f344add1d92b739a2. Reason for revert: rolling the three fixes into one with feature flag Bug: 174692664 Test: incfs_test passes Signed-off-by: Paul Lawrence Change-Id: I85cb75b7acb5606659698a6d0e0918ffb731009d --- fs/incfs/data_mgmt.c | 29 +++++++++++++++-------------- fs/incfs/format.c | 33 +++++++++++---------------------- fs/incfs/format.h | 17 +++-------------- fs/incfs/vfs.c | 2 +- 4 files changed, 30 insertions(+), 51 deletions(-) diff --git a/fs/incfs/data_mgmt.c b/fs/incfs/data_mgmt.c index e0705be44fb2..386e4ced8b34 100644 --- a/fs/incfs/data_mgmt.c +++ b/fs/incfs/data_mgmt.c @@ -144,7 +144,7 @@ struct data_file *incfs_open_data_file(struct mount_info *mi, struct file *bf) if (!S_ISREG(bf->f_inode->i_mode)) return ERR_PTR(-EBADF); - bfc = incfs_alloc_bfc(mi, bf); + bfc = incfs_alloc_bfc(bf); if (IS_ERR(bfc)) return ERR_CAST(bfc); @@ -388,8 +388,8 @@ static void log_block_read(struct mount_info *mi, incfs_uuid_t *id, schedule_delayed_work(&log->ml_wakeup_work, msecs_to_jiffies(16)); } -static int validate_hash_tree(struct backing_file_context *bfc, struct file *f, - int block_index, struct mem_range data, u8 *buf) +static int validate_hash_tree(struct file *bf, struct file *f, int block_index, + struct mem_range data, u8 *buf) { struct data_file *df = get_incfs_data_file(f); u8 stored_digest[INCFS_MAX_HASH_SIZE] = {}; @@ -446,7 +446,7 @@ static int validate_hash_tree(struct backing_file_context *bfc, struct file *f, if (page) put_page(page); - res = incfs_kread(bfc, buf, INCFS_DATA_FILE_BLOCK_SIZE, + res = incfs_kread(bf, buf, INCFS_DATA_FILE_BLOCK_SIZE, hash_block_offset[lvl] + sig->hash_offset); if (res < 0) return res; @@ -919,7 +919,7 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, ssize_t result; size_t bytes_to_read; struct mount_info *mi = NULL; - struct backing_file_context *bfc = NULL; + struct file *bf = NULL; struct data_file_block block = {}; struct data_file *df = get_incfs_data_file(f); @@ -930,7 +930,7 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, return -ERANGE; mi = df->df_mount_info; - bfc = df->df_backing_file_context; + bf = df->df_backing_file_context->bc_file; result = wait_for_data_block(df, index, timeout_ms, &block); if (result < 0) @@ -939,20 +939,20 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, pos = block.db_backing_file_data_offset; if (block.db_comp_alg == COMPRESSION_NONE) { bytes_to_read = min(dst.len, block.db_stored_size); - result = incfs_kread(bfc, dst.data, bytes_to_read, pos); + result = incfs_kread(bf, dst.data, bytes_to_read, pos); /* Some data was read, but not enough */ if (result >= 0 && result != bytes_to_read) result = -EIO; } else { bytes_to_read = min(tmp.len, block.db_stored_size); - result = incfs_kread(bfc, tmp.data, bytes_to_read, pos); + result = incfs_kread(bf, tmp.data, bytes_to_read, pos); if (result == bytes_to_read) { result = decompress(range(tmp.data, bytes_to_read), dst); if (result < 0) { const char *name = - bfc->bc_file->f_path.dentry->d_name.name; + bf->f_path.dentry->d_name.name; pr_warn_once("incfs: Decompression error. %s", name); @@ -964,7 +964,7 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, } if (result > 0) { - int err = validate_hash_tree(bfc, f, index, dst, tmp.data); + int err = validate_hash_tree(bf, f, index, dst, tmp.data); if (err < 0) result = err; @@ -1027,13 +1027,14 @@ int incfs_process_new_data_block(struct data_file *df, unlock: mutex_unlock(&segment->blockmap_mutex); if (error) - pr_debug("%d error: %d\n", block->block_index, error); + pr_debug("incfs: %s %d error: %d\n", __func__, + block->block_index, error); return error; } int incfs_read_file_signature(struct data_file *df, struct mem_range dst) { - struct backing_file_context *bfc = df->df_backing_file_context; + struct file *bf = df->df_backing_file_context->bc_file; struct incfs_df_signature *sig; int read_res = 0; @@ -1047,7 +1048,7 @@ int incfs_read_file_signature(struct data_file *df, struct mem_range dst) if (dst.len < sig->sig_size) return -E2BIG; - read_res = incfs_kread(bfc, dst.data, sig->sig_size, sig->sig_offset); + read_res = incfs_kread(bf, dst.data, sig->sig_size, sig->sig_offset); if (read_res < 0) return read_res; @@ -1173,7 +1174,7 @@ static int process_file_signature_md(struct incfs_file_signature *sg, goto out; } - read = incfs_kread(df->df_backing_file_context, buf, + read = incfs_kread(df->df_backing_file_context->bc_file, buf, signature->sig_size, signature->sig_offset); if (read < 0) { error = read; diff --git a/fs/incfs/format.c b/fs/incfs/format.c index 193cd8f23792..c56e559b6893 100644 --- a/fs/incfs/format.c +++ b/fs/incfs/format.c @@ -15,8 +15,7 @@ #include "format.h" #include "data_mgmt.h" -struct backing_file_context *incfs_alloc_bfc(struct mount_info *mi, - struct file *backing_file) +struct backing_file_context *incfs_alloc_bfc(struct file *backing_file) { struct backing_file_context *result = NULL; @@ -25,7 +24,6 @@ struct backing_file_context *incfs_alloc_bfc(struct mount_info *mi, return ERR_PTR(-ENOMEM); result->bc_file = get_file(backing_file); - result->bc_cred = mi->mi_owner; mutex_init(&result->bc_mutex); return result; } @@ -118,7 +116,7 @@ static int append_zeros(struct backing_file_context *bfc, size_t len) static int write_to_bf(struct backing_file_context *bfc, const void *buf, size_t count, loff_t pos) { - ssize_t res = incfs_kwrite(bfc, buf, count, pos); + ssize_t res = incfs_kwrite(bfc->bc_file, buf, count, pos); if (res < 0) return res; @@ -533,7 +531,8 @@ int incfs_read_blockmap_entries(struct backing_file_context *bfc, if (start_index < 0 || bm_base_off <= 0) return -ENODATA; - result = incfs_kread(bfc, entries, bytes_to_read, bm_entry_off); + result = incfs_kread(bfc->bc_file, entries, bytes_to_read, + bm_entry_off); if (result < 0) return result; return result / sizeof(*entries); @@ -550,7 +549,7 @@ int incfs_read_file_header(struct backing_file_context *bfc, return -EFAULT; LOCK_REQUIRED(bfc->bc_mutex); - bytes_read = incfs_kread(bfc, &fh, sizeof(fh), 0); + bytes_read = incfs_kread(bfc->bc_file, &fh, sizeof(fh), 0); if (bytes_read < 0) return bytes_read; @@ -604,8 +603,8 @@ int incfs_read_next_metadata_record(struct backing_file_context *bfc, return -EPERM; memset(&handler->md_buffer, 0, max_md_size); - bytes_read = incfs_kread(bfc, &handler->md_buffer, max_md_size, - handler->md_record_offset); + bytes_read = incfs_kread(bfc->bc_file, &handler->md_buffer, + max_md_size, handler->md_record_offset); if (bytes_read < 0) return bytes_read; if (bytes_read < sizeof(*md_hdr)) @@ -681,22 +680,12 @@ int incfs_read_next_metadata_record(struct backing_file_context *bfc, return res; } -ssize_t incfs_kread(struct backing_file_context *bfc, void *buf, size_t size, - loff_t pos) +ssize_t incfs_kread(struct file *f, void *buf, size_t size, loff_t pos) { - const struct cred *old_cred = override_creds(bfc->bc_cred); - int ret = kernel_read(bfc->bc_file, buf, size, &pos); - - revert_creds(old_cred); - return ret; + return kernel_read(f, buf, size, &pos); } -ssize_t incfs_kwrite(struct backing_file_context *bfc, const void *buf, - size_t size, loff_t pos) +ssize_t incfs_kwrite(struct file *f, const void *buf, size_t size, loff_t pos) { - const struct cred *old_cred = override_creds(bfc->bc_cred); - int ret = kernel_write(bfc->bc_file, buf, size, &pos); - - revert_creds(old_cred); - return ret; + return kernel_write(f, buf, size, &pos); } diff --git a/fs/incfs/format.h b/fs/incfs/format.h index a6d3aef6b358..1a83349bb2eb 100644 --- a/fs/incfs/format.h +++ b/fs/incfs/format.h @@ -256,13 +256,6 @@ struct backing_file_context { * 0 means there are no metadata records. */ loff_t bc_last_md_record_offset; - - /* - * Credentials to set before reads/writes - * Note that this is a pointer to the mount_info mi_owner field so - * there is no need to get/put the creds - */ - const struct cred *bc_cred; }; struct metadata_handler { @@ -290,9 +283,7 @@ struct metadata_handler { loff_t incfs_get_end_offset(struct file *f); /* Backing file context management */ -struct mount_info; -struct backing_file_context *incfs_alloc_bfc(struct mount_info *mi, - struct file *backing_file); +struct backing_file_context *incfs_alloc_bfc(struct file *backing_file); void incfs_free_bfc(struct backing_file_context *bfc); @@ -343,9 +334,7 @@ int incfs_read_blockmap_entries(struct backing_file_context *bfc, int incfs_read_next_metadata_record(struct backing_file_context *bfc, struct metadata_handler *handler); -ssize_t incfs_kread(struct backing_file_context *bfc, void *buf, size_t size, - loff_t pos); -ssize_t incfs_kwrite(struct backing_file_context *bfc, const void *buf, - size_t size, loff_t pos); +ssize_t incfs_kread(struct file *f, void *buf, size_t size, loff_t pos); +ssize_t incfs_kwrite(struct file *f, const void *buf, size_t size, loff_t pos); #endif /* _INCFS_FORMAT_H */ diff --git a/fs/incfs/vfs.c b/fs/incfs/vfs.c index 915d8eb6f9b1..582448ccdaef 100644 --- a/fs/incfs/vfs.c +++ b/fs/incfs/vfs.c @@ -905,7 +905,7 @@ static int init_new_file(struct mount_info *mi, struct dentry *dentry, goto out; } - bfc = incfs_alloc_bfc(mi, new_file); + bfc = incfs_alloc_bfc(new_file); fput(new_file); if (IS_ERR(bfc)) { error = PTR_ERR(bfc); From a035201d12cbb16c17cd94e86d43802c47dc11f2 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Thu, 22 Apr 2021 13:19:39 -0700 Subject: [PATCH 08/33] Revert "ANDROID: Incremental fs: Fix memory leak on closing file" This reverts commit 152fd8f04491a5ccf26c1f1adfb1b228b3082d2c. Reason for revert: rolling the three fixes into one with feature flag Bug: 174692664 Test: incfs_test passes Signed-off-by: Paul Lawrence Change-Id: I9a2e6faa0c2293b691efca8e985390fd94bcf01a --- fs/incfs/data_mgmt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/incfs/data_mgmt.c b/fs/incfs/data_mgmt.c index 386e4ced8b34..074a733c7001 100644 --- a/fs/incfs/data_mgmt.c +++ b/fs/incfs/data_mgmt.c @@ -199,7 +199,6 @@ void incfs_free_data_file(struct data_file *df) for (i = 0; i < ARRAY_SIZE(df->df_segments); i++) data_file_segment_destroy(&df->df_segments[i]); incfs_free_bfc(df->df_backing_file_context); - kfree(df->df_signature); kfree(df); } From fad2655cb7287ba2c5ed5f344a8cfa66bb9f52f7 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Wed, 3 Feb 2021 10:33:05 -0800 Subject: [PATCH 09/33] ANDROID: Incremental fs: Set credentials before reading/writing Use same selinux scheme as incfs v2 Fix memory leak Bug: 174692664 Test: incfs_test passes Signed-off-by: Paul Lawrence Change-Id: I6058ddad9d43ba01b2eabd7d3c576f2cc9b42292 --- fs/incfs/data_mgmt.c | 30 +++++++++++++++--------------- fs/incfs/format.c | 34 ++++++++++++++++++++++------------ fs/incfs/format.h | 17 ++++++++++++++--- fs/incfs/main.c | 10 ++++++++++ fs/incfs/vfs.c | 13 ++++++++----- 5 files changed, 69 insertions(+), 35 deletions(-) diff --git a/fs/incfs/data_mgmt.c b/fs/incfs/data_mgmt.c index 074a733c7001..e0705be44fb2 100644 --- a/fs/incfs/data_mgmt.c +++ b/fs/incfs/data_mgmt.c @@ -144,7 +144,7 @@ struct data_file *incfs_open_data_file(struct mount_info *mi, struct file *bf) if (!S_ISREG(bf->f_inode->i_mode)) return ERR_PTR(-EBADF); - bfc = incfs_alloc_bfc(bf); + bfc = incfs_alloc_bfc(mi, bf); if (IS_ERR(bfc)) return ERR_CAST(bfc); @@ -199,6 +199,7 @@ void incfs_free_data_file(struct data_file *df) for (i = 0; i < ARRAY_SIZE(df->df_segments); i++) data_file_segment_destroy(&df->df_segments[i]); incfs_free_bfc(df->df_backing_file_context); + kfree(df->df_signature); kfree(df); } @@ -387,8 +388,8 @@ static void log_block_read(struct mount_info *mi, incfs_uuid_t *id, schedule_delayed_work(&log->ml_wakeup_work, msecs_to_jiffies(16)); } -static int validate_hash_tree(struct file *bf, struct file *f, int block_index, - struct mem_range data, u8 *buf) +static int validate_hash_tree(struct backing_file_context *bfc, struct file *f, + int block_index, struct mem_range data, u8 *buf) { struct data_file *df = get_incfs_data_file(f); u8 stored_digest[INCFS_MAX_HASH_SIZE] = {}; @@ -445,7 +446,7 @@ static int validate_hash_tree(struct file *bf, struct file *f, int block_index, if (page) put_page(page); - res = incfs_kread(bf, buf, INCFS_DATA_FILE_BLOCK_SIZE, + res = incfs_kread(bfc, buf, INCFS_DATA_FILE_BLOCK_SIZE, hash_block_offset[lvl] + sig->hash_offset); if (res < 0) return res; @@ -918,7 +919,7 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, ssize_t result; size_t bytes_to_read; struct mount_info *mi = NULL; - struct file *bf = NULL; + struct backing_file_context *bfc = NULL; struct data_file_block block = {}; struct data_file *df = get_incfs_data_file(f); @@ -929,7 +930,7 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, return -ERANGE; mi = df->df_mount_info; - bf = df->df_backing_file_context->bc_file; + bfc = df->df_backing_file_context; result = wait_for_data_block(df, index, timeout_ms, &block); if (result < 0) @@ -938,20 +939,20 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, pos = block.db_backing_file_data_offset; if (block.db_comp_alg == COMPRESSION_NONE) { bytes_to_read = min(dst.len, block.db_stored_size); - result = incfs_kread(bf, dst.data, bytes_to_read, pos); + result = incfs_kread(bfc, dst.data, bytes_to_read, pos); /* Some data was read, but not enough */ if (result >= 0 && result != bytes_to_read) result = -EIO; } else { bytes_to_read = min(tmp.len, block.db_stored_size); - result = incfs_kread(bf, tmp.data, bytes_to_read, pos); + result = incfs_kread(bfc, tmp.data, bytes_to_read, pos); if (result == bytes_to_read) { result = decompress(range(tmp.data, bytes_to_read), dst); if (result < 0) { const char *name = - bf->f_path.dentry->d_name.name; + bfc->bc_file->f_path.dentry->d_name.name; pr_warn_once("incfs: Decompression error. %s", name); @@ -963,7 +964,7 @@ ssize_t incfs_read_data_file_block(struct mem_range dst, struct file *f, } if (result > 0) { - int err = validate_hash_tree(bf, f, index, dst, tmp.data); + int err = validate_hash_tree(bfc, f, index, dst, tmp.data); if (err < 0) result = err; @@ -1026,14 +1027,13 @@ int incfs_process_new_data_block(struct data_file *df, unlock: mutex_unlock(&segment->blockmap_mutex); if (error) - pr_debug("incfs: %s %d error: %d\n", __func__, - block->block_index, error); + pr_debug("%d error: %d\n", block->block_index, error); return error; } int incfs_read_file_signature(struct data_file *df, struct mem_range dst) { - struct file *bf = df->df_backing_file_context->bc_file; + struct backing_file_context *bfc = df->df_backing_file_context; struct incfs_df_signature *sig; int read_res = 0; @@ -1047,7 +1047,7 @@ int incfs_read_file_signature(struct data_file *df, struct mem_range dst) if (dst.len < sig->sig_size) return -E2BIG; - read_res = incfs_kread(bf, dst.data, sig->sig_size, sig->sig_offset); + read_res = incfs_kread(bfc, dst.data, sig->sig_size, sig->sig_offset); if (read_res < 0) return read_res; @@ -1173,7 +1173,7 @@ static int process_file_signature_md(struct incfs_file_signature *sg, goto out; } - read = incfs_kread(df->df_backing_file_context->bc_file, buf, + read = incfs_kread(df->df_backing_file_context, buf, signature->sig_size, signature->sig_offset); if (read < 0) { error = read; diff --git a/fs/incfs/format.c b/fs/incfs/format.c index c56e559b6893..d326415fc6de 100644 --- a/fs/incfs/format.c +++ b/fs/incfs/format.c @@ -15,7 +15,8 @@ #include "format.h" #include "data_mgmt.h" -struct backing_file_context *incfs_alloc_bfc(struct file *backing_file) +struct backing_file_context *incfs_alloc_bfc(struct mount_info *mi, + struct file *backing_file) { struct backing_file_context *result = NULL; @@ -24,6 +25,7 @@ struct backing_file_context *incfs_alloc_bfc(struct file *backing_file) return ERR_PTR(-ENOMEM); result->bc_file = get_file(backing_file); + result->bc_cred = mi->mi_owner; mutex_init(&result->bc_mutex); return result; } @@ -116,7 +118,7 @@ static int append_zeros(struct backing_file_context *bfc, size_t len) static int write_to_bf(struct backing_file_context *bfc, const void *buf, size_t count, loff_t pos) { - ssize_t res = incfs_kwrite(bfc->bc_file, buf, count, pos); + ssize_t res = incfs_kwrite(bfc, buf, count, pos); if (res < 0) return res; @@ -531,8 +533,7 @@ int incfs_read_blockmap_entries(struct backing_file_context *bfc, if (start_index < 0 || bm_base_off <= 0) return -ENODATA; - result = incfs_kread(bfc->bc_file, entries, bytes_to_read, - bm_entry_off); + result = incfs_kread(bfc, entries, bytes_to_read, bm_entry_off); if (result < 0) return result; return result / sizeof(*entries); @@ -548,8 +549,7 @@ int incfs_read_file_header(struct backing_file_context *bfc, if (!bfc || !first_md_off) return -EFAULT; - LOCK_REQUIRED(bfc->bc_mutex); - bytes_read = incfs_kread(bfc->bc_file, &fh, sizeof(fh), 0); + bytes_read = incfs_kread(bfc, &fh, sizeof(fh), 0); if (bytes_read < 0) return bytes_read; @@ -603,8 +603,8 @@ int incfs_read_next_metadata_record(struct backing_file_context *bfc, return -EPERM; memset(&handler->md_buffer, 0, max_md_size); - bytes_read = incfs_kread(bfc->bc_file, &handler->md_buffer, - max_md_size, handler->md_record_offset); + bytes_read = incfs_kread(bfc, &handler->md_buffer, max_md_size, + handler->md_record_offset); if (bytes_read < 0) return bytes_read; if (bytes_read < sizeof(*md_hdr)) @@ -680,12 +680,22 @@ int incfs_read_next_metadata_record(struct backing_file_context *bfc, return res; } -ssize_t incfs_kread(struct file *f, void *buf, size_t size, loff_t pos) +ssize_t incfs_kread(struct backing_file_context *bfc, void *buf, size_t size, + loff_t pos) { - return kernel_read(f, buf, size, &pos); + const struct cred *old_cred = override_creds(bfc->bc_cred); + int ret = kernel_read(bfc->bc_file, buf, size, &pos); + + revert_creds(old_cred); + return ret; } -ssize_t incfs_kwrite(struct file *f, const void *buf, size_t size, loff_t pos) +ssize_t incfs_kwrite(struct backing_file_context *bfc, const void *buf, + size_t size, loff_t pos) { - return kernel_write(f, buf, size, &pos); + const struct cred *old_cred = override_creds(bfc->bc_cred); + int ret = kernel_write(bfc->bc_file, buf, size, &pos); + + revert_creds(old_cred); + return ret; } diff --git a/fs/incfs/format.h b/fs/incfs/format.h index 1a83349bb2eb..a6d3aef6b358 100644 --- a/fs/incfs/format.h +++ b/fs/incfs/format.h @@ -256,6 +256,13 @@ struct backing_file_context { * 0 means there are no metadata records. */ loff_t bc_last_md_record_offset; + + /* + * Credentials to set before reads/writes + * Note that this is a pointer to the mount_info mi_owner field so + * there is no need to get/put the creds + */ + const struct cred *bc_cred; }; struct metadata_handler { @@ -283,7 +290,9 @@ struct metadata_handler { loff_t incfs_get_end_offset(struct file *f); /* Backing file context management */ -struct backing_file_context *incfs_alloc_bfc(struct file *backing_file); +struct mount_info; +struct backing_file_context *incfs_alloc_bfc(struct mount_info *mi, + struct file *backing_file); void incfs_free_bfc(struct backing_file_context *bfc); @@ -334,7 +343,9 @@ int incfs_read_blockmap_entries(struct backing_file_context *bfc, int incfs_read_next_metadata_record(struct backing_file_context *bfc, struct metadata_handler *handler); -ssize_t incfs_kread(struct file *f, void *buf, size_t size, loff_t pos); -ssize_t incfs_kwrite(struct file *f, const void *buf, size_t size, loff_t pos); +ssize_t incfs_kread(struct backing_file_context *bfc, void *buf, size_t size, + loff_t pos); +ssize_t incfs_kwrite(struct backing_file_context *bfc, const void *buf, + size_t size, loff_t pos); #endif /* _INCFS_FORMAT_H */ diff --git a/fs/incfs/main.c b/fs/incfs/main.c index 7c4ec4fa13d8..0fde230d5337 100644 --- a/fs/incfs/main.c +++ b/fs/incfs/main.c @@ -30,8 +30,18 @@ static ssize_t corefs_show(struct kobject *kobj, static struct kobj_attribute corefs_attr = __ATTR_RO(corefs); +static ssize_t mounter_context_for_backing_rw_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) +{ + return snprintf(buff, PAGE_SIZE, "supported\n"); +} + +static struct kobj_attribute mounter_context_for_backing_rw_attr = + __ATTR_RO(mounter_context_for_backing_rw); + static struct attribute *attributes[] = { &corefs_attr.attr, + &mounter_context_for_backing_rw_attr.attr, NULL, }; diff --git a/fs/incfs/vfs.c b/fs/incfs/vfs.c index 582448ccdaef..d7a750290953 100644 --- a/fs/incfs/vfs.c +++ b/fs/incfs/vfs.c @@ -898,14 +898,14 @@ static int init_new_file(struct mount_info *mi, struct dentry *dentry, .dentry = dentry }; new_file = dentry_open(&path, O_RDWR | O_NOATIME | O_LARGEFILE, - mi->mi_owner); + current_cred()); if (IS_ERR(new_file)) { error = PTR_ERR(new_file); goto out; } - bfc = incfs_alloc_bfc(new_file); + bfc = incfs_alloc_bfc(mi, new_file); fput(new_file); if (IS_ERR(bfc)) { error = PTR_ERR(bfc); @@ -1026,7 +1026,7 @@ static int dir_relative_path_resolve( if (dir_fd < 0) return dir_fd; - dir_f = dentry_open(base_path, O_RDONLY | O_NOATIME, mi->mi_owner); + dir_f = dentry_open(base_path, O_RDONLY | O_NOATIME, current_cred()); if (IS_ERR(dir_f)) { error = PTR_ERR(dir_f); @@ -1904,10 +1904,13 @@ static int file_open(struct inode *inode, struct file *file) struct file *backing_file = NULL; struct path backing_path = {}; int err = 0; + const struct cred *old_cred; get_incfs_backing_path(file->f_path.dentry, &backing_path); - backing_file = dentry_open( - &backing_path, O_RDWR | O_NOATIME | O_LARGEFILE, mi->mi_owner); + old_cred = override_creds(mi->mi_owner); + backing_file = dentry_open(&backing_path, + O_RDWR | O_NOATIME | O_LARGEFILE, current_cred()); + revert_creds(old_cred); path_put(&backing_path); if (IS_ERR(backing_file)) { From dd2e0a80f1bea3d0ac99df4b3256682e4324df5f Mon Sep 17 00:00:00 2001 From: Jilai Wang Date: Fri, 23 Apr 2021 16:55:03 -0400 Subject: [PATCH 10/33] ANDROID: ABI: Update allowed list for QCOM Add the following symbols to QCOM allowed-list: -- bitmap_release_region -- bitmap_find_free_region Bug: 186222705 Change-Id: I6dc24587c6e7db35ecac16e6e68d889f79e7dae6 Signed-off-by: Jilai Wang --- android/abi_gki_aarch64.xml | 1140 +++++++++++++++++----------------- android/abi_gki_aarch64_qcom | 2 + 2 files changed, 572 insertions(+), 570 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index c3d6fb4f3c40..c8cf7150a78c 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -8154,7 +8154,7 @@ - + @@ -11062,7 +11062,7 @@ - + @@ -20411,7 +20411,7 @@ - + @@ -23284,7 +23284,7 @@ - + @@ -23303,7 +23303,7 @@ - + @@ -23580,7 +23580,7 @@ - + @@ -23648,7 +23648,7 @@ - + @@ -23656,7 +23656,7 @@ - + @@ -25859,7 +25859,7 @@ - + @@ -26238,7 +26238,7 @@ - + @@ -26262,7 +26262,7 @@ - + @@ -26270,7 +26270,7 @@ - + @@ -26289,7 +26289,7 @@ - + @@ -26305,7 +26305,7 @@ - + @@ -26332,7 +26332,7 @@ - + @@ -26343,7 +26343,7 @@ - + @@ -28161,7 +28161,7 @@ - + @@ -28169,7 +28169,7 @@ - + @@ -28214,7 +28214,7 @@ - + @@ -28563,7 +28563,7 @@ - + @@ -30967,7 +30967,7 @@ - + @@ -31207,7 +31207,7 @@ - + @@ -31215,7 +31215,7 @@ - + @@ -31223,7 +31223,7 @@ - + @@ -31953,7 +31953,7 @@ - + @@ -32503,7 +32503,7 @@ - + @@ -32765,7 +32765,7 @@ - + @@ -51512,44 +51512,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -51850,6 +51812,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -108282,7 +108282,7 @@ - + @@ -108656,7 +108656,7 @@ - + @@ -108664,7 +108664,7 @@ - + @@ -108672,7 +108672,7 @@ - + @@ -108680,12 +108680,12 @@ - + - + @@ -111863,7 +111863,7 @@ - + @@ -111872,7 +111872,7 @@ - + @@ -111880,7 +111880,7 @@ - + @@ -111888,7 +111888,7 @@ - + @@ -111897,7 +111897,7 @@ - + @@ -111905,7 +111905,7 @@ - + @@ -112185,7 +112185,7 @@ - + @@ -112207,7 +112207,7 @@ - + @@ -112218,7 +112218,7 @@ - + @@ -112226,7 +112226,7 @@ - + @@ -112237,7 +112237,7 @@ - + @@ -112249,7 +112249,7 @@ - + @@ -112260,7 +112260,7 @@ - + @@ -112509,7 +112509,7 @@ - + @@ -112539,7 +112539,7 @@ - + @@ -112547,7 +112547,7 @@ - + @@ -112699,7 +112699,7 @@ - + @@ -112975,7 +112975,7 @@ - + @@ -113020,7 +113020,7 @@ - + @@ -113227,7 +113227,7 @@ - + @@ -113316,7 +113316,7 @@ - + @@ -113324,7 +113324,7 @@ - + @@ -113332,7 +113332,7 @@ - + @@ -113340,7 +113340,7 @@ - + @@ -113410,7 +113410,205 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -113598,7 +113796,7 @@ - + @@ -113677,7 +113875,7 @@ - + @@ -113726,7 +113924,7 @@ - + @@ -113902,204 +114100,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -114215,7 +114215,7 @@ - + @@ -114226,7 +114226,7 @@ - + @@ -114234,7 +114234,7 @@ - + @@ -114684,7 +114684,7 @@ - + @@ -165761,9 +165761,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -165899,7 +166099,18 @@ + + + + + + + + + + + @@ -166088,6 +166299,13 @@ + + + + + + + @@ -166095,6 +166313,10 @@ + + + + @@ -167614,7 +167836,7 @@ - + @@ -167622,7 +167844,7 @@ - + @@ -167630,7 +167852,7 @@ - + @@ -170267,7 +170489,7 @@ - + @@ -175900,9 +176122,15 @@ + + + + + + @@ -175956,7 +176184,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -176164,12 +176427,6 @@ - - - - - - @@ -176240,7 +176497,7 @@ - + @@ -176324,38 +176581,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -176370,7 +176595,7 @@ - + @@ -176432,9 +176657,6 @@ - - - @@ -177012,218 +177234,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -177307,17 +177318,6 @@ - - - - - - - - - - - diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 930a3de22c5a..d706370b2b5c 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -45,10 +45,12 @@ backlight_device_unregister bin2hex __bitmap_clear + bitmap_find_free_region bitmap_find_next_zero_area_off bitmap_free bitmap_parselist bitmap_print_to_pagebuf + bitmap_release_region __bitmap_set __bitmap_subset bitmap_zalloc From ff320df3e0e9915797a3e762f1cbfc0b034c1a9b Mon Sep 17 00:00:00 2001 From: Giuliano Procida Date: Thu, 22 Apr 2021 14:31:03 +0100 Subject: [PATCH 11/33] ANDROID: power: export pm_system_cancel_wakeup This symbol is needed by a QCOM driver. Bug: 186084429 Change-Id: I8001f14a6fded9b58a6dfba424dfa6ebb83543a5 Signed-off-by: Venkata Kakani Signed-off-by: Giuliano Procida --- drivers/base/power/wakeup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 911f1e85d44c..ffda3dad256a 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -922,6 +922,7 @@ void pm_system_cancel_wakeup(void) { atomic_dec_if_positive(&pm_abort_suspend); } +EXPORT_SYMBOL_GPL(pm_system_cancel_wakeup); void pm_wakeup_clear(bool reset) { From c8cd528e75550ac739bb0b774b9f84a895f20f4e Mon Sep 17 00:00:00 2001 From: Giuliano Procida Date: Thu, 22 Apr 2021 14:31:03 +0100 Subject: [PATCH 12/33] ANDROID: ABI: add pm_system_cancel_wakeup symbol Leaf changes summary: 1 artifact changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 1 Added function: [A] 'function void pm_system_cancel_wakeup()' Bug: 186084429 Change-Id: I5ec59917cb2a128b9d0605dd8b3cb8fa7e020af2 Signed-off-by: Venkata Kakani Signed-off-by: Giuliano Procida --- android/abi_gki_aarch64.xml | 518 ++++++++++++++++------------------- android/abi_gki_aarch64_qcom | 1 + 2 files changed, 237 insertions(+), 282 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index c8cf7150a78c..ced999ef6ac8 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -3168,6 +3168,7 @@ + @@ -30028,7 +30029,7 @@ - + @@ -30763,20 +30764,7 @@ - - - - - - - - - - - - - - + @@ -31952,7 +31940,6 @@ - @@ -31964,7 +31951,7 @@ - + @@ -32330,17 +32317,6 @@ - - - - - - - - - - - @@ -32427,7 +32403,7 @@ - + @@ -58527,6 +58503,9 @@ + + + @@ -111594,20 +111573,7 @@ - - - - - - - - - - - - - - + @@ -165761,209 +165727,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -166099,18 +165865,7 @@ - - - - - - - - - - - @@ -166299,13 +166054,6 @@ - - - - - - - @@ -166313,10 +166061,6 @@ - - - - @@ -167182,18 +166926,6 @@ - - - - - - - - - - - - @@ -174208,7 +173940,7 @@ - + @@ -177234,7 +176966,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -177318,6 +177261,17 @@ + + + + + + + + + + + @@ -178752,7 +178706,7 @@ - + @@ -178781,7 +178735,7 @@ - + @@ -179373,7 +179327,7 @@ - + @@ -180333,7 +180287,7 @@ - + diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index d706370b2b5c..13187bc671f8 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -1804,6 +1804,7 @@ __pm_runtime_use_autosuspend __pm_stay_awake pm_stay_awake + pm_system_cancel_wakeup pm_system_wakeup pm_wakeup_dev_event pm_wakeup_ws_event From 48ffcbf0b9e7f0280bfb8c32c68da0aaf0fdfef6 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 25 Apr 2021 15:24:07 +0900 Subject: [PATCH 13/33] FROMGIT: kbuild: update config_data.gz only when the content of .config is changed If the timestamp of the .config file is updated, config_data.gz is regenerated, then vmlinux is re-linked. This occurs even if the content of the .config has not changed at all. This issue was mitigated by commit 67424f61f813 ("kconfig: do not write .config if the content is the same"); Kconfig does not update the .config when it ends up with the identical configuration. The issue is remaining when the .config is created by *_defconfig with some config fragment(s) applied on top. This is typical for powerpc and mips, where several *_defconfig targets are constructed by using merge_config.sh. One workaround is to have the copy of the .config. The filechk rule updates the copy, kernel/config_data, by checking the content instead of the timestamp. With this commit, the second run with the same configuration avoids the needless rebuilds. $ make ARCH=mips defconfig all [ snip ] $ make ARCH=mips defconfig all *** Default configuration is based on target '32r2el_defconfig' Using ./arch/mips/configs/generic_defconfig as base Merging arch/mips/configs/generic/32r2.config Merging arch/mips/configs/generic/el.config Merging ./arch/mips/configs/generic/board-boston.config Merging ./arch/mips/configs/generic/board-ni169445.config Merging ./arch/mips/configs/generic/board-ocelot.config Merging ./arch/mips/configs/generic/board-ranchu.config Merging ./arch/mips/configs/generic/board-sead-3.config Merging ./arch/mips/configs/generic/board-xilfpga.config # # configuration written to .config # SYNC include/config/auto.conf CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh CHK include/generated/compile.h CHK include/generated/autoksyms.h Reported-by: Elliot Berman Signed-off-by: Masahiro Yamada Bug: 179648610 (cherry picked from commit b33976d90d1ea7652fff662dcc2234f352346a33 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild) [eberman: Fixed minor conflicts in kernel/.gitignore] Change-Id: I8c93147c8d5a48d0f5e9abf855870b10c1a24efc Signed-off-by: Elliot Berman --- kernel/.gitignore | 1 + kernel/Makefile | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/.gitignore b/kernel/.gitignore index 34d1e77ee9df..16670321c138 100644 --- a/kernel/.gitignore +++ b/kernel/.gitignore @@ -1,6 +1,7 @@ # # Generated files # +config_data kheaders.md5 timeconst.h hz.bc diff --git a/kernel/Makefile b/kernel/Makefile index 08652a850458..9e02af6edfd3 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -128,10 +128,15 @@ KCOV_INSTRUMENT_stackleak.o := n $(obj)/configs.o: $(obj)/config_data.gz -targets += config_data.gz -$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE +targets += config_data config_data.gz +$(obj)/config_data.gz: $(obj)/config_data FORCE $(call if_changed,gzip) +filechk_cat = cat $< + +$(obj)/config_data: $(KCONFIG_CONFIG) FORCE + $(call filechk,cat) + $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz From 305c5f54869e206c5e82e8b8461e6779dd71e245 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 22 Apr 2020 02:01:54 +0000 Subject: [PATCH 14/33] UPSTREAM: mac80211_hwsim: use GFP_ATOMIC under spin lock A spin lock is taken here so we should use GFP_ATOMIC. Fixes: 5d44fe7c9808 ("mac80211_hwsim: add frame transmission support over virtio") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200422020154.112088-1-weiyongjun1@huawei.com Signed-off-by: Johannes Berg (cherry picked from commit 0379861217dc2dd46e3bc517010060065b0dd6fc) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I16c7f59f3e695ac6a6ffaa25217e3d7309827dca --- drivers/net/wireless/mac80211_hwsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index a9fc831eba60..bc4618ae9c5f 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -4041,7 +4041,7 @@ static void hwsim_virtio_rx_work(struct work_struct *work) } vq = hwsim_vqs[HWSIM_VQ_RX]; sg_init_one(sg, skb->head, skb_end_offset(skb)); - err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL); + err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_ATOMIC); if (WARN(err, "virtqueue_add_inbuf returned %d\n", err)) nlmsg_free(skb); else From 7db1c96c2d149e94e2380240364086a15a7c41e7 Mon Sep 17 00:00:00 2001 From: Alexander Lobakin Date: Wed, 17 Jun 2020 20:42:47 +0000 Subject: [PATCH 15/33] BACKPORT: net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As a result, fraglist GSO feature is not shown in 'ethtool -k' output and can't be toggled on/off. The fix is trivial. Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") Signed-off-by: Alexander Lobakin Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller (cherry picked from commit eddbf5d0204e550ee59de02bdc19fe90d4203dd6) [netdev_features_strings is in net/core/ethtool.c on this branch, so apply the change there] Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I20b389538ac02fc63cf8fa59dfb9010296237056 --- net/core/ethtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/ethtool.c b/net/core/ethtool.c index cd9bc67381b2..99ce0ccc66df 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -92,6 +92,7 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation", [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation", [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation", + [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list", [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc", [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp", From dee5558ec9dba4e38cf529db80c38a0e8e5f4da1 Mon Sep 17 00:00:00 2001 From: Yu Kuai Date: Tue, 10 Nov 2020 09:14:43 +0800 Subject: [PATCH 16/33] UPSTREAM: net: xfrm: fix memory leak in xfrm_user_policy() if xfrm_get_translator() failed, xfrm_user_policy() return without freeing 'data', which is allocated in memdup_sockptr(). Fixes: 96392ee5a13b ("xfrm/compat: Translate 32-bit user_policy from sockptr") Reported-by: Hulk Robot Signed-off-by: Yu Kuai Signed-off-by: Steffen Klassert (cherry picked from commit 48f486e13ffdb49fbb9b38c21d0e108ed60ab1a2) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: If018bce68d0d23491f1c47299443f7011dce3e89 --- net/xfrm/xfrm_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 83a8cbf2a37a..8bb052bb137e 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -2381,8 +2381,10 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen if (in_compat_syscall()) { struct xfrm_translator *xtr = xfrm_get_translator(); - if (!xtr) + if (!xtr) { + kfree(data); return -EOPNOTSUPP; + } err = xtr->xlate_user_policy_sockptr(&data, optlen); xfrm_put_translator(xtr); From a9cedd30326a0fd7f7df3f4572f1132e67ad3447 Mon Sep 17 00:00:00 2001 From: Pujin Shi Date: Fri, 2 Oct 2020 14:35:38 +0800 Subject: [PATCH 17/33] BACKPORT: scsi: ufs: Fix missing brace warning for old compilers For older versions of gcc, the array = {0}; will cause warnings: drivers/scsi/ufs/ufshcd-crypto.c: In function 'ufshcd_crypto_keyslot_program': drivers/scsi/ufs/ufshcd-crypto.c:62:8: warning: missing braces around initializer [-Wmissing-braces] union ufs_crypto_cfg_entry cfg = { 0 }; ^ drivers/scsi/ufs/ufshcd-crypto.c:62:8: warning: (near initialization for 'cfg.reg_val') [-Wmissing-braces] drivers/scsi/ufs/ufshcd-crypto.c: In function 'ufshcd_clear_keyslot': drivers/scsi/ufs/ufshcd-crypto.c:103:8: warning: missing braces around initializer [-Wmissing-braces] union ufs_crypto_cfg_entry cfg = { 0 }; ^ 2 warnings generated Link: https://lore.kernel.org/r/20201002063538.1250-1-shipujin.t@gmail.com Fixes: 70297a8ac7a7 ("scsi: ufs: UFS crypto API") Reviewed-by: Eric Biggers Signed-off-by: Pujin Shi Signed-off-by: Martin K. Petersen (cherry picked from commit 6500251e590657066a227dce897a0392f302af24) [drop non-applicable change to ufshcd_crypto_keyslot_program] Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I06c4eacc036cc5e9d80217a986cfe9427fb6e255 --- drivers/scsi/ufs/ufshcd-crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c index 43d105bc0e26..f667a946c740 100644 --- a/drivers/scsi/ufs/ufshcd-crypto.c +++ b/drivers/scsi/ufs/ufshcd-crypto.c @@ -159,7 +159,7 @@ out: static void ufshcd_clear_keyslot(struct ufs_hba *hba, int slot) { - union ufs_crypto_cfg_entry cfg = { 0 }; + union ufs_crypto_cfg_entry cfg = {}; int err; err = ufshcd_program_key(hba, &cfg, slot); From ee97d20c7e334274dd5d4d11dc1b85c26d7a5132 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Mon, 2 Nov 2020 16:14:47 +0000 Subject: [PATCH 18/33] UPSTREAM: xfrm/compat: Don't allocate memory with __GFP_ZERO 32-bit to 64-bit messages translator zerofies needed paddings in the translation, the rest is the actual payload. Don't allocate zero pages as they are not needed. Fixes: 5106f4a8acff ("xfrm/compat: Add 32=>64-bit messages translator") Signed-off-by: Dmitry Safonov Signed-off-by: Steffen Klassert (cherry picked from commit ad37f77fd3659e87fd9833a83692e0e4eba0f5cd) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: Icefe6cd5ed03975f0f87cc1b126cfe55b36c35e5 --- net/xfrm/xfrm_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c index c1dee0696dfb..0e7476e05f3a 100644 --- a/net/xfrm/xfrm_compat.c +++ b/net/xfrm/xfrm_compat.c @@ -563,7 +563,7 @@ static struct nlmsghdr *xfrm_user_rcv_msg_compat(const struct nlmsghdr *h32, return NULL; len += NLMSG_HDRLEN; - h64 = kvmalloc(len, GFP_KERNEL | __GFP_ZERO); + h64 = kvmalloc(len, GFP_KERNEL); if (!h64) return ERR_PTR(-ENOMEM); From 957e971ed90cacdfdfc13c8a6e0def199735d9cb Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Mon, 2 Nov 2020 16:14:46 +0000 Subject: [PATCH 19/33] UPSTREAM: xfrm/compat: memset(0) 64-bit padding at right place 32-bit messages translated by xfrm_compat can have attributes attached. For all, but XFRMA_SA, XFRMA_POLICY the size of payload is the same in 32-bit UABI and 64-bit UABI. For XFRMA_SA (struct xfrm_usersa_info) and XFRMA_POLICY (struct xfrm_userpolicy_info) it's only tail-padding that is present in 64-bit payload, but not in 32-bit. The proper size for destination nlattr is already calculated by xfrm_user_rcv_calculate_len64() and allocated with kvmalloc(). xfrm_attr_cpy32() copies 32-bit copy_len into 64-bit attribute translated payload, zero-filling possible padding for SA/POLICY. Due to a typo, *pos already has 64-bit payload size, in a result next memset(0) is called on the memory after the translated attribute, not on the tail-padding of it. Fixes: 5106f4a8acff ("xfrm/compat: Add 32=>64-bit messages translator") Reported-by: syzbot+c43831072e7df506a646@syzkaller.appspotmail.com Signed-off-by: Dmitry Safonov Signed-off-by: Steffen Klassert (cherry picked from commit d1949d045fd67eab8a32a579a8c1ab1681330854) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: Ic81e020da215c3fd093a76dc687abf5f86827283 --- net/xfrm/xfrm_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c index 0e7476e05f3a..48cbece14430 100644 --- a/net/xfrm/xfrm_compat.c +++ b/net/xfrm/xfrm_compat.c @@ -387,7 +387,7 @@ static int xfrm_attr_cpy32(void *dst, size_t *pos, const struct nlattr *src, memcpy(nla, src, nla_attr_size(copy_len)); nla->nla_len = nla_attr_size(payload); - *pos += nla_attr_size(payload); + *pos += nla_attr_size(copy_len); nlmsg->nlmsg_len += nla->nla_len; memset(dst + *pos, 0, payload - copy_len); From e6d3c97bac2566df51b64c4e07a02e3e18238c34 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Mon, 2 Nov 2020 16:14:45 +0000 Subject: [PATCH 20/33] UPSTREAM: xfrm/compat: Translate by copying XFRMA_UNSPEC attribute xfrm_xlate32() translates 64-bit message provided by kernel to be sent for 32-bit listener (acknowledge or monitor). Translator code doesn't expect XFRMA_UNSPEC attribute as it doesn't know its payload. Kernel never attaches such attribute, but a user can. I've searched if any opensource does it and the answer is no. Nothing on github and google finds only tfcproject that has such code commented-out. What will happen if a user sends a netlink message with XFRMA_UNSPEC attribute? Ipsec code ignores this attribute. But if there is a monitor-process or 32-bit user requested ack - kernel will try to translate such message and will hit WARN_ONCE() in xfrm_xlate64_attr(). Deal with XFRMA_UNSPEC by copying the attribute payload with xfrm_nla_cpy(). In result, the default switch-case in xfrm_xlate64_attr() becomes an unused code. Leave those 3 lines in case a new xfrm attribute will be added. Fixes: 5461fc0c8d9f ("xfrm/compat: Add 64=>32-bit messages translator") Reported-by: syzbot+a7e701c8385bd8543074@syzkaller.appspotmail.com Signed-off-by: Dmitry Safonov Signed-off-by: Steffen Klassert (cherry picked from commit dbd7ae5154d5fff7e84a9f3010bb06499017ef29) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I11e05ca491155a1dd28f8820ded7ada096595075 --- net/xfrm/xfrm_compat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c index 48cbece14430..aacbf250a25e 100644 --- a/net/xfrm/xfrm_compat.c +++ b/net/xfrm/xfrm_compat.c @@ -234,6 +234,7 @@ static int xfrm_xlate64_attr(struct sk_buff *dst, const struct nlattr *src) case XFRMA_PAD: /* Ignore */ return 0; + case XFRMA_UNSPEC: case XFRMA_ALG_AUTH: case XFRMA_ALG_CRYPT: case XFRMA_ALG_COMP: From 3f54d632a6049753185ea19a0200fb4e0eed3a43 Mon Sep 17 00:00:00 2001 From: Qinglang Miao Date: Tue, 10 Nov 2020 15:42:23 +0800 Subject: [PATCH 21/33] UPSTREAM: scsi: ufshcd: Fix missing destroy_workqueue() Add the missing destroy_workqueue() before return from ufshcd_init in the error handling case as well as in ufshcd_remove. Link: https://lore.kernel.org/r/20201110074223.41280-1-miaoqinglang@huawei.com Fixes: 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths") Suggested-by: Avri Altman Reviewed-by: Asutosh Das Reviewed-by: Avri Altman Signed-off-by: Qinglang Miao Signed-off-by: Martin K. Petersen (cherry picked from commit 2e6f11a797a24d1e2141a214a6dd6dfbe709f55d) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I2db2a6c6fb22b1e780ec7e167940d7104aaae267 --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 88ea198697eb..4c12b3d3c9f4 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -9025,6 +9025,7 @@ void ufshcd_remove(struct ufs_hba *hba) ufs_bsg_remove(hba); ufs_sysfs_remove_nodes(hba->dev); scsi_remove_host(hba->host); + destroy_workqueue(hba->eh_wq); /* disable interrupts */ ufshcd_disable_intr(hba, hba->intr_mask); ufshcd_hba_stop(hba, true); @@ -9296,6 +9297,7 @@ out_remove_scsi_host: exit_gating: ufshcd_exit_clk_scaling(hba); ufshcd_exit_clk_gating(hba); + destroy_workqueue(hba->eh_wq); out_disable: hba->is_irq_enabled = false; ufshcd_hba_exit(hba); From be192b51bfdfb7bd223e7ca3354eb91641cc75cc Mon Sep 17 00:00:00 2001 From: Vincent Guittot Date: Thu, 29 Oct 2020 17:18:24 +0100 Subject: [PATCH 22/33] UPSTREAM: sched/fair: Prefer prev cpu in asymmetric wakeup path During fast wakeup path, scheduler always check whether local or prev cpus are good candidates for the task before looking for other cpus in the domain. With commit b7a331615d25 ("sched/fair: Add asymmetric CPU capacity wakeup scan") the heterogenous system gains a dedicated path but doesn't try to reuse prev cpu whenever possible. If the previous cpu is idle and belong to the LLC domain, we should check it 1st before looking for another cpu because it stays one of the best candidate and this also stabilizes task placement on the system. This change aligns asymmetric path behavior with symmetric one and reduces cases where the task migrates across all cpus of the sd_asym_cpucapacity domains at wakeup. This change does not impact normal EAS mode but only the overloaded case or when EAS is not used. - On hikey960 with performance governor (EAS disable) ./perf bench sched pipe -T -l 50000 mainline w/ patch ops/sec 149313(+/-0.28%) 182587(+/- 0.40) +22% - On hikey with performance governor ./perf bench sched pipe -T -l 50000 mainline w/ patch ops/sec 47721(+/-0.76%) 47899(+/- 0.56) +0.4% According to test on hikey, the patch doesn't impact symmetric system compared to current implementation (only tested on arm64) Also read the uclamped value of task's utilization at most twice instead instead each time we compare task's utilization with cpu's capacity. Fixes: b7a331615d25 ("sched/fair: Add asymmetric CPU capacity wakeup scan") Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Tested-by: Dietmar Eggemann Reviewed-by: Valentin Schneider Link: https://lkml.kernel.org/r/20201029161824.26389-1-vincent.guittot@linaro.org (cherry picked from commit b4c9c9f15649c98a5b45408919d1ff4fd7f5531c) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: Icaba6ae29d5bd23f87ca5492b778869be9e0d9c9 --- kernel/sched/fair.c | 89 +++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c319f4fac43e..ec1fccef1484 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6085,21 +6085,21 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t static int select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target) { - unsigned long best_cap = 0; + unsigned long task_util, best_cap = 0; int cpu, best_cpu = -1; struct cpumask *cpus; - sync_entity_load_avg(&p->se); - cpus = this_cpu_cpumask_var_ptr(select_idle_mask); cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); + task_util = uclamp_task_util(p); + for_each_cpu_wrap(cpu, cpus, target) { unsigned long cpu_cap = capacity_of(cpu); if (!available_idle_cpu(cpu) && !sched_idle_cpu(cpu)) continue; - if (task_fits_capacity(p, cpu_cap)) + if (fits_capacity(task_util, cpu_cap)) return cpu; if (cpu_cap > best_cap) { @@ -6111,14 +6111,60 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target) return best_cpu; } +static inline bool asym_fits_capacity(int task_util, int cpu) +{ + if (static_branch_unlikely(&sched_asym_cpucapacity)) + return fits_capacity(task_util, capacity_of(cpu)); + + return true; +} + /* * Try and locate an idle core/thread in the LLC cache domain. */ static int select_idle_sibling(struct task_struct *p, int prev, int target) { struct sched_domain *sd; + unsigned long task_util; int i, recent_used_cpu; + /* + * On asymmetric system, update task utilization because we will check + * that the task fits with cpu's capacity. + */ + if (static_branch_unlikely(&sched_asym_cpucapacity)) { + sync_entity_load_avg(&p->se); + task_util = uclamp_task_util(p); + } + + if ((available_idle_cpu(target) || sched_idle_cpu(target)) && + asym_fits_capacity(task_util, target)) + return target; + + /* + * If the previous CPU is cache affine and idle, don't be stupid: + */ + if (prev != target && cpus_share_cache(prev, target) && + (available_idle_cpu(prev) || sched_idle_cpu(prev)) && + asym_fits_capacity(task_util, prev)) + return prev; + + /* Check a recently used CPU as a potential idle candidate: */ + recent_used_cpu = p->recent_used_cpu; + if (recent_used_cpu != prev && + recent_used_cpu != target && + cpus_share_cache(recent_used_cpu, target) && + (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && + cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) && + asym_fits_capacity(task_util, recent_used_cpu)) { + /* + * Replace recent_used_cpu with prev as it is a potential + * candidate for the next wake: + */ + p->recent_used_cpu = prev; + return recent_used_cpu; + } + /* * For asymmetric CPU capacity systems, our domain of interest is * sd_asym_cpucapacity rather than sd_llc. @@ -6133,37 +6179,10 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) * SD_ASYM_CPUCAPACITY. These should follow the usual symmetric * capacity path. */ - if (!sd) - goto symmetric; - - i = select_idle_capacity(p, sd, target); - return ((unsigned)i < nr_cpumask_bits) ? i : target; - } - -symmetric: - if (available_idle_cpu(target) || sched_idle_cpu(target)) - return target; - - /* - * If the previous CPU is cache affine and idle, don't be stupid: - */ - if (prev != target && cpus_share_cache(prev, target) && - (available_idle_cpu(prev) || sched_idle_cpu(prev))) - return prev; - - /* Check a recently used CPU as a potential idle candidate: */ - recent_used_cpu = p->recent_used_cpu; - if (recent_used_cpu != prev && - recent_used_cpu != target && - cpus_share_cache(recent_used_cpu, target) && - (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && - cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr)) { - /* - * Replace recent_used_cpu with prev as it is a potential - * candidate for the next wake: - */ - p->recent_used_cpu = prev; - return recent_used_cpu; + if (sd) { + i = select_idle_capacity(p, sd, target); + return ((unsigned)i < nr_cpumask_bits) ? i : target; + } } sd = rcu_dereference(per_cpu(sd_llc, target)); From d9d13f4b76a01fd80cc1d5b316b74db5f75fc77b Mon Sep 17 00:00:00 2001 From: Hyeongseok Kim Date: Thu, 12 Nov 2020 18:14:54 +0900 Subject: [PATCH 23/33] UPSTREAM: f2fs: fix double free of unicode map In case of retrying fill_super with skip_recovery, s_encoding for casefold would not be loaded again even though it's already been freed because it's not NULL. Set NULL after free to prevent double freeing when unmount. Fixes: eca4873ee1b6 ("f2fs: Use generic casefolding support") Signed-off-by: Hyeongseok Kim Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim (cherry picked from commit 89ff6005039a878afac87889fee748fa3f957c3a) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: Ib29e84c8e77e710fd2f9649a56750d33fd620fba --- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8b64af017733..3d63a89daa18 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3844,6 +3844,7 @@ free_bio_info: #ifdef CONFIG_UNICODE utf8_unload(sb->s_encoding); + sb->s_encoding = NULL; #endif free_options: #ifdef CONFIG_QUOTA From b55ed54016717d09dd18c2fcb0cabb68443d9b5b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 8 Dec 2020 20:03:26 +0100 Subject: [PATCH 24/33] UPSTREAM: driver: core: Fix list corruption after device_del() The device_links_purge() function (called from device_del()) tries to remove the links.needs_suppliers list entry, but it's using list_del(), hence it doesn't initialize after the removal. This is OK for normal cases where device_del() is called via device_destroy(). However, it's not guaranteed that the device object will be really deleted soon after device_del(). In a minor case like HD-audio codec reconfiguration that re-initializes the device after device_del(), it may lead to a crash by the corrupted list entry. As a simple fix, replace list_del() with list_del_init() in order to make the list intact after the device_del() call. Fixes: e2ae9bcc4aaa ("driver core: Add support for linking devices during device addition") Cc: Reviewed-by: Rafael J. Wysocki Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20201208190326.27531-1-tiwai@suse.de Cc: Saravana Kannan Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 66482f640755b31cb94371ff6cef17400cda6db5) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: If1c0eb2511292b430eb275e72f7e4ccf55b4f96b --- drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 0f9f3701bd89..0f6d3c4a2f3a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1373,7 +1373,7 @@ static void device_links_purge(struct device *dev) return; mutex_lock(&wfs_lock); - list_del(&dev->links.needs_suppliers); + list_del_init(&dev->links.needs_suppliers); mutex_unlock(&wfs_lock); /* From 2e09274b7c603cf228c7d702a2020ff62cab30cc Mon Sep 17 00:00:00 2001 From: Stanley Chu Date: Tue, 8 Dec 2020 21:56:34 +0800 Subject: [PATCH 25/33] UPSTREAM: scsi: ufs: Re-enable WriteBooster after device reset UFS 3.1 specification mentions that the WriteBooster flags listed below will be set to their default values, i.e. disabled, after power cycle or any type of reset event. Thus we need to reset the flag variables kept in struct hba to align with the device status and ensure that WriteBooster-related functions are configured properly after device reset. Without this fix, WriteBooster will not be enabled successfully after by ufshcd_wb_ctrl() after device reset because hba->wb_enabled remains true. Flags required to be reset to default values: - fWriteBoosterEn: hba->wb_enabled - fWriteBoosterBufferFlushEn: hba->wb_buf_flush_enabled - fWriteBoosterBufferFlushDuringHibernate: No variable mapped Link: https://lore.kernel.org/r/20201208135635.15326-2-stanley.chu@mediatek.com Fixes: 3d17b9b5ab11 ("scsi: ufs: Add write booster feature support") Reviewed-by: Bean Huo Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen (cherry picked from commit bd14bf0e4a084514aa62d24d2109e0f09a93822f) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I994290c3824cac50828e097cdfb4a93e9dcfeb36 --- drivers/scsi/ufs/ufshcd.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 13783dc5a0b4..c794fdc2fa10 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -1266,6 +1266,10 @@ static inline void ufshcd_vops_device_reset(struct ufs_hba *hba) if (hba->vops && hba->vops->device_reset) { hba->vops->device_reset(hba); ufshcd_set_ufs_dev_active(hba); + if (ufshcd_is_wb_allowed(hba)) { + hba->wb_enabled = false; + hba->wb_buf_flush_enabled = false; + } ufshcd_update_reg_hist(&hba->ufs_stats.dev_reset, 0); } } From e7e2f8329c29a7e17c35436b8dbdbb2118f1bfc4 Mon Sep 17 00:00:00 2001 From: Stanley Chu Date: Tue, 22 Dec 2020 15:29:04 +0800 Subject: [PATCH 26/33] UPSTREAM: scsi: ufs: Fix possible power drain during system suspend Currently if device needs to do flush or BKOP operations, the device VCC power is kept during runtime-suspend period. However, if system suspend is happening while device is runtime-suspended, such power may not be disabled successfully. The reasons may be, 1. If current PM level is the same as SPM level, device will keep runtime-suspended by ufshcd_system_suspend(). 2. Flush recheck work may not be scheduled successfully during system suspend period. If it can wake up the system, this is also not the intention of the recheck work. To fix this issue, simply runtime-resume the device if the flush is allowed during runtime suspend period. Flush capability will be disabled while leaving runtime suspend, and also not be allowed in system suspend period. Link: https://lore.kernel.org/r/20201222072905.32221-2-stanley.chu@mediatek.com Fixes: 51dd905bd2f6 ("scsi: ufs: Fix WriteBooster flush during runtime suspend") Reviewed-by: Chaotian Jing Reviewed-by: Can Guo Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen (cherry picked from commit 1d53864c3617f5235f891ca0fbe9347c4cd35d46) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I2c7738084d968fd3987d4876f04ea9c9b4318fb1 --- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 4c12b3d3c9f4..1e387525b947 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8850,7 +8850,8 @@ int ufshcd_system_suspend(struct ufs_hba *hba) if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) == hba->curr_dev_pwr_mode) && (ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) == - hba->uic_link_state)) + hba->uic_link_state) && + !hba->dev_info.b_rpm_dev_flush_capable) goto out; if (pm_runtime_suspended(hba->dev)) { From 550b2c0dce83a59994102f2910cb1e10ad00c9a0 Mon Sep 17 00:00:00 2001 From: Dongseok Yi Date: Fri, 8 Jan 2021 11:28:38 +0900 Subject: [PATCH 27/33] UPSTREAM: net: fix use-after-free when UDP GRO with shared fraglist skbs in fraglist could be shared by a BPF filter loaded at TC. If TC writes, it will call skb_ensure_writable -> pskb_expand_head to create a private linear section for the head_skb. And then call skb_clone_fraglist -> skb_get on each skb in the fraglist. skb_segment_list overwrites part of the skb linear section of each fragment itself. Even after skb_clone, the frag_skbs share their linear section with their clone in PF_PACKET. Both sk_receive_queue of PF_PACKET and PF_INET (or PF_INET6) can have a link for the same frag_skbs chain. If a new skb (not frags) is queued to one of the sk_receive_queue, multiple ptypes can see and release this. It causes use-after-free. [ 4443.426215] ------------[ cut here ]------------ [ 4443.426222] refcount_t: underflow; use-after-free. [ 4443.426291] WARNING: CPU: 7 PID: 28161 at lib/refcount.c:190 refcount_dec_and_test_checked+0xa4/0xc8 [ 4443.426726] pstate: 60400005 (nZCv daif +PAN -UAO) [ 4443.426732] pc : refcount_dec_and_test_checked+0xa4/0xc8 [ 4443.426737] lr : refcount_dec_and_test_checked+0xa0/0xc8 [ 4443.426808] Call trace: [ 4443.426813] refcount_dec_and_test_checked+0xa4/0xc8 [ 4443.426823] skb_release_data+0x144/0x264 [ 4443.426828] kfree_skb+0x58/0xc4 [ 4443.426832] skb_queue_purge+0x64/0x9c [ 4443.426844] packet_set_ring+0x5f0/0x820 [ 4443.426849] packet_setsockopt+0x5a4/0xcd0 [ 4443.426853] __sys_setsockopt+0x188/0x278 [ 4443.426858] __arm64_sys_setsockopt+0x28/0x38 [ 4443.426869] el0_svc_common+0xf0/0x1d0 [ 4443.426873] el0_svc_handler+0x74/0x98 [ 4443.426880] el0_svc+0x8/0xc Fixes: 3a1296a38d0c (net: Support GRO/GSO fraglist chaining.) Signed-off-by: Dongseok Yi Acked-by: Willem de Bruijn Acked-by: Daniel Borkmann Link: https://lore.kernel.org/r/1610072918-174177-1-git-send-email-dseok.yi@samsung.com Signed-off-by: Jakub Kicinski (cherry picked from commit 53475c5dd856212e91538a9501162e821cc1f791) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: Ife87c4296ba12b39be4868b2c5e0ea6130f76d6d --- net/core/skbuff.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index b87b6334f689..edc9be5aa823 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3649,7 +3649,8 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb, unsigned int delta_truesize = 0; unsigned int delta_len = 0; struct sk_buff *tail = NULL; - struct sk_buff *nskb; + struct sk_buff *nskb, *tmp; + int err; skb_push(skb, -skb_network_offset(skb) + offset); @@ -3659,11 +3660,28 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb, nskb = list_skb; list_skb = list_skb->next; + err = 0; + if (skb_shared(nskb)) { + tmp = skb_clone(nskb, GFP_ATOMIC); + if (tmp) { + consume_skb(nskb); + nskb = tmp; + err = skb_unclone(nskb, GFP_ATOMIC); + } else { + err = -ENOMEM; + } + } + if (!tail) skb->next = nskb; else tail->next = nskb; + if (unlikely(err)) { + nskb->next = list_skb; + goto err_linearize; + } + tail = nskb; delta_len += nskb->len; From 24797c44c3baa41910d9df33e20b59bf8293f14e Mon Sep 17 00:00:00 2001 From: Dongseok Yi Date: Sat, 30 Jan 2021 08:13:27 +0900 Subject: [PATCH 28/33] UPSTREAM: udp: ipv4: manipulate network header of NATed UDP GRO fraglist UDP/IP header of UDP GROed frag_skbs are not updated even after NAT forwarding. Only the header of head_skb from ip_finish_output_gso -> skb_gso_segment is updated but following frag_skbs are not updated. A call path skb_mac_gso_segment -> inet_gso_segment -> udp4_ufo_fragment -> __udp_gso_segment -> __udp_gso_segment_list does not try to update UDP/IP header of the segment list but copy only the MAC header. Update port, addr and check of each skb of the segment list in __udp_gso_segment_list. It covers both SNAT and DNAT. Fixes: 9fd1ff5d2ac7 (udp: Support UDP fraglist GRO/GSO.) Signed-off-by: Dongseok Yi Acked-by: Steffen Klassert Link: https://lore.kernel.org/r/1611962007-80092-1-git-send-email-dseok.yi@samsung.com Signed-off-by: Jakub Kicinski (cherry picked from commit c3df39ac9b0e3747bf8233ea9ce4ed5ceb3199d3) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: Ib6159d86309fc5ade95c67abd7eab6880accd12b --- include/net/udp.h | 2 +- net/ipv4/udp_offload.c | 69 +++++++++++++++++++++++++++++++++++++++--- net/ipv6/udp_offload.c | 2 +- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/include/net/udp.h b/include/net/udp.h index e55d5f765807..9ab282cbff20 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -171,7 +171,7 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb, int udp_gro_complete(struct sk_buff *skb, int nhoff, udp_lookup_t lookup); struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, - netdev_features_t features); + netdev_features_t features, bool is_ipv6); static inline struct udphdr *udp_gro_udphdr(struct sk_buff *skb) { diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 9298b0ebc4ff..fd60e5cd1519 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -184,8 +184,67 @@ out_unlock: } EXPORT_SYMBOL(skb_udp_tunnel_segment); +static void __udpv4_gso_segment_csum(struct sk_buff *seg, + __be32 *oldip, __be32 *newip, + __be16 *oldport, __be16 *newport) +{ + struct udphdr *uh; + struct iphdr *iph; + + if (*oldip == *newip && *oldport == *newport) + return; + + uh = udp_hdr(seg); + iph = ip_hdr(seg); + + if (uh->check) { + inet_proto_csum_replace4(&uh->check, seg, *oldip, *newip, + true); + inet_proto_csum_replace2(&uh->check, seg, *oldport, *newport, + false); + if (!uh->check) + uh->check = CSUM_MANGLED_0; + } + *oldport = *newport; + + csum_replace4(&iph->check, *oldip, *newip); + *oldip = *newip; +} + +static struct sk_buff *__udpv4_gso_segment_list_csum(struct sk_buff *segs) +{ + struct sk_buff *seg; + struct udphdr *uh, *uh2; + struct iphdr *iph, *iph2; + + seg = segs; + uh = udp_hdr(seg); + iph = ip_hdr(seg); + + if ((udp_hdr(seg)->dest == udp_hdr(seg->next)->dest) && + (udp_hdr(seg)->source == udp_hdr(seg->next)->source) && + (ip_hdr(seg)->daddr == ip_hdr(seg->next)->daddr) && + (ip_hdr(seg)->saddr == ip_hdr(seg->next)->saddr)) + return segs; + + while ((seg = seg->next)) { + uh2 = udp_hdr(seg); + iph2 = ip_hdr(seg); + + __udpv4_gso_segment_csum(seg, + &iph2->saddr, &iph->saddr, + &uh2->source, &uh->source); + __udpv4_gso_segment_csum(seg, + &iph2->daddr, &iph->daddr, + &uh2->dest, &uh->dest); + } + + return segs; +} + static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb, - netdev_features_t features) + netdev_features_t features, + bool is_ipv6) { unsigned int mss = skb_shinfo(skb)->gso_size; @@ -195,11 +254,11 @@ static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb, udp_hdr(skb)->len = htons(sizeof(struct udphdr) + mss); - return skb; + return is_ipv6 ? skb : __udpv4_gso_segment_list_csum(skb); } struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, - netdev_features_t features) + netdev_features_t features, bool is_ipv6) { struct sock *sk = gso_skb->sk; unsigned int sum_truesize = 0; @@ -211,7 +270,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, __be16 newlen; if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) - return __udp_gso_segment_list(gso_skb, features); + return __udp_gso_segment_list(gso_skb, features, is_ipv6); mss = skb_shinfo(gso_skb)->gso_size; if (gso_skb->len <= sizeof(*uh) + mss) @@ -325,7 +384,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, goto out; if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) - return __udp_gso_segment(skb, features); + return __udp_gso_segment(skb, features, false); mss = skb_shinfo(skb)->gso_size; if (unlikely(skb->len <= mss)) diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index 7a46bd33fa2f..6e06c90fa318 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c @@ -46,7 +46,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, goto out; if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) - return __udp_gso_segment(skb, features); + return __udp_gso_segment(skb, features, true); /* Do software UFO. Complete and fill in the UDP checksum as HW cannot * do checksum of UDP packets sent as multiple IP fragments. From 0475956802ab34d92a184ceee5949df268fc930c Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 26 Feb 2021 15:36:15 +0900 Subject: [PATCH 29/33] UPSTREAM: kbuild: do not include include/config/auto.conf from adjust_autoksyms.sh Commit cd195bc4775a ("kbuild: split adjust_autoksyms.sh in two parts") split out the code that needs include/config/auto.conf. This script no longer needs to include include/config/auto.conf. Fixes: cd195bc4775a ("kbuild: split adjust_autoksyms.sh in two parts") Signed-off-by: Masahiro Yamada (cherry picked from commit 12e9dea6c9766c7403417d00193940cea33ee81a) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I0781bd0198e4a3c8215830f4100ff1371e2d3e82 --- scripts/adjust_autoksyms.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index 2b366d945ccb..d8f6f9c63043 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -34,9 +34,6 @@ case "$KBUILD_VERBOSE" in ;; esac -# We need access to CONFIG_ symbols -. include/config/auto.conf - # Generate a new symbol list file $CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file" From 046c52c95b84f5efdf0cece1723136e862686f6b Mon Sep 17 00:00:00 2001 From: dongjian Date: Tue, 16 Mar 2021 20:15:15 +0800 Subject: [PATCH 30/33] UPSTREAM: scsi: ufs: ufs-mediatek: Correct operator & -> && The "lpm" and "->enabled" are all boolean. We should be using && rather than the bit operator. Link: https://lore.kernel.org/r/1615896915-148864-1-git-send-email-dj0227@163.com Fixes: 488edafb1120 ("scsi: ufs-mediatek: Introduce low-power mode for device power supply") Reviewed-by: Avri Altman Signed-off-by: dongjian Signed-off-by: Yue Hu Signed-off-by: Martin K. Petersen (cherry picked from commit 0fdc7d5d8f3719950478cca452cf7f0f1355be10) Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I010318ede5b79f8b0443b3acf72a8736640ae3f8 --- drivers/scsi/ufs/ufs-mediatek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c index e22f91695b04..6ac8f1e39796 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -582,7 +582,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm) if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc) return; - if (lpm & !hba->vreg_info.vcc->enabled) + if (lpm && !hba->vreg_info.vcc->enabled) regulator_set_mode(hba->vreg_info.vccq2->reg, REGULATOR_MODE_IDLE); else if (!lpm) From e3e60153a4c5838b0df44c30000c47cb8a3f957e Mon Sep 17 00:00:00 2001 From: Lecopzer Chen Date: Wed, 21 Apr 2021 16:23:48 +0800 Subject: [PATCH 31/33] BACKPORT: remoteproc: core: Remove casting to rproc_handle_resource_t There are four different callback functions that are used for the rproc_handle_resource_t callback that all have different second parameter types. rproc_handle_vdev -> struct fw_rsc_vdev rproc_handle_trace -> struct fw_rsc_trace rproc_handle_devmem -> struct fw_rsc_devmem rproc_handle_carveout -> struct fw_rsc_carveout These callbacks are cast to rproc_handle_resource_t so that there is no error about incompatible pointer types. Unfortunately, this is a Clang's Control-Flow Integrity checking violation, which verifies that the callback function's types match the prototypes exactly before jumping. [ 7.275750] Kernel panic - not syncing: CFI failure (target: rproc_handle_vdev+0x0/0x4) [ 7.283763] CPU: 2 PID: 1 Comm: init Tainted: G C O 5.4.70-03301-g527af2c96672 #17 [ 7.292463] Hardware name: NXP i.MX8MPlus EVK board (DT) [ 7.297779] Call trace: [ 7.300232] dump_backtrace.cfi_jt+0x0/0x4 [ 7.304337] show_stack+0x18/0x24 [ 7.307660] dump_stack+0xb8/0x114 [ 7.311069] panic+0x164/0x3d4 [ 7.314130] __ubsan_handle_cfi_check_fail_abort+0x0/0x14 [ 7.319533] perf_proc_update_handler+0x0/0xcc [ 7.323983] __cfi_check+0x63278/0x6a290 [ 7.327913] rproc_boot+0x3f8/0x738 [ 7.331404] rproc_add+0x68/0x110 [ 7.334738] imx_rproc_probe+0x5e4/0x708 [imx_rproc] [ 7.339711] platform_drv_probe+0xac/0xf0 [ 7.343726] really_probe+0x260/0x65c [ 7.347393] driver_probe_device+0x64/0x100 [ 7.351580] device_driver_attach+0x6c/0xac [ 7.355766] __driver_attach+0xdc/0x184 [ 7.359609] bus_for_each_dev+0x98/0x104 [ 7.363537] driver_attach+0x24/0x30 [ 7.367117] bus_add_driver+0x100/0x1e0 [ 7.370958] driver_register+0x78/0x114 [ 7.374800] __platform_driver_register+0x44/0x50 [ 7.379514] init_module+0x20/0xfe8 [imx_rproc] [ 7.384049] do_one_initcall+0x190/0x348 [ 7.387979] do_init_module+0x5c/0x210 [ 7.391731] load_module+0x2fbc/0x3590 [ 7.395485] __arm64_sys_finit_module+0xb8/0xec [ 7.400025] el0_svc_common+0xb4/0x19c [ 7.403777] el0_svc_handler+0x74/0x98 [ 7.407531] el0_svc+0x8/0xc [ 7.410419] SMP: stopping secondary CPUs [ 7.414648] Kernel Offset: disabled [ 7.418142] CPU features: 0x00010002,2000200c [ 7.422501] Memory Limit: none To fix this, change the second parameter of all functions to void * and use a local variable with the correct type so that everything works properly. With this, we can remove casting to rproc_handle_resource_t for these functions. Signed-off-by: Jindong Yue Reviewed-by: Peng Fan Reviewed-by: Sami Tolvanen Reviewed-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210224055825.7417-1-jindong.yue@nxp.com Signed-off-by: Bjorn Andersson (cherry picked from commit 2bf2346159bc99cf0679e25be20f4daca60f3f5c) Bug: 187234877 Reported-by: Joy-mi Huang Signed-off-by: Lecopzer Chen Change-Id: Icc7adeaf98f779fc46a979ff7e9f2ab5f963f636 --- drivers/remoteproc/remoteproc_core.c | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ce92ae227aa1..a08568c85126 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -445,7 +445,7 @@ static void rproc_rvdev_release(struct device *dev) /** * rproc_handle_vdev() - handle a vdev fw resource * @rproc: the remote processor - * @rsc: the vring resource descriptor + * ptr: the vring resource descriptor * @avail: size of available data (for sanity checking the image) * * This resource entry requests the host to statically register a virtio @@ -469,9 +469,10 @@ static void rproc_rvdev_release(struct device *dev) * * Returns 0 on success, or an appropriate error code otherwise */ -static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, +static int rproc_handle_vdev(struct rproc *rproc, void *ptr, int offset, int avail) { + struct fw_rsc_vdev *rsc = ptr; struct device *dev = &rproc->dev; struct rproc_vdev *rvdev; int i, ret; @@ -587,7 +588,7 @@ void rproc_vdev_release(struct kref *ref) /** * rproc_handle_trace() - handle a shared trace buffer resource * @rproc: the remote processor - * @rsc: the trace resource descriptor + * @ptr: the trace resource descriptor * @avail: size of available data (for sanity checking the image) * * In case the remote processor dumps trace logs into memory, @@ -600,9 +601,10 @@ void rproc_vdev_release(struct kref *ref) * * Returns 0 on success, or an appropriate error code otherwise */ -static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, +static int rproc_handle_trace(struct rproc *rproc, void *ptr, int offset, int avail) { + struct fw_rsc_trace *rsc = ptr; struct rproc_debug_trace *trace; struct device *dev = &rproc->dev; char name[15]; @@ -652,7 +654,7 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, /** * rproc_handle_devmem() - handle devmem resource entry * @rproc: remote processor handle - * @rsc: the devmem resource entry + * @ptr: the devmem resource entry * @avail: size of available data (for sanity checking the image) * * Remote processors commonly need to access certain on-chip peripherals. @@ -674,9 +676,10 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, * and not allow firmwares to request access to physical addresses that * are outside those ranges. */ -static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, +static int rproc_handle_devmem(struct rproc *rproc, void *ptr, int offset, int avail) { + struct fw_rsc_devmem *rsc = ptr; struct rproc_mem_entry *mapping; struct device *dev = &rproc->dev; int ret; @@ -853,7 +856,7 @@ static int rproc_release_carveout(struct rproc *rproc, /** * rproc_handle_carveout() - handle phys contig memory allocation requests * @rproc: rproc handle - * @rsc: the resource entry + * @ptr: the resource entry * @avail: size of available data (for image validation) * * This function will handle firmware requests for allocation of physically @@ -869,9 +872,9 @@ static int rproc_release_carveout(struct rproc *rproc, * pressure is important; it may have a substantial impact on performance. */ static int rproc_handle_carveout(struct rproc *rproc, - struct fw_rsc_carveout *rsc, - int offset, int avail) + void *ptr, int offset, int avail) { + struct fw_rsc_carveout *rsc = ptr; struct rproc_mem_entry *carveout; struct device *dev = &rproc->dev; @@ -1028,10 +1031,10 @@ EXPORT_SYMBOL(rproc_of_resm_mem_entry_init); * enum fw_resource_type. */ static rproc_handle_resource_t rproc_loading_handlers[RSC_LAST] = { - [RSC_CARVEOUT] = (rproc_handle_resource_t)rproc_handle_carveout, - [RSC_DEVMEM] = (rproc_handle_resource_t)rproc_handle_devmem, - [RSC_TRACE] = (rproc_handle_resource_t)rproc_handle_trace, - [RSC_VDEV] = (rproc_handle_resource_t)rproc_handle_vdev, + [RSC_CARVEOUT] = rproc_handle_carveout, + [RSC_DEVMEM] = rproc_handle_devmem, + [RSC_TRACE] = rproc_handle_trace, + [RSC_VDEV] = rproc_handle_vdev, }; /* handle firmware resource entries before booting the remote processor */ From 2d5e3ef63282a9539c0ea797e43ec672ea9fd1b7 Mon Sep 17 00:00:00 2001 From: "jy.ser" Date: Thu, 6 May 2021 14:26:54 +0900 Subject: [PATCH 32/33] ANDROID: ABI: update allowed list for galaxy Leaf changes summary: 2 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 2 Added functions: [A] 'function int gpiochip_irqchip_add_key(gpio_chip*, irq_chip*, unsigned int, void (irq_desc*)*, unsigned int, bool, lock_class_key*, lock_class_key*)' [A] 'function void gpiochip_set_nested_irqchip(gpio_chip*, irq_chip*, unsigned int)' Bug: 187366261 Signed-off-by: jy.ser Change-Id: I97e00013450cea1d47a18b9a135e5e8cff707d2c --- android/abi_gki_aarch64.xml | 227 +++++++++++++++++++++------------ android/abi_gki_aarch64_galaxy | 2 + 2 files changed, 150 insertions(+), 79 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index ced999ef6ac8..5cf98b3e7288 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -1842,12 +1842,14 @@ + + @@ -28207,7 +28209,7 @@ - + @@ -30029,7 +30031,7 @@ - + @@ -30239,7 +30241,7 @@ - + @@ -30764,7 +30766,20 @@ - + + + + + + + + + + + + + + @@ -31940,6 +31955,7 @@ + @@ -31951,7 +31967,7 @@ - + @@ -32317,6 +32333,17 @@ + + + + + + + + + + + @@ -32403,7 +32430,7 @@ - + @@ -32487,7 +32514,7 @@ - + @@ -69088,6 +69115,12 @@ + + + + + + @@ -80794,7 +80827,7 @@ - + @@ -80866,7 +80899,7 @@ - + @@ -80939,7 +80972,7 @@ - + @@ -83186,7 +83219,7 @@ - + @@ -83258,7 +83291,7 @@ - + @@ -83303,7 +83336,7 @@ - + @@ -111573,7 +111606,20 @@ - + + + + + + + + + + + + + + @@ -119876,6 +119922,17 @@ + + + + + + + + + + + @@ -121974,57 +122031,57 @@ - - - - - - + + + + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + @@ -165730,7 +165787,7 @@ - + @@ -165814,7 +165871,7 @@ - + @@ -166139,9 +166196,9 @@ - - - + + + @@ -166149,9 +166206,9 @@ - - - + + + @@ -166347,33 +166404,33 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - + + @@ -166926,6 +166983,18 @@ + + + + + + + + + + + + @@ -173940,7 +174009,7 @@ - + @@ -178706,7 +178775,7 @@ - + @@ -178735,7 +178804,7 @@ - + @@ -179327,7 +179396,7 @@ - + @@ -180287,7 +180356,7 @@ - + diff --git a/android/abi_gki_aarch64_galaxy b/android/abi_gki_aarch64_galaxy index bef65a0d87b9..b65bf734e98c 100644 --- a/android/abi_gki_aarch64_galaxy +++ b/android/abi_gki_aarch64_galaxy @@ -1103,9 +1103,11 @@ gpiochip_generic_free gpiochip_generic_request gpiochip_get_data + gpiochip_irqchip_add_key gpiochip_line_is_valid gpiochip_lock_as_irq gpiochip_remove + gpiochip_set_nested_irqchip gpiochip_unlock_as_irq gpiod_direction_input gpiod_direction_output From 0821bcfb48093fa544a1e727e98828340416f974 Mon Sep 17 00:00:00 2001 From: Lecopzer Chen Date: Mon, 14 Dec 2020 19:13:23 -0800 Subject: [PATCH 33/33] UPSTREAM: mm/cma.c: remove redundant cma_mutex lock The cma_mutex which protects alloc_contig_range() was first appeared in commit 7ee793a62fa8c ("cma: Remove potential deadlock situation"), at that time, there is no guarantee the behavior of concurrency inside alloc_contig_range(). After commit 2c7452a075d4db2dc ("mm/page_isolation.c: make start_isolate_page_range() fail if already isolated") > However, two subsystems (CMA and gigantic > huge pages for example) could attempt operations on the same range. If > this happens, one thread may 'undo' the work another thread is doing. > This can result in pageblocks being incorrectly left marked as > MIGRATE_ISOLATE and therefore not available for page allocation. The concurrency inside alloc_contig_range() was clarified. Now we can find that hugepage and virtio call alloc_contig_range() without any lock, thus cma_mutex is "redundant" in cma_alloc() now. Link: https://lkml.kernel.org/r/20201020102241.3729-1-lecopzer.chen@mediatek.com Signed-off-by: Lecopzer Chen Acked-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Matthias Brugger Cc: YJ Chiang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit a4efc174b382fcdb62e2d90d39e78a274a975e38) Signed-off-by: Lecopzer Chen Change-Id: I43755731ddb1a4ac9ac873a6e99c8c96d727ef77 --- mm/cma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/cma.c b/mm/cma.c index e1bf400016b3..def0df5a32f8 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -39,7 +39,6 @@ struct cma cma_areas[MAX_CMA_AREAS]; unsigned cma_area_count; -static DEFINE_MUTEX(cma_mutex); phys_addr_t cma_get_base(const struct cma *cma) { @@ -455,10 +454,9 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, mutex_unlock(&cma->lock); pfn = cma->base_pfn + (bitmap_no << cma->order_per_bit); - mutex_lock(&cma_mutex); ret = alloc_contig_range(pfn, pfn + count, MIGRATE_CMA, GFP_KERNEL | (no_warn ? __GFP_NOWARN : 0)); - mutex_unlock(&cma_mutex); + if (ret == 0) { page = pfn_to_page(pfn); break;