Commit graph

886,659 commits

Author SHA1 Message Date
Roman Kiryanov
a6b9410e5f ANDROID: Update android/abi_gki_aarch64_goldfish
required to add new modules.

BUILD_CONFIG=common-modules/virtual-device/build.config.goldfish.aarch64 build/build_abi.sh --update-symbol-list

Bug: 194952533
Change-Id: Ibd0ca4aba81f7de96a82eade42840c0ed173f8ae
Signed-off-by: Roman Kiryanov <rkir@google.com>
2021-07-29 12:18:28 -07:00
Nathan Chancellor
240f2f8f42
ANDROID: generate_initcall_order.pl: Use two dash long options for llvm-nm
Commit 96e9bc424475 ("[llvm-nm] Remove one-dash long options except
-arch") in LLVM removed the one dash long options, which causes this
script to fail and initcalls not to get ordered properly, which
manifests as kernels crashing durin boot.

Use the two dash long options as the LLVM commit mentions that the
documentation and help text have always shown them over the one dash
long versions. This is not an issue with the mainline LTO series as it
used two dash long options.

Change-Id: Iaef9f96af1d75b54eabc4bba38d2a3a58c3c2209
Fixes: 93185a915514 ("ANDROID: init: ensure initcall ordering with LTO")
Link: 96e9bc4244
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3129736977?check_suite_focus=true
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3129775494?check_suite_focus=true
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3129863440?check_suite_focus=true
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2021-07-21 20:41:37 -07:00
jy.ser
8eb8412259 ANDROID: ABI: update allowed list for galaxy
Leaf changes summary: 4 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 4 Added functions

4 Added functions:

  [A] 'function spi_device* of_find_spi_device_by_node(device_node*)'
  [A] 'function snd_card* snd_card_ref(int)'
  [A] 'function int snd_soc_component_enable_pin(snd_soc_component*, const char*)'
  [A] 'function int snd_soc_component_get_pin_status(snd_soc_component*, const char*)'

Bug: 194031787
Signed-off-by: Jiyeon Ser <jy.ser@samsung.com>
Change-Id: I3390357777edb9ffb07cc5eb1cedcc0d1ac90b46
2021-07-20 11:40:01 +09:00
Ashish Chavan
170a31dd74 ANDROID: ABI: Update allowed list for QCOM
Add the following symbols to QCOM allowed-list:
	-- i2c_smbus_write_byte_data
	-- i2c_smbus_read_byte_data

Bug: 193604299
Change-Id: I5294f69eec7a65e860d60ac6f437812b4029caab
Signed-off-by: Ashish Chavan <ashichav@codeaurora.org>
2021-07-14 15:49:38 +05:30
Yoshitaka Seto
f59ee36156 ANDROID: GKI: Add KMI symbol list for Sony Android Walkman products
Added initial file named abi_gki_aarch64_sonywalkman.

abi.report.short:

Leaf changes summary: 14 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 13 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

13 Added functions:

  [A] 'function int cpumask_any_but(const cpumask*, unsigned int)'
  [A] 'function int extcon_set_property_sync(extcon_dev*, unsigned int, unsigned int, extcon_property_value)'
  [A] 'function int extcon_set_state(extcon_dev*, unsigned int, bool)'
  [A] 'function int mmc_gpio_set_cd_wake(mmc_host*, bool)'
  [A] 'function int mod_timer_pending(timer_list*, unsigned long int)'
  [A] 'function void perf_pmu_migrate_context(pmu*, int, int)'
  [A] 'function int perf_pmu_register(pmu*, const char*, int)'
  [A] 'function void perf_pmu_unregister(pmu*)'
  [A] 'function scatterlist* sg_last(scatterlist*, unsigned int)'
  [A] 'function int typec_find_port_data_role(const char*)'
  [A] 'function int typec_find_port_power_role(const char*)'
  [A] 'function int typec_find_power_role(const char*)'
  [A] 'function typec_altmode* typec_match_altmode(typec_altmode**, size_t, u16, u8)'

1 Added variable:

  [A] 'workqueue_struct* system_freezable_power_efficient_wq'

Bug: 193202308
Change-Id: Id6db1e7357f3c42dca310d0aa7d92e71388e25d6
Signed-off-by: Yoshitaka Seto <yoshitaka.seto@sony.com>
2021-07-09 08:38:08 +00:00
Kamal Agrawal
f8878f4c59
ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 3 Added
functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added
variable

3 Added functions:

  [A] 'function int ftrace_set_clr_event(trace_array*, char*, int)'
  [A] 'function trace_array* trace_array_create(const char*)'
  [A] 'function int trace_array_destroy(trace_array*)'

Bug: 192805993
Change-Id: Id6d34efa83f4d212e3cfdf049028117e45cd5411
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
2021-07-05 12:31:35 +05:30
Maciej Żenczykowski
fe9e8630bf FROMGIT: bpf: Do not change gso_size during bpf_skb_change_proto()
This is technically a backwards incompatible change in behaviour, but I'm
going to argue that it is very unlikely to break things, and likely to fix
*far* more then it breaks.

In no particular order, various reasons follow:

(a) I've long had a bug assigned to myself to debug a super rare kernel crash
on Android Pixel phones which can (per stacktrace) be traced back to BPF clat
IPv6 to IPv4 protocol conversion causing some sort of ugly failure much later
on during transmit deep in the GSO engine, AFAICT precisely because of this
change to gso_size, though I've never been able to manually reproduce it. I
believe it may be related to the particular network offload support of attached
USB ethernet dongle being used for tethering off of an IPv6-only cellular
connection. The reason might be we end up with more segments than max permitted,
or with a GSO packet with only one segment... (either way we break some
assumption and hit a BUG_ON)

(b) There is no check that the gso_size is > 20 when reducing it by 20, so we
might end up with a negative (or underflowing) gso_size or a gso_size of 0.
This can't possibly be good. Indeed this is probably somehow exploitable (or
at least can result in a kernel crash) by delivering crafted packets and perhaps
triggering an infinite loop or a divide by zero... As a reminder: gso_size (MSS)
is related to MTU, but not directly derived from it: gso_size/MSS may be
significantly smaller then one would get by deriving from local MTU. And on
some NICs (which do loose MTU checking on receive, it may even potentially be
larger, for example my work pc with 1500 MTU can receive 1520 byte frames [and
sometimes does due to bugs in a vendor plat46 implementation]). Indeed even just
going from 21 to 1 is potentially problematic because it increases the number
of segments by a factor of 21 (think DoS, or some other crash due to too many
segments).

