Commit Graph

1149556 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
f79a11f8bc ANDROID: GKI: sched.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
pointer to struct signal_struct, struct sched_entity, struct
sched_rt_entity, and struct task_struct.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 3 leaf types 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

'struct sched_entity at sched.h:444:1' changed:
  type size changed from 3584 to 4096 (in bits)
  4 data member insertions:
    'u64 sched_entity::android_kabi_reserved1', at offset 3584 (in bits) at sched.h:481:1
    'u64 sched_entity::android_kabi_reserved2', at offset 3648 (in bits) at sched.h:482:1
    'u64 sched_entity::android_kabi_reserved3', at offset 3712 (in bits) at sched.h:483:1
    'u64 sched_entity::android_kabi_reserved4', at offset 3776 (in bits) at sched.h:484:1
  1435 impacted interfaces:

'struct sched_rt_entity at sched.h:481:1' changed:
  type size changed from 384 to 640 (in bits)
  4 data member insertions:
    'u64 sched_rt_entity::android_kabi_reserved1', at offset 384 (in bits) at sched.h:504:1
    'u64 sched_rt_entity::android_kabi_reserved2', at offset 448 (in bits) at sched.h:505:1
    'u64 sched_rt_entity::android_kabi_reserved3', at offset 512 (in bits) at sched.h:506:1
    'u64 sched_rt_entity::android_kabi_reserved4', at offset 576 (in bits) at sched.h:507:1
  1435 impacted interfaces:

'struct task_struct at sched.h:624:1' changed:
  type size changed from 28672 to 30208 (in bits)
  8 data member insertions:
    'u64 task_struct::android_kabi_reserved1', at offset 20992 (in bits) at sched.h:1294:1
    'u64 task_struct::android_kabi_reserved2', at offset 21056 (in bits) at sched.h:1295:1
    'u64 task_struct::android_kabi_reserved3', at offset 21120 (in bits) at sched.h:1296:1
    'u64 task_struct::android_kabi_reserved4', at offset 21184 (in bits) at sched.h:1297:1
    'u64 task_struct::android_kabi_reserved5', at offset 21248 (in bits) at sched.h:1298:1
    'u64 task_struct::android_kabi_reserved6', at offset 21312 (in bits) at sched.h:1299:1
    'u64 task_struct::android_kabi_reserved7', at offset 21376 (in bits) at sched.h:1300:1
    'u64 task_struct::android_kabi_reserved8', at offset 21440 (in bits) at sched.h:1301:1
  there are data member changes:
  1435 impacted interfaces:

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1449735b836399e9b356608727092334daf5c36b
2023-06-07 14:24:55 +00:00
Greg Kroah-Hartman
801c9e6233 ANDROID: GKI: module.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct module.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 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

'struct module at module.h:348:1' changed:
  type size hasn't changed
  4 data member insertions:
    'u64 module::android_kabi_reserved1', at offset 6720 (in bits) at module.h:518:1
    'u64 module::android_kabi_reserved2', at offset 6784 (in bits) at module.h:519:1
    'u64 module::android_kabi_reserved3', at offset 6848 (in bits) at module.h:520:1
    'u64 module::android_kabi_reserved4', at offset 6912 (in bits) at module.h:521:1

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2a764e9eac88f20e50d192112235da6d2f0f83bc
2023-06-07 14:24:55 +00:00
Greg Kroah-Hartman
15e9bd7cf2 ANDROID: GKI: sock.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct sock.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 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

'struct sock at sock.h:324:1' changed:
  type size changed from 6016 to 6528 (in bits)
  8 data member insertions:
    'u64 sock::android_kabi_reserved1', at offset 6016 (in bits) at sock.h:516:1
    'u64 sock::android_kabi_reserved2', at offset 6080 (in bits) at sock.h:517:1
    'u64 sock::android_kabi_reserved3', at offset 6144 (in bits) at sock.h:518:1
    'u64 sock::android_kabi_reserved4', at offset 6208 (in bits) at sock.h:519:1
    'u64 sock::android_kabi_reserved5', at offset 6272 (in bits) at sock.h:520:1
    'u64 sock::android_kabi_reserved6', at offset 6336 (in bits) at sock.h:521:1
    'u64 sock::android_kabi_reserved7', at offset 6400 (in bits) at sock.h:522:1
    'u64 sock::android_kabi_reserved8', at offset 6464 (in bits) at sock.h:523:1

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I61c3d6cf12c087345db71fc6d93ee6bd58969003
2023-06-07 14:24:55 +00:00
Greg Kroah-Hartman
41afe8d0bf ANDROID: GKI: sched: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding
padding to a number of core internal scheduler structures.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0ef2f8dd5f3259dcf443c5045aa1e8505ed78a76
2023-06-07 14:24:55 +00:00
Greg Kroah-Hartman
c425034c95 ANDROID: GKI: mount.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct vfsmount.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 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

