diff --git a/android/GKI_VERSION b/android/GKI_VERSION index 919dab00c71b..0735418fed1f 100644 --- a/android/GKI_VERSION +++ b/android/GKI_VERSION @@ -1 +1 @@ -LTS_5.4.61_559c23e691b8 \ No newline at end of file +LTS_5.4.61_9c7cbdf8b4cf diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 53ce71943135..41eb6b5ddfae 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -568,6 +568,7 @@ + @@ -1193,6 +1194,7 @@ + @@ -4706,7 +4708,6 @@ - @@ -5152,6 +5153,14 @@ + + + + + + + + @@ -9939,14 +9948,6 @@ - - - - - - - - @@ -11458,23 +11459,6 @@ - - - - - - - - - - - - - - - - - @@ -14484,6 +14468,23 @@ + + + + + + + + + + + + + + + + + @@ -23686,26 +23687,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -28731,6 +28712,7 @@ + @@ -31194,6 +31176,11 @@ + + + + + @@ -33086,7 +33073,7 @@ - + @@ -34470,7 +34457,7 @@ - + @@ -34731,7 +34718,7 @@ - + @@ -35742,7 +35729,7 @@ - + @@ -37775,14 +37762,6 @@ - - - - - - - - @@ -40015,7 +39994,7 @@ - + @@ -40245,7 +40224,6 @@ - @@ -51892,6 +51870,7 @@ + @@ -51964,6 +51943,7 @@ + @@ -54776,6 +54756,14 @@ + + + + + + + + @@ -56054,7 +56042,7 @@ - + @@ -56079,8 +56067,8 @@ - - + + @@ -56108,6 +56096,20 @@ + + + + + + + + + + + + + + @@ -60538,167 +60540,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -64013,7 +63854,7 @@ - + @@ -64022,7 +63863,7 @@ - + @@ -69400,7 +69241,7 @@ - + @@ -73103,22 +72944,6 @@ - - - - - - - - - - - - - - - - @@ -73697,6 +73522,22 @@ + + + + + + + + + + + + + + + + @@ -76458,6 +76299,14 @@ + + + + + + + + @@ -76491,7 +76340,7 @@ - + @@ -76527,7 +76376,7 @@ - + @@ -76537,10 +76386,10 @@ - + - + @@ -76949,7 +76798,7 @@ - + @@ -77017,7 +76866,7 @@ - + @@ -77027,36 +76876,36 @@ - + - + - + - + - + - + @@ -77111,7 +76960,7 @@ - + @@ -77135,7 +76984,7 @@ - + @@ -77158,7 +77007,7 @@ - + @@ -77200,7 +77049,7 @@ - + @@ -88719,7 +88568,7 @@ - + @@ -89285,6 +89134,23 @@ + + + + + + + + + + + + + + + + + @@ -89351,7 +89217,7 @@ - + @@ -89631,6 +89497,14 @@ + + + + + + + + @@ -89857,42 +89731,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -90115,7 +89953,7 @@ - + @@ -91139,6 +90977,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91498,7 +91372,7 @@ - + @@ -91697,7 +91571,7 @@ - + @@ -91843,6 +91717,17 @@ + + + + + + + + + + + @@ -93894,6 +93779,17 @@ + + + + + + + + + + + @@ -93981,6 +93877,14 @@ + + + + + + + + @@ -94646,7 +94550,7 @@ - + @@ -95507,7 +95411,7 @@ - + @@ -96687,7 +96591,7 @@ - + @@ -96809,7 +96713,7 @@ - + @@ -96848,7 +96752,7 @@ - + @@ -103951,7 +103855,7 @@ - + @@ -104060,7 +103964,6 @@ - @@ -109067,28 +108970,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -109100,9 +108981,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -109255,7 +109367,18 @@ + + + + + + + + + + + @@ -109444,6 +109567,13 @@ + + + + + + + @@ -109451,6 +109581,10 @@ + + + + @@ -109665,7 +109799,7 @@ - + @@ -109877,15 +110011,18 @@ - + - + - + - + + + + @@ -109893,7 +110030,7 @@ - + @@ -110186,7 +110323,7 @@ - + @@ -113711,6 +113848,25 @@ + + + + + + + + + + + + + + + + + + + @@ -115680,25 +115836,6 @@ - - - - - - - - - - - - - - - - - - - @@ -118424,265 +118561,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -118708,7 +118595,7 @@ - + @@ -118725,25 +118612,25 @@ - + - + - + - + @@ -118751,24 +118638,13 @@ - + - - - - - - - - - - - @@ -118832,6 +118708,7 @@ + @@ -123413,14 +123290,6 @@ - - - - - - - - @@ -124248,7 +124117,7 @@ - + @@ -124368,7 +124237,7 @@ - + @@ -124658,6 +124527,11 @@ + + + + + @@ -124723,47 +124597,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -125089,7 +124922,7 @@ - + @@ -125097,7 +124930,7 @@ - + @@ -125514,36 +125347,13 @@ - - + - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/abi_gki_aarch64_d6430e6763.xml b/android/abi_gki_aarch64_d6430e6763.xml index fb55483a32af..9e395e56f806 100644 --- a/android/abi_gki_aarch64_d6430e6763.xml +++ b/android/abi_gki_aarch64_d6430e6763.xml @@ -3395,97 +3395,97 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3527,28 +3527,28 @@ - + - + - + - + - + - + - + - + @@ -3667,28 +3667,28 @@ - + - + - + - + - + - + - + - + - + @@ -3715,12 +3715,12 @@ - + - + - + @@ -4223,7 +4223,7 @@ - + @@ -4251,7 +4251,7 @@ - + @@ -4879,7 +4879,7 @@ - + @@ -4887,7 +4887,7 @@ - + @@ -4905,7 +4905,7 @@ - + @@ -13168,6 +13168,17 @@ + + + + + + + + + + + @@ -14386,7 +14397,7 @@ - + @@ -16025,7 +16036,7 @@ - + @@ -18035,7 +18046,7 @@ - + @@ -20878,17 +20889,6 @@ - - - - - - - - - - - @@ -24176,7 +24176,6 @@ - @@ -24216,7 +24215,7 @@ - + @@ -24322,7 +24321,7 @@ - + @@ -24360,7 +24359,7 @@ - + @@ -24488,7 +24487,7 @@ - + @@ -27074,7 +27073,7 @@ - + @@ -28021,7 +28020,7 @@ - + @@ -29411,7 +29410,6 @@ - @@ -29803,190 +29801,190 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -30212,132 +30210,132 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -30538,220 +30536,220 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -31377,8 +31375,8 @@ - - + + @@ -31416,21 +31414,21 @@ - - + + - - + + - - + + - - - + + + @@ -31564,7 +31562,7 @@ - + @@ -32421,7 +32419,7 @@ - + @@ -33268,14 +33266,14 @@ - + - + @@ -33288,13 +33286,13 @@ - + - + @@ -33307,7 +33305,7 @@ - + @@ -33427,7 +33425,7 @@ - + @@ -34931,7 +34929,7 @@ - + @@ -39238,6 +39236,14 @@ + + + + + + + + @@ -43418,12 +43424,12 @@ - + - + - + @@ -54609,6 +54615,14 @@ + + + + + + + + @@ -54676,14 +54690,6 @@ - - - - - - - - @@ -55814,7 +55820,7 @@ - + @@ -59457,573 +59463,573 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -60238,118 +60244,118 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -61235,9 +61241,9 @@ - + - + @@ -64441,30 +64447,30 @@ - + - + - + - + - + - + - + - + - + @@ -68290,7 +68296,7 @@ - + @@ -70042,7 +70048,7 @@ - + @@ -70177,12 +70183,12 @@ - + - + - + @@ -70348,7 +70354,7 @@ - + @@ -70356,33 +70362,33 @@ - + - + - + - + - + - + @@ -70395,7 +70401,7 @@ - + @@ -70466,7 +70472,7 @@ - + @@ -70495,7 +70501,7 @@ - + @@ -70662,7 +70668,7 @@ - + @@ -70730,6 +70736,8 @@ + + @@ -78853,13 +78861,13 @@ - + - + @@ -79088,7 +79096,7 @@ - + @@ -79283,7 +79291,7 @@ - + @@ -82370,7 +82378,7 @@ - + @@ -84627,7 +84635,7 @@ - + @@ -85973,15 +85981,15 @@ - - - - + + + + - - - + + + @@ -86405,7 +86413,7 @@ - + @@ -86421,7 +86429,7 @@ - + @@ -86582,7 +86590,7 @@ - + @@ -86603,7 +86611,7 @@ - + @@ -87231,7 +87239,7 @@ - + @@ -88631,7 +88639,7 @@ - + @@ -88648,21 +88656,21 @@ - + - + - + - + - + - + @@ -89250,7 +89258,7 @@ - + @@ -89322,33 +89330,33 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - + + + + @@ -90057,14 +90065,14 @@ - - - + + + - - - + + + @@ -90162,55 +90170,55 @@ - - + + - - - + + + - - + + - - - - + + + + - - - - - - + + + + + + - - - + + + - - + + - - - + + + - - + + - - - - + + + + @@ -90517,57 +90525,57 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -90708,7 +90716,7 @@ - + @@ -90724,24 +90732,24 @@ - + - + - + - + - + - + - + @@ -90839,9 +90847,9 @@ - + - + @@ -91062,6 +91070,22 @@ + + + + + + + + + + + + + + + + @@ -91158,275 +91182,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -91489,7 +91250,7 @@ - + @@ -91564,14 +91325,75 @@ - + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91650,6 +91472,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91765,9 +91613,23 @@ + + + + + + + + + + + + + + - + @@ -91842,6 +91704,23 @@ + + + + + + + + + + + + + + + + + @@ -91975,14 +91854,154 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -92021,17 +92040,19 @@ + + - + - + @@ -92040,7 +92061,7 @@ - + @@ -92123,99 +92144,107 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + @@ -96417,7 +96446,7 @@ - + @@ -97228,36 +97257,36 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -97704,21 +97733,21 @@ - + - + - + - + - + - + @@ -97883,9 +97912,9 @@ - - - + + + @@ -97928,7 +97957,7 @@ - + @@ -98456,56 +98485,56 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -98515,30 +98544,30 @@ - + - + - + - + - + - + - + - + - + @@ -99369,7 +99398,7 @@ - + @@ -99939,14 +99968,6 @@ - - - - - - - - @@ -104084,8 +104105,3 @@ - - diff --git a/android/abi_gki_aarch64_galaxy b/android/abi_gki_aarch64_galaxy index 7d254cd6dd84..cbe1f884a220 100644 --- a/android/abi_gki_aarch64_galaxy +++ b/android/abi_gki_aarch64_galaxy @@ -336,6 +336,7 @@ cfg80211_scan_done cfg80211_sched_scan_results cfg80211_sched_scan_stopped + cfg80211_sched_scan_stopped_rtnl cfg80211_unlink_bss cfg80211_unregister_wdev cfg80211_vendor_cmd_reply @@ -1386,6 +1387,7 @@ krealloc kset_create_and_add kset_unregister + ksize kstat kstrdup kstrdup_quotable diff --git a/android/abi_gki_aarch64_unisoc b/android/abi_gki_aarch64_unisoc index e04f9b3ff8db..5b300379d79e 100644 --- a/android/abi_gki_aarch64_unisoc +++ b/android/abi_gki_aarch64_unisoc @@ -168,6 +168,7 @@ drm_atomic_helper_plane_destroy_state drm_atomic_helper_plane_duplicate_state drm_atomic_helper_plane_reset + drm_atomic_helper_setup_commit drm_compat_ioctl drm_dbg drm_dev_alloc @@ -1049,6 +1050,7 @@ # required by mmc_hsq.ko mmc_cqe_request_done + mmc_send_tuning # required by musb_hdrc.ko device_wakeup_enable @@ -2493,11 +2495,13 @@ __arm_smccc_smc # required by mali_gondul.ko + __arch_clear_user bpf_trace_run5 ktime_get_raw of_machine_is_compatible _totalram_pages trace_output_call + __tracepoint_gpu_mem_total trace_print_array_seq trace_print_flags_seq vmf_insert_pfn_prot diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 359616e3efbb..d2ecc9c45255 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1597,6 +1597,17 @@ static void hid_output_field(const struct hid_device *hid, } } +/* + * Compute the size of a report. + */ +static size_t hid_compute_report_size(struct hid_report *report) +{ + if (report->size) + return ((report->size - 1) >> 3) + 1; + + return 0; +} + /* * Create a report. 'data' has to be allocated using * hid_alloc_report_buf() so that it has proper size. @@ -1609,7 +1620,7 @@ void hid_output_report(struct hid_report *report, __u8 *data) if (report->id > 0) *data++ = report->id; - memset(data, 0, ((report->size - 1) >> 3) + 1); + memset(data, 0, hid_compute_report_size(report)); for (n = 0; n < report->maxfield; n++) hid_output_field(report->device, report->field[n], data); } @@ -1739,7 +1750,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, csize--; } - rsize = ((report->size - 1) >> 3) + 1; + rsize = hid_compute_report_size(report); if (report_enum->numbered && rsize >= HID_MAX_BUFFER_SIZE) rsize = HID_MAX_BUFFER_SIZE - 1; diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index e8641ce677e4..e3d475f4baf6 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1132,6 +1132,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel } mapped: + /* Mapping failed, bail out */ + if (!bit) + return; + if (device->driver->input_mapped && device->driver->input_mapped(device, hidinput, field, usage, &bit, &max) < 0) { diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 39e4da7468e1..128d8f4319b9 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -864,6 +864,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, code = BTN_0 + ((usage->hid - 1) & HID_USAGE); hid_map_usage(hi, usage, bit, max, EV_KEY, code); + if (!*bit) + return -1; input_set_capability(hi->input, EV_KEY, code); return 1; diff --git a/include/linux/hid.h b/include/linux/hid.h index 875f71132b14..c7044a14200e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -959,34 +959,49 @@ static inline void hid_device_io_stop(struct hid_device *hid) { * @max: maximal valid usage->code to consider later (out parameter) * @type: input event type (EV_KEY, EV_REL, ...) * @c: code which corresponds to this usage and type + * + * The value pointed to by @bit will be set to NULL if either @type is + * an unhandled event type, or if @c is out of range for @type. This + * can be used as an error condition. */ static inline void hid_map_usage(struct hid_input *hidinput, struct hid_usage *usage, unsigned long **bit, int *max, - __u8 type, __u16 c) + __u8 type, unsigned int c) { struct input_dev *input = hidinput->input; - - usage->type = type; - usage->code = c; + unsigned long *bmap = NULL; + unsigned int limit = 0; switch (type) { case EV_ABS: - *bit = input->absbit; - *max = ABS_MAX; + bmap = input->absbit; + limit = ABS_MAX; break; case EV_REL: - *bit = input->relbit; - *max = REL_MAX; + bmap = input->relbit; + limit = REL_MAX; break; case EV_KEY: - *bit = input->keybit; - *max = KEY_MAX; + bmap = input->keybit; + limit = KEY_MAX; break; case EV_LED: - *bit = input->ledbit; - *max = LED_MAX; + bmap = input->ledbit; + limit = LED_MAX; break; } + + if (unlikely(c > limit || !bmap)) { + pr_warn_ratelimited("%s: Invalid code %d type %d\n", + input->name, c, type); + *bit = NULL; + return; + } + + usage->type = type; + usage->code = c; + *max = limit; + *bit = bmap; } /** @@ -1000,7 +1015,8 @@ static inline void hid_map_usage_clear(struct hid_input *hidinput, __u8 type, __u16 c) { hid_map_usage(hidinput, usage, bit, max, type, c); - clear_bit(c, *bit); + if (*bit) + clear_bit(usage->code, *bit); } /** diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index e46c96b34d0d..7201bdfaad1e 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -28,6 +28,7 @@ usage() { echo " -r list redundant entries when merging fragments" echo " -y make builtin have precedence over modules" echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." + echo " -s strict mode. Fail if the fragment redefines any value." echo echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable." } @@ -37,6 +38,7 @@ ALLTARGET=alldefconfig WARNREDUN=false BUILTIN=false OUTPUT=. +STRICT=false CONFIG_PREFIX=${CONFIG_-CONFIG_} while true; do @@ -75,6 +77,11 @@ while true; do shift 2 continue ;; + "-s") + STRICT=true + shift + continue + ;; *) break ;; @@ -141,6 +148,9 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do echo Previous value: $PREV_VAL echo New value: $NEW_VAL echo + if [ "$STRICT" = "true" ]; then + STRICT_MODE_VIOLATED=true + fi elif [ "$WARNREDUN" = "true" ]; then echo Value of $CFG is redundant by fragment $ORIG_MERGE_FILE: fi @@ -153,6 +163,11 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do cat $MERGE_FILE >> $TMP_FILE done +if [ "$STRICT_MODE_VIOLATED" = "true" ]; then + echo "The fragment redefined a value and strict mode had been passed." + exit 1 +fi + if [ "$RUNMAKE" = "false" ]; then cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG" echo "#"