(c) It's always safe to not increase the gso_size, because it doesn't result in
the max packet size increasing.  So the skb_increase_gso_size() call was always
unnecessary for correctness (and outright undesirable, see later). As such the
only part which is potentially dangerous (ie. could cause backwards compatibility
issues) is the removal of the skb_decrease_gso_size() call.

(d) If the packets are ultimately destined to the local device, then there is
absolutely no benefit to playing around with gso_size. It only matters if the
packets will egress the device. ie. we're either forwarding, or transmitting
from the device.

(e) This logic only triggers for packets which are GSO. It does not trigger for
skbs which are not GSO. It will not convert a non-GSO MTU sized packet into a
GSO packet (and you don't even know what the MTU is, so you can't even fix it).
As such your transmit path must *already* be able to handle an MTU 20 bytes
larger then your receive path (for IPv4 to IPv6 translation) - and indeed 28
bytes larger due to IPv4 fragments. Thus removing the skb_decrease_gso_size()
call doesn't actually increase the size of the packets your transmit side must
be able to handle. ie. to handle non-GSO max-MTU packets, the IPv4/IPv6 device/
route MTUs must already be set correctly. Since for example with an IPv4 egress
MTU of 1500, IPv4 to IPv6 translation will already build 1520 byte IPv6 frames,
so you need a 1520 byte device MTU. This means if your IPv6 device's egress
MTU is 1280, your IPv4 route must be 1260 (and actually 1252, because of the
need to handle fragments). This is to handle normal non-GSO packets. Thus the
reduction is simply not needed for GSO packets, because when they're correctly
built, they will already be the right size.

(f) TSO/GSO should be able to exactly undo GRO: the number of packets (TCP
segments) should not be modified, so that TCP's MSS counting works correctly
(this matters for congestion control). If protocol conversion changes the
gso_size, then the number of TCP segments may increase or decrease. Packet loss
after protocol conversion can result in partial loss of MSS segments that the
sender sent. How's the sending TCP stack going to react to receiving ACKs/SACKs
in the middle of the segments it sent?