'struct vfsmount at mount.h:68:1' changed:
  type size changed from 256 to 512 (in bits)
  4 data member insertions:
    'u64 vfsmount::android_kabi_reserved1', at offset 192 (in bits) at mount.h:73:1
    'u64 vfsmount::android_kabi_reserved2', at offset 256 (in bits) at mount.h:74:1
    'u64 vfsmount::android_kabi_reserved3', at offset 320 (in bits) at mount.h:75:1
    'u64 vfsmount::android_kabi_reserved4', at offset 384 (in bits) at mount.h:76:1
  there are data member changes:
    'void* vfsmount::data' offset changed from 192 to 448 (in bits) (by +256 bits)
  8 impacted interfaces:
    function vfsmount* mntget(vfsmount*)
    function int notify_change2(vfsmount*, dentry*, iattr*, inode**)
    function int vfs_create2(vfsmount*, inode*, dentry*, umode_t, bool)
    function int vfs_mkdir2(vfsmount*, inode*, dentry*, umode_t)
    function int vfs_path_lookup(dentry*, vfsmount*, const char*, unsigned int, path*)
    function int vfs_rename2(vfsmount*, inode*, dentry*, inode*, dentry*, inode**, unsigned int)
    function int vfs_rmdir2(vfsmount*, inode*, dentry*)
    function int vfs_unlink2(vfsmount*, inode*, dentry*, inode**)

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9ce1b63f05c90af168eeea1312ac88d3cc5cfdf3
2023-06-07 14:24:55 +00:00
Greg Kroah-Hartman
1276e53f17 ANDROID: GKI: mm: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to stuct vm_area_struct and struct zone.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 3 leaf types 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

'struct vm_area_struct at mm_types.h:292:1' changed:
  type size changed from 1472 to 1728 (in bits)
  4 data member insertions:
    'u64 vm_area_struct::android_kabi_reserved1', at offset 1472 (in bits) at mm_types.h:365:1
    'u64 vm_area_struct::android_kabi_reserved2', at offset 1536 (in bits) at mm_types.h:366:1
    'u64 vm_area_struct::android_kabi_reserved3', at offset 1600 (in bits) at mm_types.h:367:1
    'u64 vm_area_struct::android_kabi_reserved4', at offset 1664 (in bits) at mm_types.h:368:1
  1435 impacted interfaces:

'struct zone at mmzone.h:420:1' changed:
  type size changed from 12800 to 13312 (in bits)
  4 data member insertions:
    'u64 zone::android_kabi_reserved1', at offset 12672 (in bits) at mmzone.h:569:1
    'u64 zone::android_kabi_reserved2', at offset 12736 (in bits) at mmzone.h:570:1
    'u64 zone::android_kabi_reserved3', at offset 12800 (in bits) at mmzone.h:571:1
    'u64 zone::android_kabi_reserved4', at offset 12864 (in bits) at mmzone.h:572:1
  624 impacted interfaces:

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I81702aa833f419928e0e32e9609722b98592c171
2023-06-07 14:24:54 +00:00
Saravana Kannan
d58a77ead7 ANDROID: GKI: add some padding to some driver core structures
These structures are fundamental to implementing fw_devlink and
sync_state(). Since they are still evolving, add some padding in case we
need to backport any important bug fixes.

	struct device_link
	struct class
	struct fwnode_handle
	struct fwnode_link

Bug: 183615740
Signed-off-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id9daf7cf9ae5d94fb0134144f8220a241ccbaef8
2023-06-07 14:24:54 +00:00
Greg Kroah-Hartman
854f9f2e6c ANDROID: GKI: add padding to struct HID structures
HID structures were not being tracked as a "stable" symbol in the past,
but that looks to change with some future abi requirements.  So add
needed padding now, to ensure that we can support this over the
long-term.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8c3064fb7a19006a29dabbaf25c9ed1737f62e75
2023-06-07 14:24:54 +00:00
Greg Kroah-Hartman
bf55b78067 ANDROID: GKI: USB: XHCI: add Android ABI padding to lots of xhci structures
Given that the xhci driver seems to be one of the more "modified" by
vendors, and that the xhci core is going to be built into the kernel in
the GKI 2 Android kernel, the xhci "platform" api is now a stable
boundry.

Try to handle any future changes in this api by adding some kabi padding
fields to allow for room to grow and change over the next 5+ years as
needed.

Bug: 151154716
Bug: 182336717
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I55c8cad8c8c51330fc2d72df41a1f04229a22e98
2023-06-07 14:24:54 +00:00
Greg Kroah-Hartman
807752459e ANDROID: GKI: dwc3: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding
padding to a number of dwc3 structures.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1826d885e3acf1f378d0e30b1ca2ddc56b16a9e4
2023-06-07 14:24:54 +00:00
Greg Kroah-Hartman
faf9904e25 ANDROID: GKI: sound/usb/card.h: add Android ABI padding to struct snd_usb_endpoint
There seems to be lots of people wanting to change this structure, and
while it feels internal, due to some SoC patches, there's an ABI that
needs to be preserved here over time.

So add some padding to struct snd_usb_endpoint so that we can maintain
this succesfully in the future.