(g) skb_{decrease,increase}_gso_size() are already no-ops for GSO_BY_FRAGS
case (besides triggering WARN_ON_ONCE). This means you already cannot guarantee
that gso_size (and thus resulting packet MTU) is changed. ie. you must assume
it won't be changed.

(h) changing gso_size is outright buggy for UDP GSO packets, where framing
matters (I believe that's also the case for SCTP, but it's already excluded
by [g]).  So the only remaining case is TCP, which also doesn't want it
(see [f]).

(i) see also the reasoning on the previous attempt at fixing this
(commit fa7b83bf3b156c767f3e4a25bbf3817b08f3ff8e) which shows that the current
behaviour causes TCP packet loss:

  In the forwarding path GRO -> BPF 6 to 4 -> GSO for TCP traffic, the
  coalesced packet payload can be > MSS, but < MSS + 20.

  bpf_skb_proto_6_to_4() will upgrade the MSS and it can be > the payload
  length. After then tcp_gso_segment checks for the payload length if it
  is <= MSS. The condition is causing the packet to be dropped.

  tcp_gso_segment():
    [...]
    mss = skb_shinfo(skb)->gso_size;
    if (unlikely(skb->len <= mss)) goto out;
    [...]

Thus changing the gso_size is simply a very bad idea. Increasing is unnecessary
and buggy, and decreasing can go negative.

Fixes: 6578171a7f ("bpf: add bpf_skb_change_proto helper")
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Dongseok Yi <dseok.yi@samsung.com>
Cc: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/CANP3RGfjLikQ6dg=YpBU0OeHvyv7JOki7CyOUS9modaXAi-9vQ@mail.gmail.com
Link: https://lore.kernel.org/bpf/20210617000953.2787453-2-zenczykowski@gmail.com

(cherry picked from commit 364745fbe981a4370f50274475da4675661104df https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=364745fbe981a4370f50274475da4675661104df )
Test: builds, TreeHugger
Bug: 188690383
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0ef3174cbd3caaa42d5779334a9c0bfdc9ab81f5
(cherry picked from commit ea53c24cb060b6aae8c7c60ba46f9cd7530419aa)
2021-06-29 00:42:36 +00:00
Bram Bonné
6f8540b744 ANDROID: selinux: modify RTM_GETNEIGH{TBL}
Map the permission gating RTM_GETNEIGH/RTM_GETNEIGHTBL messages to a
new permission so that it can be distinguished from the other netlink
route permissions in selinux policy. The new permission is triggered by
a flag set in system images T and up.

This change is intended to be backported to all kernels that a T system
image can run on top of.

Bug: 171572148
Test: atest NetworkInterfaceTest
Test: atest CtsSelinuxTargetSdkCurrentTestCases
Test: atest bionic-unit-tests-static
Test: On Cuttlefish, run combinations of:
    - Policy bit set or omitted (see https://r.android.com/1701847)
    - This patch applied or omitted
    - App having nlmsg_readneigh permission or not
  Verify that only the combination of this patch + the policy bit being
  set + the app not having the nlmsg_readneigh permission prevents the
  app from sending RTM_GETNEIGH messages.

Change-Id: I4bcfce4decb34ea9388eeedfc4be67403de8a980
Signed-off-by: Bram Bonné <brambonne@google.com>
(cherry picked from commit fac07550bdac9adea0dbe3edbdbec7a9a690a178)
2021-06-21 08:31:02 +00:00
Kiwoong Kim
e399f16519 ANDROID: GKI: add ufshcd_config_pwr_mode
Sometimes, ufs host exits from hibern8 with low speed
even if it start with high speed. In the case, a module
needs to call ufshcd_config_pwr_mode to sustain
IO performance.

Bug: 188122907
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Change-Id: I5e2cdcd5f36b7328f3543ba3225b95733f12bd0d
2021-06-18 08:09:03 +00:00
wangting11
0a5d2ddf23 ANDROID: GKI: update symbol list for xiaomi
Update the android/abi_gki_aarch64_xiaomi with recent symbol additions.
No new symbol addition.

Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

Bug: 190458832

Signed-off-by: wangting11 <wangting11@xiaomi.com>
Change-Id: I406585d9b0761bba7ca7bb6ab1ab3d3bb07051fc
Signed-off-by: wangting11 <wangting11@xiaomi.com>
2021-06-09 12:51:27 +00:00
longzuming
6b6b8dc6fb ANDROID: GKI: Update abi_gki_aarch64_oplus
Leaf changes summary: 1 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:
  [A] 'void spi_set_cs_timing(struct spi_device *spi, u8 setup, u8 hold,
                              u8 inactive_dly)'

Bug: 190457773
Signed-off-by: zuming.long <longzuming@realme.com>
Change-Id: Ic8ebbdd8a794ca38982e74ee7d01bbf6b1ba2eb4
2021-06-09 15:19:33 +08:00
hajun.sung
7d99cf8c84 ANDROID: GKI: Update abi_gki_aarch64_exynos
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 char* stpcpy(char* restrict, const char* restrict)'

Bug: 188891888

Signed-off-by: hajun.sung <hajun.sung@samsung.com>
Change-Id: Ibac4b0eb23cbe3a40577e6b64c66b0825242aedb
2021-05-28 20:54:43 +09:00
Will McVicker
5f273643fc UPSTREAM: HID: make arrays usage and value to be the same
commit ed9be64eefe26d7d8b0b5b9fa3ffdf425d87a01f upstream.

The HID subsystem allows an "HID report field" to have a different
number of "values" and "usages" when it is allocated. When a field
struct is created, the size of the usage array is guaranteed to be at
least as large as the values array, but it may be larger. This leads to
a potential out-of-bounds write in
__hidinput_change_resolution_multipliers() and an out-of-bounds read in
hidinput_count_leds().

To fix this, let's make sure that both the usage and value arrays are
the same size.

Cc: stable@vger.kernel.org
Signed-off-by: Will McVicker <willmcvicker@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I8a366703040f9701191a39f5bcb06829312b33c5
2021-05-27 16:33:52 -07:00
Alessio Balsini
82038e31f3 ANDROID: FUSE OWNERS pointing to android-mainline OWNERS
This was generated with:
  $ build/synchronize_owners common-mainline/ android-mainline \
      common11-5.4 common12-5.10 common12-5.4 common-4.19-stable

Test: none
Bug: 188034287
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: Iaf020cae75ab47aa12e64bfdfbc8d76efd74880b
2021-05-14 11:43:14 +00:00
John Stultz
1c75846438 ANDROID: abi_gki_aarch64_db845c: Regenerate symbols list after enabling QCOM_TSENSE
After enabling QCOM_TSENSE to avoid thermal crashes, we need
to add some symbols to the symbol list.

Generated with:
  BUILD_CONFIG=common/build.config.db845c build/build_abi.sh -s
  BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh -u

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 int thermal_zone_get_slope(thermal_zone_device*)'

Bug: 146449535
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ieea94a314c0f513bb8af447fe6673b2f40986748
2021-05-13 02:42:41 +00:00
John Stultz
c07e36bfc5 ANDROID: db845c_gki.fragment: Add QCOM_TSENSE config to avoid thermal crashes
This adds QCOM_TSENSE to the db845c_gki.fragment which is
needed to avoid hard crashes seen on db845c (which crash into
USB dump mode). This was causing some troube in our testing
as we'd occasionally see hard crashes in certian CTS tests
(also reproducible with a forkbomb).

After lots of debugging we've narrowed down this config as
the change which avoids the hard crashes.

Thanks to: Vinod Koul <vinod.koul@linaro.org> and
Bjorn Andersson <bjorn.andersson@linaro.org> for helping debug
this issue!

Bug: 146449535
Reported-by: YongQin Liu <yongqin.liu@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I0752c85e44028e6272c14b59fa09d2baf2e18feb
2021-05-11 21:25:10 +00:00
Lecopzer Chen
0821bcfb48 UPSTREAM: mm/cma.c: remove redundant cma_mutex lock
The cma_mutex which protects alloc_contig_range() was first appeared in
commit 7ee793a62f ("cma: Remove potential deadlock situation"), at that
time, there is no guarantee the behavior of concurrency inside
alloc_contig_range().