Of course, now that the padding is there, there never will be any need
to change this structure again...

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I21cb3abbdca2961e33a94b2bc48b49f3fadbd206
2023-06-07 14:24:54 +00:00
Greg Kroah-Hartman
cb27de5e20 ANDROID: GKI: user_namespace.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct user_namespace.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2c41281b191cd252db2ddc792699d869ce8d7a4d
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
ad192a1c1c ANDROID: GKI: quota.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct quota_format_ops, struct dquot_operations, and struct
quotactl_ops.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia957d2f8d9b1a6939cddedc16a7481e9de1a8866
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
7be2a2a4c3 ANDROID: GKI: mmu_notifier.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct mmu_notifier_ops and struct mmu_notifier.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If631445abf20c22830a1c764ff2ccd662a7bd204
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
4298070a54 ANDROID: GKI: mm.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct vm_operations_struct.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I78f84148ef4d3524bd6c5b78e53e06503a4ac3ae
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
ec2d1e2e62 ANDROID: GKI: kobject.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct kobject, struct kobj_type, and struct kset.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3c28826dc314c7f1b5c9bb167be82089d53768bb
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
e69be4de29 ANDROID: GKI: kernfs.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct kernfs_syscall_ops and struct kernfs_ops.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1fcb0b81c3ea7d5300da283b275391f95d6d4ec8
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
2baf3e23bb ANDROID: GKI: irqdomain.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct irq_domain.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8ff0c2162ca5f7f0b6c7a51bf341c6b1b1c856e8
2023-06-07 14:24:53 +00:00
Greg Kroah-Hartman
064d2c58f2 ANDROID: GKI: ioport.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct resource.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5ff4401c540be7d095f1db27370281b7220af030
2023-06-07 14:24:52 +00:00
Greg Kroah-Hartman
d1cd3e8b1b ANDROID: GKI: iomap.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct iomap_ops.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1803d5163f7a1d0320f567b983a8241777284c5e
2023-06-07 14:24:52 +00:00
Greg Kroah-Hartman
c2c04df929 ANDROID: GKI: hrtimer.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct hrtimer.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5432e05386265281d993199599c6f9dcd17a9daf
2023-06-07 14:24:52 +00:00
Greg Kroah-Hartman
caf18df2e2 ANDROID: GKI: genhd.h: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct blk_integrity, and struct gendisk.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5d19bf942fbedc64f705f5d27ae629c57209df27
2023-06-07 14:24:52 +00:00
Greg Kroah-Hartman
0205308795 ANDROID: GKI: ethtool.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct ethtool_ops.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If9f449cb74e81d048a1c41b33c6b7c5b564ecaf3
2023-06-07 14:24:52 +00:00
Greg Kroah-Hartman
e319ef95b6 ANDROID: GKI: dma-mapping.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct dma_map_ops.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icbec584dee3716f341a7831a4810025f690eab4a
2023-06-07 14:24:52 +00:00
Greg Kroah-Hartman
608ed5cfb3 ANDROID: GKI: networking: add Android ABI padding to a lot of networking structures
Try to mitigate potential future driver core api changes by adding a
padding to a lot of different networking structures:
	struct ipv6_devconf
	struct proto_ops
	struct header_ops
	struct napi_struct
	struct netdev_queue
	struct netdev_rx_queue
	struct xfrmdev_ops
	struct net_device_ops
	struct net_device
	struct packet_type
	struct sk_buff
	struct tlsdev_ops

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I590f004754dbc8beafa40e71cac70a0938c38b4a
2023-06-07 14:24:51 +00:00
Greg Kroah-Hartman
8d09c29ee1 ANDROID: GKI: blk_types.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct bio.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib69c7bb8b553cacb9cb7bc020d8ac2bbc75621ba
2023-06-07 14:24:51 +00:00
Greg Kroah-Hartman
e7a017ab91 ANDROID: GKI: scsi.h: add Android ABI padding to a structure
Try to mitigate potential future driver core api changes by adding a
padding to struct scsi_disk.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1191c786cb341df43a40fa1a82789759b0f431cf
2023-06-07 14:24:51 +00:00
Greg Kroah-Hartman
48da4dd64b ANDROID: GKI: pci: add Android ABI padding to some structures
Try to mitigate potential future driver core api changes by adding a
padding to struct pci_sriov, struct pci_dev, struct pci_bus, and struct
pci_driver.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I236df60165b25a33b06fc81f76014162401ba742
2023-06-07 14:24:51 +00:00
Greg Kroah-Hartman
eba9ceccd8 ANDROID: GKI: add Android ABI padding to struct nf_conn
Try to mitigate potential future driver core api changes by adding
padding to struct nf_conn;

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib18a9a929d351c66556f1f27b217cbf22b733a10
2023-06-07 14:24:51 +00:00
Greg Kroah-Hartman
97752aa71c ANDROID: GKI: add kabi padding for structures for the android14 release
There are a lot of different structures that need to have a "frozen" abi
for the next 5+ years.  Add padding to a lot of them in order to be able
to handle any future changes that might be needed due to LTS and
security fixes that might come up.

It's a best guess, based on what has happened in the past from the
5.10.0..5.10.110 release (1 1/2 years).  Yes, past changes do not mean
that future changes will also be needed in the same area, but that is a
hint that those areas are both well maintained and looked after, and
there have been previous problems found in them.

Also the list of structures that are being required based on OEM usage
in the android/ symbol lists were consulted as that's a larger list than
what has been changed in the past.

Hopefully we caught everything we need to worry about, only time will
tell...

Bug: 151154716
Change-Id: I880bbcda0628a7459988eeb49d18655522697664
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-07 14:24:51 +00:00
Nicolas Dichtel
1d39b94f8c UPSTREAM: ipv{4,6}/raw: fix output xfrm lookup wrt protocol
With a raw socket bound to IPPROTO_RAW (ie with hdrincl enabled), the
protocol field of the flow structure, build by raw_sendmsg() /
rawv6_sendmsg()),  is set to IPPROTO_RAW. This breaks the ipsec policy
lookup when some policies are defined with a protocol in the selector.

For ipv6, the sin6_port field from 'struct sockaddr_in6' could be used to
specify the protocol. Just accept all values for IPPROTO_RAW socket.

For ipv4, the sin_port field of 'struct sockaddr_in' could not be used
without breaking backward compatibility (the value of this field was never
checked). Let's add a new kind of control message, so that the userland
could specify which protocol is used.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
CC: stable@vger.kernel.org
Change-Id: I168bca9e37561b255268414e2fdfac18cd08381c
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20230522120820.1319391-1-nicolas.dichtel@6wind.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 3632679d9e)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-07 14:24:50 +00:00
Jakub Sitnicki
9713594a2b UPSTREAM: inet: Add IP_LOCAL_PORT_RANGE socket option
Users who want to share a single public IP address for outgoing connections
between several hosts traditionally reach for SNAT. However, SNAT requires
state keeping on the node(s) performing the NAT.

A stateless alternative exists, where a single IP address used for egress
can be shared between several hosts by partitioning the available ephemeral
port range. In such a setup:

1. Each host gets assigned a disjoint range of ephemeral ports.
2. Applications open connections from the host-assigned port range.
3. Return traffic gets routed to the host based on both, the destination IP
   and the destination port.

An application which wants to open an outgoing connection (connect) from a
given port range today can choose between two solutions:

1. Manually pick the source port by bind()'ing to it before connect()'ing
   the socket.

   This approach has a couple of downsides:

   a) Search for a free port has to be implemented in the user-space. If
      the chosen 4-tuple happens to be busy, the application needs to retry
      from a different local port number.

      Detecting if 4-tuple is busy can be either easy (TCP) or hard
      (UDP). In TCP case, the application simply has to check if connect()
      returned an error (EADDRNOTAVAIL). That is assuming that the local
      port sharing was enabled (REUSEADDR) by all the sockets.

        # Assume desired local port range is 60_000-60_511
        s = socket(AF_INET, SOCK_STREAM)
        s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
        s.bind(("192.0.2.1", 60_000))
        s.connect(("1.1.1.1", 53))
        # Fails only if 192.0.2.1:60000 -> 1.1.1.1:53 is busy
        # Application must retry with another local port

      In case of UDP, the network stack allows binding more than one socket
      to the same 4-tuple, when local port sharing is enabled
      (REUSEADDR). Hence detecting the conflict is much harder and involves
      querying sock_diag and toggling the REUSEADDR flag [1].

   b) For TCP, bind()-ing to a port within the ephemeral port range means
      that no connecting sockets, that is those which leave it to the
      network stack to find a free local port at connect() time, can use
      the this port.

      IOW, the bind hash bucket tb->fastreuse will be 0 or 1, and the port
      will be skipped during the free port search at connect() time.

2. Isolate the app in a dedicated netns and use the use the per-netns
   ip_local_port_range sysctl to adjust the ephemeral port range bounds.

   The per-netns setting affects all sockets, so this approach can be used
   only if:

   - there is just one egress IP address, or
   - the desired egress port range is the same for all egress IP addresses
     used by the application.

   For TCP, this approach avoids the downsides of (1). Free port search and
   4-tuple conflict detection is done by the network stack:

     system("sysctl -w net.ipv4.ip_local_port_range='60000 60511'")

     s = socket(AF_INET, SOCK_STREAM)
     s.setsockopt(SOL_IP, IP_BIND_ADDRESS_NO_PORT, 1)
     s.bind(("192.0.2.1", 0))
     s.connect(("1.1.1.1", 53))
     # Fails if all 4-tuples 192.0.2.1:60000-60511 -> 1.1.1.1:53 are busy

  For UDP this approach has limited applicability. Setting the
  IP_BIND_ADDRESS_NO_PORT socket option does not result in local source
  port being shared with other connected UDP sockets.

  Hence relying on the network stack to find a free source port, limits the
  number of outgoing UDP flows from a single IP address down to the number
  of available ephemeral ports.

To put it another way, partitioning the ephemeral port range between hosts
using the existing Linux networking API is cumbersome.

To address this use case, add a new socket option at the SOL_IP level,
named IP_LOCAL_PORT_RANGE. The new option can be used to clamp down the
ephemeral port range for each socket individually.

The option can be used only to narrow down the per-netns local port
range. If the per-socket range lies outside of the per-netns range, the
latter takes precedence.