After commit 2c7452a075 ("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 <lecopzer.chen@mediatek.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: YJ Chiang <yj.chiang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit a4efc174b382fcdb62e2d90d39e78a274a975e38)
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Change-Id: I43755731ddb1a4ac9ac873a6e99c8c96d727ef77
2021-05-06 09:34:26 +00:00
jy.ser
2d5e3ef632 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 <jy.ser@samsung.com>
Change-Id: I97e00013450cea1d47a18b9a135e5e8cff707d2c
2021-05-06 06:02:16 +00:00
Lecopzer Chen
e3e60153a4 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 <jindong.yue@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20210224055825.7417-1-jindong.yue@nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

(cherry picked from commit 2bf2346159bc99cf0679e25be20f4daca60f3f5c)
Bug: 187234877
Reported-by: Joy-mi Huang <joy-mi.huang@mediatek.com>
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Change-Id: Icc7adeaf98f779fc46a979ff7e9f2ab5f963f636
2021-05-05 14:43:46 +00:00
dongjian
046c52c95b 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 <avri.altman@wdc.com>
Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0fdc7d5d8f3719950478cca452cf7f0f1355be10)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I010318ede5b79f8b0443b3acf72a8736640ae3f8
2021-05-04 15:19:30 -07:00
Masahiro Yamada
0475956802 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 <masahiroy@kernel.org>
(cherry picked from commit 12e9dea6c9766c7403417d00193940cea33ee81a)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I0781bd0198e4a3c8215830f4100ff1371e2d3e82
2021-05-04 15:19:30 -07:00
Dongseok Yi
24797c44c3 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 <dseok.yi@samsung.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Link: https://lore.kernel.org/r/1611962007-80092-1-git-send-email-dseok.yi@samsung.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit c3df39ac9b0e3747bf8233ea9ce4ed5ceb3199d3)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ib6159d86309fc5ade95c67abd7eab6880accd12b
2021-05-04 15:19:30 -07:00
Dongseok Yi
550b2c0dce 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 <dseok.yi@samsung.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/1610072918-174177-1-git-send-email-dseok.yi@samsung.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 53475c5dd856212e91538a9501162e821cc1f791)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ife87c4296ba12b39be4868b2c5e0ea6130f76d6d
2021-05-03 20:56:18 -07:00
Stanley Chu
e7e2f8329c 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 <chaotian.jing@mediatek.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 1d53864c3617f5235f891ca0fbe9347c4cd35d46)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I2c7738084d968fd3987d4876f04ea9c9b4318fb1
2021-05-03 20:56:09 -07:00
Stanley Chu
2e09274b7c 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 <beanhuo@micron.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bd14bf0e4a084514aa62d24d2109e0f09a93822f)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I994290c3824cac50828e097cdfb4a93e9dcfeb36
2021-05-03 20:56:01 -07:00
Takashi Iwai
b55ed54016 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: <stable@vger.kernel.org>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20201208190326.27531-1-tiwai@suse.de
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 66482f640755b31cb94371ff6cef17400cda6db5)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: If1c0eb2511292b430eb275e72f7e4ccf55b4f96b
2021-05-03 20:55:52 -07:00
Hyeongseok Kim
d9d13f4b76 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 <hyeongseok@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 89ff6005039a878afac87889fee748fa3f957c3a)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ib29e84c8e77e710fd2f9649a56750d33fd620fba
2021-05-03 20:55:42 -07:00
Vincent Guittot
be192b51bf 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 <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
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 <connoro@google.com>
Change-Id: Icaba6ae29d5bd23f87ca5492b778869be9e0d9c9
2021-05-03 20:55:31 -07:00
Qinglang Miao
3f54d632a6 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 <Avri.Altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2e6f11a797a24d1e2141a214a6dd6dfbe709f55d)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I2db2a6c6fb22b1e780ec7e167940d7104aaae267
2021-05-03 20:55:21 -07:00
Dmitry Safonov
e6d3c97bac 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 <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit dbd7ae5154d5fff7e84a9f3010bb06499017ef29)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I11e05ca491155a1dd28f8820ded7ada096595075
2021-05-03 20:55:11 -07:00
Dmitry Safonov
957e971ed9 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 <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit d1949d045fd67eab8a32a579a8c1ab1681330854)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ic81e020da215c3fd093a76dc687abf5f86827283
2021-05-03 20:55:02 -07:00
Dmitry Safonov
ee97d20c7e 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 <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit ad37f77fd3659e87fd9833a83692e0e4eba0f5cd)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Icefe6cd5ed03975f0f87cc1b126cfe55b36c35e5
2021-05-03 20:54:51 -07:00
Pujin Shi
a9cedd3032 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 <ebiggers@google.com>
Signed-off-by: Pujin Shi <shipujin.t@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6500251e590657066a227dce897a0392f302af24)
[drop non-applicable change to ufshcd_crypto_keyslot_program]
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I06c4eacc036cc5e9d80217a986cfe9427fb6e255
2021-05-03 20:54:41 -07:00
Yu Kuai
dee5558ec9 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 <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 48f486e13ffdb49fbb9b38c21d0e108ed60ab1a2)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: If018bce68d0d23491f1c47299443f7011dce3e89
2021-05-03 20:54:32 -07:00
Alexander Lobakin
7db1c96c2d 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 <alobakin@pm.me>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
(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 <connoro@google.com>
Change-Id: I20b389538ac02fc63cf8fa59dfb9010296237056
2021-05-03 20:54:20 -07:00
Wei Yongjun
305c5f5486 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 <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200422020154.112088-1-weiyongjun1@huawei.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 0379861217dc2dd46e3bc517010060065b0dd6fc)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I16c7f59f3e695ac6a6ffaa25217e3d7309827dca
2021-05-03 20:54:04 -07:00
Masahiro Yamada
48ffcbf0b9 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 67424f61f8 ("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 <eberman@codeaurora.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

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 <quic_eberman@quicinc.com>
2021-04-28 12:57:52 -07:00
Giuliano Procida
c8cd528e75 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 <vkakani@qualcomm.corp-partner.google.com>
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-04-26 09:39:26 +01:00
Giuliano Procida
ff320df3e0 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 <vkakani@qualcomm.corp-partner.google.com>
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-04-26 08:35:37 +01:00
Jilai Wang
dd2e0a80f1 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 <jilaiw@codeaurora.org>
2021-04-23 17:13:15 -04:00
Paul Lawrence
fad2655cb7 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 <paullawrence@google.com>
Change-Id: I6058ddad9d43ba01b2eabd7d3c576f2cc9b42292
2021-04-22 22:34:21 +00:00
Paul Lawrence
a035201d12 Revert "ANDROID: Incremental fs: Fix memory leak on closing file"
This reverts commit 152fd8f044.
Reason for revert: rolling the three fixes into one with feature flag
Bug: 174692664
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I9a2e6faa0c2293b691efca8e985390fd94bcf01a
2021-04-22 22:34:14 +00:00
Paul Lawrence
dbee4e7bc4 Revert "ANDROID: Incremental fs: Set credentials before reading/writing"
This reverts commit 28688d32ed.

Reason for revert: rolling the three fixes into one with feature flag
Bug: 174692664
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I85cb75b7acb5606659698a6d0e0918ffb731009d
2021-04-22 22:34:05 +00:00
Paul Lawrence
b6221e3495 Revert "ANDROID: Incremental fs: Fix selinux issues"
This reverts commit 75c93eb439.

Reason for revert: rolling the three fixes into one with feature flag
Bug: 174692664
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I838bed85d6682aba44165a58c22e6a0e10c49d58
2021-04-22 22:33:56 +00:00
Mukesh Ojha
0ade8c4105 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 <mojha@codeaurora.org>
2021-04-22 18:30:58 +00:00
Howard Chen
ccdcd307cf 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 <howardsoc@google.com>
2021-04-22 11:30:41 +08:00
Jindong Yue
b3f4130630 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 <jindong.yue@nxp.com>
Change-Id: I04c696219cdfead30a00201000251bd989814ec5
2021-04-21 10:37:50 +08:00
Nick Desaulniers
67e9dbddb5 ANDROID: clang: update to 12.0.5
Bug: 185804542
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: If3d0c122472d8979b326d8a6fece30d8b2af962a
2021-04-19 19:41:50 +00:00
A. Cody Schuffelen
91d8a13f43 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 <schuffelen@google.com>
Link: https://lore.kernel.org/r/20210318200419.1421034-1-schuffelen@google.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit b57aa17f07c9270e576ef7df09f142978b5a75f0
https: //git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master)
Change-Id: Icafc24ad303357926cbe955ffa12e28e0bf31e6f
2021-04-12 20:35:25 -07:00
Matthias Maennich
8aa2c72ddf ANDROID: android/OWNERS: drop gki-abi-approvers@
Group support is not implemented and this rather disturbes downstream
merges. So, drop them.

Fixes: 2fa0951b66b3 ("ANDROID: Initial Android 12 OWNERS for abi metafiles")
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I7d1462ff87b05eb678b1c97f5e0b89b97d4e91a5
2021-04-07 10:22:34 +01:00