UAPI-wise, the low and high range bounds are passed to the kernel as a pair
of u16 values in host byte order packed into a u32. This avoids pointer
passing.

  PORT_LO = 40_000
  PORT_HI = 40_511

  s = socket(AF_INET, SOCK_STREAM)
  v = struct.pack("I", PORT_HI << 16 | PORT_LO)
  s.setsockopt(SOL_IP, IP_LOCAL_PORT_RANGE, v)
  s.bind(("127.0.0.1", 0))
  s.getsockname()
  # Local address between ("127.0.0.1", 40_000) and ("127.0.0.1", 40_511),
  # if there is a free port. EADDRINUSE otherwise.

[1] https://github.com/cloudflare/cloudflare-blog/blob/232b432c1d57/2022-02-connectx/connectx.py#L116

Reviewed-by: Marek Majkowski <marek@cloudflare.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Change-Id: I06e1860472cd2f90bf030076be0c87b9b775a3df
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 91d0b78c51)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-07 14:24:50 +00:00
Qais Yousef
5376c2a57f UPSTREAM: sched/fair: Fixes for capacity inversion detection
commit: da07d2f9c1 upstream.

Traversing the Perf Domains requires rcu_read_lock() to be held and is
conditional on sched_energy_enabled(). Ensure right protections applied.

Also skip capacity inversion detection for our own pd; which was an
error.

Fixes: 44c7b80bff ("sched/fair: Detect capacity inversion")
Reported-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Change-Id: I1c81232e94a38a68e39cf73f8893f185e268928d
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230112122708.330667-3-qyousef@layalina.io
(cherry picked from commit da07d2f9c1)
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d362a03d92)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-07 14:24:50 +00:00
Qais Yousef
7c8500869b UPSTREAM: sched/fair: Consider capacity inversion in util_fits_cpu()
commit: aa69c36f31 upstream.

We do consider thermal pressure in util_fits_cpu() for uclamp_min only.
With the exception of the biggest cores which by definition are the max
performance point of the system and all tasks by definition should fit.

Even under thermal pressure, the capacity of the biggest CPU is the
highest in the system and should still fit every task. Except when it
reaches capacity inversion point, then this is no longer true.

We can handle this by using the inverted capacity as capacity_orig in
util_fits_cpu(). Which not only addresses the problem above, but also
ensure uclamp_max now considers the inverted capacity. Force fitting
a task when a CPU is in this adverse state will contribute to making the
thermal throttling last longer.

Change-Id: I3c1a4758eb387c5c8e0ba68751840517fff4ae64
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220804143609.515789-10-qais.yousef@arm.com
(cherry picked from commit aa69c36f31)
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 799c7301de)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-07 14:24:50 +00:00
Qais Yousef
b9346f206f UPSTREAM: sched/fair: Detect capacity inversion
commit: 44c7b80bff upstream.

Check each performance domain to see if thermal pressure is causing its
capacity to be lower than another performance domain.

We assume that each performance domain has CPUs with the same
capacities, which is similar to an assumption made in energy_model.c

We also assume that thermal pressure impacts all CPUs in a performance
domain equally.

If there're multiple performance domains with the same capacity_orig, we
will trigger a capacity inversion if the domain is under thermal
pressure.

The new cpu_in_capacity_inversion() should help users to know when
information about capacity_orig are not reliable and can opt in to use
the inverted capacity as the 'actual' capacity_orig.

Change-Id: I23a98594e6b24697eb33d9bbfb8dd46a12bfa050
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220804143609.515789-9-qais.yousef@arm.com
(cherry picked from commit 44c7b80bff)
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fe1c982958)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-07 14:24:50 +00:00
Quentin Perret
8691a0dae0 ANDROID: KVM: arm64: Initialize hfgwtr_el2 correctly
With FEAT_FGT, most bits in hfgwtr_el2 must be set to 1 to enable
trapping of MSR writes of certain registers. However, there is a
notable (and arguably curious) exception for nSMPRI_EL1 and
nTPIDR2_EL0 which must be set to 1 to _disable_ trapping of the
corresponding SME registers.

Make sure to initialize hfgwtr_el2 in the pKVM init params accordingly
to avoid accidentally enabling certain traps on hardware that supports
FEAT_FGT and FEAT_SME.

Bug: 282917063
Bug: 282993310
Change-Id: Ia96fa6856b4e7ef98b3cea4f03fcbc0ee03f10c5
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
2023-06-07 12:48:49 +00:00
Tudor Ambarus
fd04f99bfa UPSTREAM: net: cdc_ncm: Deal with too low values of dwNtbOutMaxSize
commit 7e01c7f704 upstream.

Currently in cdc_ncm_check_tx_max(), if dwNtbOutMaxSize is lower than
the calculated "min" value, but greater than zero, the logic sets
tx_max to dwNtbOutMaxSize. This is then used to allocate a new SKB in
cdc_ncm_fill_tx_frame() where all the data is handled.

For small values of dwNtbOutMaxSize the memory allocated during
alloc_skb(dwNtbOutMaxSize, GFP_ATOMIC) will have the same size, due to
how size is aligned at alloc time:
	size = SKB_DATA_ALIGN(size);
        size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
Thus we hit the same bug that we tried to squash with
commit 2be6d4d16a ("net: cdc_ncm: Allow for dwNtbOutMaxSize to be unset or zero")

Low values of dwNtbOutMaxSize do not cause an issue presently because at
alloc_skb() time more memory (512b) is allocated than required for the
SKB headers alone (320b), leaving some space (512b - 320b = 192b)
for CDC data (172b).

However, if more elements (for example 3 x u64 = [24b]) were added to
one of the SKB header structs, say 'struct skb_shared_info',
increasing its original size (320b [320b aligned]) to something larger
(344b [384b aligned]), then suddenly the CDC data (172b) no longer
fits in the spare SKB data area (512b - 384b = 128b).

Consequently the SKB bounds checking semantics fails and panics:

skbuff: skb_over_panic: text:ffffffff831f755b len:184 put:172 head:ffff88811f1c6c00 data:ffff88811f1c6c00 tail:0xb8 end:0x80 dev:<NULL>
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:113!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 57 Comm: kworker/0:2 Not tainted 5.15.106-syzkaller-00249-g19c0ed55a470 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Workqueue: mld mld_ifc_work
RIP: 0010:skb_panic net/core/skbuff.c:113 [inline]
RIP: 0010:skb_over_panic+0x14c/0x150 net/core/skbuff.c:118
[snip]
Call Trace:
 <TASK>
 skb_put+0x151/0x210 net/core/skbuff.c:2047
 skb_put_zero include/linux/skbuff.h:2422 [inline]
 cdc_ncm_ndp16 drivers/net/usb/cdc_ncm.c:1131 [inline]
 cdc_ncm_fill_tx_frame+0x11ab/0x3da0 drivers/net/usb/cdc_ncm.c:1308
 cdc_ncm_tx_fixup+0xa3/0x100

Deal with too low values of dwNtbOutMaxSize, clamp it in the range
[USB_CDC_NCM_NTB_MIN_OUT_SIZE, CDC_NCM_NTB_MAX_SIZE_TX]. We ensure
enough data space is allocated to handle CDC data by making sure
dwNtbOutMaxSize is not smaller than USB_CDC_NCM_NTB_MIN_OUT_SIZE.

Fixes: 289507d336 ("net: cdc_ncm: use sysfs for rx/tx aggregation tuning")
Cc: stable@vger.kernel.org
Reported-by: syzbot+9f575a1f15fc0c01ed69@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=b982f1059506db48409d
Link: https://lore.kernel.org/all/20211202143437.1411410-1-lee.jones@linaro.org/
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230517133808.1873695-2-tudor.ambarus@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 281604646
Bug: 281606231
Change-Id: Ic1d912e7bf2ba53620eb8293b68ec6046422e047
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2023-06-07 11:55:40 +00:00
Cixi Geng
70586aaa7c ANDROID: GKI: Add symbols and update symbol list for Unisoc(2nd)
16 function symbol(s) added
  'void __dynamic_netdev_dbg(struct _ddebug*, const struct net_device*, const char*, ...)'
  'int drm_of_component_probe(struct device*, int(*)(struct device*, void*), const struct component_master_ops*)'
  'int input_ff_create_memless(struct input_dev*, void*, int(*)(struct input_dev*, void*, struct ff_effect*))'
  'u64 ktime_get_boot_fast_ns()'
  'struct dma_chan* of_dma_simple_xlate(struct of_phandle_args*, struct of_dma*)'
  'struct nvmem_cell* of_nvmem_cell_get(struct device_node*, const char*)'
  'struct pinctrl_dev* pinctrl_register(struct pinctrl_desc*, struct device*, void*)'
  'void pinctrl_unregister(struct pinctrl_dev*)'
  'int pinctrl_utils_add_map_mux(struct pinctrl_dev*, struct pinctrl_map**, unsigned int*, unsigned int*, const char*, const char*)'
  'struct power_supply_battery_ocv_table* power_supply_find_ocv2cap_table(struct power_supply_battery_info*, int, int*)'
  'int power_supply_get_battery_info(struct power_supply*, struct power_supply_battery_info**)'
  'int power_supply_ocv2cap_simple(struct power_supply_battery_ocv_table*, int, int)'
  'void power_supply_put_battery_info(struct power_supply*, struct power_supply_battery_info*)'
  'int power_supply_temp2resist_simple(struct power_supply_resistance_temp_table*, int, int)'
  'struct regmap* syscon_regmap_lookup_by_phandle_args(struct device_node*, const char*, int, unsigned int*)'
  'void usb_phy_get_charger_current(struct usb_phy*, unsigned int*, unsigned int*)'

Bug: 282902304
Change-Id: Ibe065ba237b62f3c4222bb8070d13e9e99f90fa5
Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
2023-06-07 10:06:20 +00:00
Jaewon Kim
94e4512c31 ANDROID: ABI: update symbol list related to meminfo for galaxy
update symbol list related to meminfo for galaxy

3 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_meminfo_cache_adjust'
  'struct tracepoint __tracepoint_android_vh_si_mem_available_adjust'
  'struct tracepoint __tracepoint_android_vh_si_meminfo_adjust'

Bug: 283896254

Change-Id: Ia6081e553312781a37c5eae8b0f6751909fad4bf
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
2023-06-07 01:06:25 +00:00
Jaewon Kim
a390414140 ANDROID: vendor_hooks: add hooks for extra memory
Add vendor hooks for extra memory. If there is extra memory, this can
be accounted like other memory stats. One of the usecases could be
cleancache. If some of ram memory is used for cleancache, its free,
cache, and total size could be added through these vendor hooks.

Bug: 283896254

Change-Id: Iad7330310528581f09842f45860f05dc84823f41
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
2023-06-07 01:06:25 +00:00
Zhihao Cheng
c3ee18fefa BACKPORT: FROMLIST: ovl: get_acl: Fix null pointer dereference at realinode in rcu-walk mode
Following process:
         P1                     P2
 path_openat
  link_path_walk
   may_lookup
    inode_permission(rcu)
     ovl_permission
      acl_permission_check
       check_acl
        get_cached_acl_rcu
         ovl_get_inode_acl
          realinode = ovl_inode_real(ovl_inode)
                              drop_cache
                               __dentry_kill(ovl_dentry)
                                iput(ovl_inode)
                                 ovl_destroy_inode(ovl_inode)
                                  dput(oi->__upperdentry)
                                   dentry_kill(upperdentry)
                                    dentry_unlink_inode
                                     upperdentry->d_inode = NULL
            ovl_inode_upper
             upperdentry = ovl_i_dentry_upper(ovl_inode)
             d_inode(upperdentry) // returns NULL
          IS_POSIXACL(realinode) // NULL pointer dereference
, will trigger an null pointer dereference at realinode:
  [  205.472797] BUG: kernel NULL pointer dereference, address:
                 0000000000000028
  [  205.476701] CPU: 2 PID: 2713 Comm: ls Not tainted
                 6.3.0-12064-g2edfa098e750-dirty #1216
  [  205.478754] RIP: 0010:do_ovl_get_acl+0x5d/0x300
  [  205.489584] Call Trace:
  [  205.489812]  <TASK>
  [  205.490014]  ovl_get_inode_acl+0x26/0x30
  [  205.490466]  get_cached_acl_rcu+0x61/0xa0
  [  205.490908]  generic_permission+0x1bf/0x4e0
  [  205.491447]  ovl_permission+0x79/0x1b0
  [  205.491917]  inode_permission+0x15e/0x2c0
  [  205.492425]  link_path_walk+0x115/0x550
  [  205.493311]  path_lookupat.isra.0+0xb2/0x200
  [  205.493803]  filename_lookup+0xda/0x240
  [  205.495747]  vfs_fstatat+0x7b/0xb0

Fetch a reproducer in [Link].

Use the helper ovl_i_path_realinode() to get realinode and then do
non-nullptr checking.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217404
Fixes: 332f606b32 ("ovl: enable RCU'd ->get_acl()")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Suggested-by: Christian Brauner <brauner@kernel.org>
Suggested-by: Amir Goldstein <amir73il@gmail.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Bug: 285105314
Link: https://lore.kernel.org/linux-unionfs/20230516-topografie-gejubelt-dba162b6e735@brauner/T/
Change-Id: Ib1f5fcb707a3db43a497cf4ae663156c202d6849
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>
2023-06-07 00:40:32 +00:00
Zhihao Cheng
8d59a7676c BACKPORT: FROMLIST: ovl: ovl_permission: Fix null pointer dereference at realinode in rcu-walk mode
Following process:
          P1                     P2
  path_lookupat
   link_path_walk
    inode_permission
     ovl_permission
       ovl_i_path_real(inode, &realpath)
         path->dentry = ovl_i_dentry_upper(inode)
                           drop_cache
                            __dentry_kill(ovl_dentry)
                             iput(ovl_inode)
                              ovl_destroy_inode(ovl_inode)
                               dput(oi->__upperdentry)
                                dentry_kill(upperdentry)
                                 dentry_unlink_inode
                                  upperdentry->d_inode = NULL
       realinode = d_inode(realpath.dentry) // return NULL
       inode_permission(realinode)
        inode->i_sb  // NULL pointer dereference
 , will trigger an null pointer dereference at realinode:
   [  335.664979] BUG: kernel NULL pointer dereference,
                  address: 0000000000000002
   [  335.668032] CPU: 0 PID: 2592 Comm: ls Not tainted 6.3.0
   [  335.669956] RIP: 0010:inode_permission+0x33/0x2c0
   [  335.678939] Call Trace:
   [  335.679165]  <TASK>
   [  335.679371]  ovl_permission+0xde/0x320
   [  335.679723]  inode_permission+0x15e/0x2c0
   [  335.680090]  link_path_walk+0x115/0x550
   [  335.680771]  path_lookupat.isra.0+0xb2/0x200
   [  335.681170]  filename_lookup+0xda/0x240
   [  335.681922]  vfs_statx+0xa6/0x1f0
   [  335.682233]  vfs_fstatat+0x7b/0xb0

 Fetch a reproducer in [Link].

 Use the helper ovl_i_path_realinode() to get realinode and then do
 non-nullptr checking.

 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217405
 Fixes: 4b7791b2e9 ("ovl: handle idmappings in ovl_permission()")
 Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
 Suggested-by: Christian Brauner <brauner@kernel.org>
 Suggested-by: Amir Goldstein <amir73il@gmail.com>

 Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Bug: 285105314
Link: https://lore.kernel.org/linux-unionfs/20230516-topografie-gejubelt-dba162b6e735@brauner/T/
Change-Id: If89ff32991b8075844f11efbae05edaa6465b5ee
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>
2023-06-07 00:40:32 +00:00
Zhihao Cheng
2de1ee6dd8 BACKPORT: FROMLIST: ovl: Let helper ovl_i_path_real() return the realinode
Let helper ovl_i_path_real() return the realinode to prepare for
checking non-null realinode in rcu walking path.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Bug: 285105314
Link: https://lore.kernel.org/lkml/20230516-topografie-gejubelt-dba162b6e735@brauner/T/
Change-Id: I4fed6fe0874215eb381b6879565a98b855916931
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>
2023-06-06 23:18:25 +00:00
xiaofeng
963667856e ANDROID: GKI: Update symbol list for xiaomi
1 function symbol(s) added
  'int __traceiter_android_rvh_ctl_dirty_rate(void *unused)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_ctl_dirty_rate'

Bug: 284059793
Change-Id: I6a564fab67a2393ddd108a223b879b3dfd09c373
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2023-06-06 23:03:20 +00:00
xiaofeng
508ca06639 ANDROID: vendor_hooks:vendor hook for control memory dirty rate
When the IO pressure increases or the system performs dirty
page balancing, the frame rate of the foreground application
may become unstable. Therefore, a hook point is added to limit
the buffer IO rate from the source.

Bug: 262189942
Change-Id: I5214d611a388c5e8d87dc44ffde86ead1834ddff
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2023-06-06 23:03:20 +00:00
Minchan Kim
c959a3fc91 ANDROID: f2fs: enable cleancache
cleancache is enabled for only ext4 and btrfs. Since f2fs is one
of the main fs in Android, this patch enables cleancache for f2fs.

Bug: 236887352
Change-Id: Ib6e6e832234f72681058da848e9cff36c5a496f2
Signed-off-by: Minchan Kim <minchan@google.com>
(cherry picked from commit 32dfefb4c8)
2023-06-06 21:17:38 +00:00
Liam R. Howlett
2ea053d317 FROMGIT: userfaultfd: fix regression in userfaultfd_unmap_prep()
Android reported a performance regression in the userfaultfd unmap path.
A closer inspection on the userfaultfd_unmap_prep() change showed that a
second tree walk would be necessary in the reworked code.

Fix the regression by passing each VMA that will be unmapped through to
the userfaultfd_unmap_prep() function as they are added to the unmap list,
instead of re-walking the tree for the VMA.

Link: https://lkml.kernel.org/r/20230601015402.2819343-1-Liam.Howlett@oracle.com
Fixes: 69dbe6daf1 ("userfaultfd: use maple tree iterator to iterate VMAs")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Suren Baghdasaryan <surenb@google.com>
Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit de53cc0be1c8b47d595682932beb3c11be9e4e5a
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable)

Bug: 274059236
Change-Id: Ia189a5e98ffe86c4ca5ac3b686ada5f51826f2ed
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-06 20:05:25 +00:00
Liam R. Howlett
2f5f352e6a FROMGIT: BACKPORT: mm: avoid rewalk in mmap_region
If the iterator has moved to the previous entry, then step forward one
range, back to the gap.

Link: https://lkml.kernel.org/r/20230518145544.1722059-36-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: David Binderman <dcb314@hotmail.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Vernon Yang <vernon2gm@gmail.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit d3f028c7599ea2297dd630e1a6acaf4915c769d3
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable)

Bug: 274059236
Change-Id: Ic45e095c728095d41647a704a287596d03489cdf
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-06 20:05:25 +00:00
Liam R. Howlett
86d9de0898 FROMGIT: maple_tree: clear up index and last setting in single entry tree
When there is a single entry tree (range of 0-0 pointing to an entry),
then ensure the limit is either 0-0 or 1-oo, depending on where the user
walks.  Ensure the correct node setting as well; either MAS_ROOT or
MAS_NONE.

Link: https://lkml.kernel.org/r/20230518145544.1722059-33-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: David Binderman <dcb314@hotmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Vernon Yang <vernon2gm@gmail.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit c0b1bdd9011ef34b654fe62f2607bff0eb1ef0a8
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable)

Bug: 274059236
Change-Id: I22a41c01e525fde88774b509cd5cbc60f56f6dc5
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-06 20:05:25 +00:00
Liam R. Howlett
9288f53a31 FROMGIT: maple_tree: add mas_prev_range() and mas_find_range_rev interface
Some users of the maple tree may want to move to the previous range
regardless of the value stored there.  Add this interface as well as the
'find' variant to support walking to the first value, then iterating over
the previous ranges.

Link: https://lkml.kernel.org/r/20230518145544.1722059-32-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Vernon Yang <vernon2gm@gmail.com>
Cc: David Binderman <dcb314@hotmail.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit b8194567d8703df2ec488d5ace46b7435c936ba8
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable)

Bug: 274059236
Change-Id: Ic0507e00818c94f43ed3d760422dfc4d52de5981
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-06 20:05:25 +00:00