Commit graph

969,263 commits

Author SHA1 Message Date
Michael Bestas
b326ec1ff9
Merge tag 'LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn into android13-5.4-lahaina
"LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0"

* tag 'LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn:
  qcacmn: Fix low TPC power for vendor DTPC IE
  qcacmn: set pdev id to 0xFF when set country code
  qcacmn: Update preauth candidate entry to scan table
  qcacmn: Dont add the wmi header size while allocating the wmi buff
  qcacmn: Reduce the log level from error to info
  qcacmn: add vendor command to configure the parameters for monitor mode
  Revert "qcacmn: add vendor command to configure the parameters for monitor mode"
  qcacmn: Add cdp api to update the packet capture mode
  qcacmn: add vendor command to configure the parameters for monitor mode
  qcacmn: Add APIs to get data packets info
  qcacmn: Drop non-eapol packets for unauthorized peer
  qcacmn: Fix possible OOB in wmi_extract_dbr_buf_release_entry
  Revert "qcacmn: add wmi service for tx aggregation support"
  qcacmn: add wmi service for tx aggregation support

Change-Id: I1bc6d399f20e906c9366e0a816952cb5dfe865b6
2023-08-29 03:56:09 +03:00
Michael Bestas
49244f4559
Merge tag 'LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api into android13-5.4-lahaina
"LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0"

* tag 'LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api:
  Revert "fw-api: update below 4 CLs in fw common interface files".
  fw-api: update below 4 CLs in fw common interface files

Change-Id: Ib291ad69feefd8daa92547e9352d9c3889f11aac
2023-08-29 03:55:31 +03:00
Michael Bestas
d9b72de2cf
Merge tag 'LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina
"LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0"

* tag 'LA.UM.9.14.1.r1-10900-QCM6490.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4:
  msm: kgsl: Defer drawobj_sync_timeline_fence_work() to a workqueue
  BACKPORT: of: base: Skip CPU nodes with "fail"/"fail-..." status
  qcom: cpufreq-hw: Use the topology coreid for offset
  msm: kgsl: Check user generated timestamp before queuing drawobjs
  msm: kgsl: Keep postamble packets in a privileged buffer
  net: qrtr: haven: Add bounds check on tx path
  pci: msm: Add support to retry for sending rpmsg
  cpu-topology: Change the size of allocation for cpu's
  devfreq: memlat: Correct the num_cpus in memlat-mon
  core_ctl: Add check for available cpus before accessing per_cpus
  msm: kgsl: Remove protected GPUCC registers from snapshot
  wifi: cfg80211: fix BSS refcounting bugs
  wifi: cfg80211: avoid nontransmitted BSS list corruption
  wifi: cfg80211: fix u8 overflow in cfg80211_update_notlisted_nontrans()
  cnss2: Add code to fallback to non-contiguous FW mem allocation
  msm: kgsl: Fix gpuaddr_in_range() to check upper bound
  msm: kgsl: Remove 'fd' dependency to get dma_buf handle
  msm: kgsl: Zap performance counters across context switches
  msm: kgsl: Update the IFPC power up reglist
  msm: kgsl: Update register protection config
  msm: kgsl: Add support for A643 GPU

Change-Id: Ie958b06794787ef0672bb2cdd0c12911b819f3d5
2023-08-29 03:54:00 +03:00
Michael Bestas
1cbc6feae2
Merge branch 'master' of https://github.com/namjaejeon/linux-exfat-oot into android13-5.4-lahaina
* 'master' of https://github.com/namjaejeon/linux-exfat-oot:
  exfat: add necessary header for vmalloc
  exfat: release s_lock before calling dir_emit()
  exfat: check if filename entries exceeds max filename length
  exfat: github action: make space for running xfstests
  exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree
  exfat: splice: Use filemap_splice_read() instead of generic_file_splice_read()
  exfat: fs: build the legacy direct I/O code conditionally
  exfat: fs: port ->rename() to pass mnt_idmap
  exfat: fs: port ->mkdir() to pass mnt_idmap
  exfat: fs: port ->create() to pass mnt_idmap
  exfat: fs: port ->getattr() to pass mnt_idmap
  exfat: fs: port ->setattr() to pass mnt_idmap
  exfat: fix the newly allocated clusters are not freed in error handling
  exfat: don't print error log in normal case
  exfat: remove unneeded code from exfat_alloc_cluster()
  exfat: remove ->writepage
  exfat: handle unreconized benign secondary entries
  exfat: fix inode->i_blocks for non-512 byte sector size device
  exfat: redefine DIR_DELETED as the bad cluster number
  exfat: fix reporting fs error when reading dir beyond EOF
  exfat: fix unexpected EOF while reading dir
  exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set()
  exfat: fix overflow in sector and cluster conversion
  exfat: remove i_size_write() from __exfat_truncate()
  exfat: remove argument 'size' from exfat_truncate()
  exfat: remove unnecessary arguments from exfat_find_dir_entry()
  exfat: remove unneeded codes from __exfat_rename()
  exfat: remove call ilog2() from exfat_readdir()
  exfat: remove generic/286
  exfat: fix python package installation failure
  exfat: github actions: add apt-get update command
  exfat: treewide: use get_random_u32() when possible
  exfat: replace magic numbers with Macros
  exfat: rename exfat_free_dentry_set() to exfat_put_dentry_set()
  exfat: move exfat_entry_set_cache from heap to stack
  exfat: support dynamic allocate bh for exfat_entry_set_cache
  exfat: reduce the size of exfat_entry_set_cache
  exfat: add SECTOR_SIZE macro
  exfat: hint the empty entry which at the end of cluster chain
  exfat: simplify empty entry hint
  exfat: add auto-test using github action
  exfat: remove travis-CI test
  exfat: release 6.0.0 version
  exfat: fix overflow for large capacity partition
  exfat: add auto build-test and simple stability test using travis-CI
  exfat: Drop superfluous new line for error messages
  exfat: Downgrade ENAMETOOLONG error message to debug messages
  exfat: Expand exfat_err() and co directly to pr_*() macro
  exfat: Define NLS_NAME_* as bit flags explicitly
  exfat: Return ENAMETOOLONG consistently for oversized paths
  exfat: simplified by using round_up()
  fs: Convert mpage_readpage to mpage_read_folio
  fs: Remove flags parameter from aops->write_begin
  fs: Remove aop flags parameter from cont_write_begin()
  block: add a bdev_discard_granularity helper
  block: remove QUEUE_FLAG_DISCARD
  exfat: remove duplicate write inode for extending dir/file
  exfat: remove duplicate write inode for truncating file
  exfat: reuse __exfat_write_inode() to update directory entry
  exfat: use updated exfat_chain directly during renaming

Change-Id: Ib68d90de9ea596296407f446fa611525034db193
2023-08-25 12:15:07 +03:00
Michael Bestas
d76bd768e3
Merge tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel into android13-5.4-lahaina
"LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel:
  msm: camera: fd: Fix compilation issue
  msm: camera: sensor: Add changes to prevent unmap buffers
  msm: camera: mem_mgr: Add refcount to track in use buffers
  msm: camera: core: validation of session/device/link handle

Change-Id: Ib788e6976d983169dbfc15ef0584cff7dc936dd9
2023-08-25 12:14:13 +03:00
Michael Bestas
ed068fccfe
Merge tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-5.4-lahaina
"LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  ASoC: msm-pcm-q6-v2: Add dsp buf check
  ASoC: Add the judgment for TDM
  asoc: swrm: disable bus reset based on swrm verison
  dsp: afe: Add check for sidetone iir config copy size
  ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm playback copy
  ASoC: msm-pcm-voip: Avoid interger underflow
  dsp: asm: validate payload size before access
  dsp:  afe: check for param size before copying
  dsp: q6core: validate payload size before access for AVCS
  dsp: afe: Add check for num_channels
  soc: swr-mstr-ctrl: add new lock to sync runtime_resume and runtime_suspend
  soc: reduce the auto suspend timeout when swr event finished

Change-Id: I82d3446a3ecf6cf47f75ab34a292557f24339ebb
2023-08-25 12:12:56 +03:00
Michael Bestas
5b907c9a3a
Merge tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api into android13-5.4-lahaina
"LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api:
  fw-api: CL 23575205 - update fw common interface files
  fw-api: CL 23566455 - update fw common interface files
  fw-api: CL 23557966 - update fw common interface files
  fw-api: CL 23542073 - update fw common interface files
  fw-api: CL 23529709 - update fw common interface files
  fw-api: CL 23523211 - update fw common interface files
  fw-api: CL 23520891 - update fw common interface files
  fw-api: CL 23507997 - update fw common interface files
  fw-api: CL 23504182 - update fw common interface files
  fw-api: Changes in monitor headers to support Big endian
  fw-api: CL 23485853 - update fw common interface files
  fw-api: CL 23485848 - update fw common interface files
  fw-api: CL 23467477 - update fw common interface files
  fw-api: CL 23459857 - update fw common interface files
  fw-api: CL 23459166 - update fw common interface files
  fw-api: CL 23441442 - update fw common interface files
  fw-api: CL 23420522 - update fw common interface files
  fw-api: CL 23329795 - update fw common interface files
  fw-api: CL 23307781 - update fw common interface files
  fw-api: CL 23242420 - update fw common interface files
  fw-api: CL 23191762 - update fw common interface files
  fw-api: CL 23190594 - update fw common interface files
  fw-api: CL 23178089 - update fw common interface files
  fw-api: CL 23138893 - update fw common interface files
  fw-api: CL 23101916 - update fw common interface files

Change-Id: Ia96694f553b1f5e2734acf5607d7460f5d779ab4
2023-08-25 12:12:11 +03:00
Michael Bestas
36c61ad7d9
Merge tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina
"LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-22200-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4:
  usb: gadget: cdev: Add spinlock to synchronize ports->cbits_updated
  msm: ep_pcie: Set clock power management bit for EP
  msm: Add config option for R8168 IOSS glue driver
  ipa_eth: Header change to pass more info from ETH to GSI

Change-Id: Ib6b27009e9867a605881464b80926daf6e0da25b
2023-08-25 12:11:25 +03:00
Lynus Vaz
7be109d700 msm: kgsl: Defer drawobj_sync_timeline_fence_work() to a workqueue
drawobj_sync_timeline_fence_work() does a cleanup of fence and syncobj
allocations. Doing this cleanup in irq context requires the irq_work
struct to remain valid after the function executes. Avoid this constraint
by deferring this work to the memory workqueue.

Change-Id: Icf648a61686c1ef3fd84467a2376b11a9a4bb803
Signed-off-by: Lynus Vaz <quic_lvaz@quicinc.com>
2023-08-17 02:24:45 -07:00
Alexander Winkowski
368983dd6c
techpack: camera: Avoid OOB access to struct cam_axi_per_path_bw_vote
Change-Id: I36c6366aa77f8e747a18d30b11c9f4f10ab60a82
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2023-08-15 17:53:46 +00:00
Soumya Managoli
e9e1988e85
ASoC: Fix overflow error in routing driver
The reg in soc_dapm_mux is 32-bit. The BE DAI ID passed
as shift(to be operated on the reg) may be more than 31,
which may cause overflow.
Set reg field to SND_SOC_NOPM to avoid any DAPM operation
while passing BE IDs in shift_l field and hence avoid overflow.

Change-Id: Ibbbca04c61b7c56eb4c5a7485a4e93dc28a09709
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
[dereference23: Forward port to msm-5.4]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2023-08-15 17:50:24 +00:00
Gangadhar Kavalastramath
abd1a7c44c
qcacld-3.0: Initialize local struct objects
Initialize struct cm_roam_values_copy to avoid using uninitialized
parameters in wlan_cm_roam_cfg_set_value().
Initialize struct pdev_params to zero to avoid using uninitialized
parameters in wmi_unified_pdev_param_send().

Change-Id: I820db09840431487f1756695a0562f8a794f549f
CRs-Fixed: 3187194
2023-08-15 17:49:59 +00:00
Manaf Meethalavalappu Pallikunhi
7d3114211e
disp: msm: limit display brightness max cooling device level
Based on panel hardware support, display brightness levels can
be very high value. This high value display brightness cooling
device levels can cause exceeding PAGE_SIZE for cooling device stat
buffer. It leads to buffer failure for cooling device stat feature.

Limit display panel mitigation level max to 255. If hardware
supports more than 255, then scale brightness levels fit
into above limit.

Change-Id: Ieeee4ff2aa5cd884819b30b4fd9839e48ac4d804
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2023-08-15 17:49:42 +00:00
Linux Build Service Account
e88a5cceb1 Merge c99a841d40 on remote branch
Change-Id: I1568e21baded8139319e266649bffde810e4a8a5
2023-07-19 02:18:12 -07:00
Linux Build Service Account
bef14fa7f2 Merge f81db81382 on remote branch
Change-Id: I31f0b6b78c6a47c9a3eaa55d4b614fd2af047e29
2023-07-19 01:59:24 -07:00
Linux Build Service Account
d5e4529e8b Merge b9736f2024 on remote branch
Change-Id: Ieac36f04437394214eb963fddf1bfcb90e18de53
2023-07-19 01:54:34 -07:00
Linux Build Service Account
43c4367cfa Merge f47869b550 on remote branch
Change-Id: I74a048c76fb5f41d4c05ded978e3862210293001
2023-07-19 01:43:00 -07:00
HiGarfield
2a0023bc28 exfat: add necessary header for vmalloc
This fixes building on Linux 4.4.

Signed-off-by: HiGarfield <higarfield@126.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-16 23:58:02 +09:00
Sungjong Seo
803d714374 exfat: release s_lock before calling dir_emit()
There is a potential deadlock reported by syzbot as below:

======================================================
WARNING: possible circular locking dependency detected
6.4.0-next-20230707-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor330/5073 is trying to acquire lock:
ffff8880218527a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock_killable include/linux/mmap_lock.h:151 [inline]
ffff8880218527a0 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5293 [inline]
ffff8880218527a0 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x369/0x510 mm/memory.c:5344
but task is already holding lock:
ffff888019f760e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_iterate+0x117/0xb50 fs/exfat/dir.c:232

which lock already depends on the new lock.

Chain exists of:
  &mm->mmap_lock --> mapping.invalidate_lock#3 --> &sbi->s_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->s_lock);
                               lock(mapping.invalidate_lock#3);
                               lock(&sbi->s_lock);
  rlock(&mm->mmap_lock);

Let's try to avoid above potential deadlock condition by moving dir_emit*()
out of sbi->s_lock coverage.

Fixes: ca06197382bd ("exfat: add directory operations")
Cc: stable@vger.kernel.org #v5.7+
Reported-by: syzbot+1741a5d9b79989c10bdc@syzkaller.appspotmail.com
Link: https://lore.kernel.org/lkml/00000000000078ee7e060066270b@google.com/T/#u
Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-15 23:12:22 +09:00
Namjae Jeon
0bf9ccffd2 exfat: check if filename entries exceeds max filename length
exfat_extract_uni_name copies characters from a given file name entry into
the 'uniname' variable. This variable is actually defined on the stack of
the exfat_readdir() function. According to the definition of
the 'exfat_uni_name' type, the file name should be limited 255 characters
(+ null teminator space), but the exfat_get_uniname_from_ext_entry()
function can write more characters because there is no check if filename
entries exceeds max filename length. This patch add the check not to copy
filename characters when exceeding max filename length.

Cc: stable@vger.kernel.org
Cc: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reported-by: Maxim Suhanov <dfirblog@gmail.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-14 17:10:50 +09:00
Namjae Jeon
17c7881225 exfat: github action: make space for running xfstests
github action seems to decrease disk space of each users. This patch try
to remove file creation test and reset test images in the middle of testing xfstests

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-14 17:08:12 +09:00
Linux Build Service Account
8e23a47538 Merge c53391f022 on remote branch
Change-Id: I125ca16d0b542e342dc246006beac84c1092fe29
2023-07-13 06:05:07 -07:00
Linux Build Service Account
2059fb87c9 Merge f33e86393b on remote branch
Change-Id: Ic9055d7bc21f0e2235b7a49b85553124fa8b3bdf
2023-07-13 05:55:48 -07:00
Namjae Jeon
7d8b1148d8 exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree
The call stack shown below is a scenario in the Linux 4.19 kernel.
Allocating memory failed where exfat fs use kmalloc_array due to
system memory fragmentation, while the u-disk was inserted without
recognition.
Devices such as u-disk using the exfat file system are pluggable and
may be insert into the system at any time.
However, long-term running systems cannot guarantee the continuity of
physical memory. Therefore, it's necessary to address this issue.

Binder:2632_6: page allocation failure: order:4,
 mode:0x6040c0(GFP_KERNEL|__GFP_COMP), nodemask=(null)
Call trace:
[242178.097582]  dump_backtrace+0x0/0x4
[242178.097589]  dump_stack+0xf4/0x134
[242178.097598]  warn_alloc+0xd8/0x144
[242178.097603]  __alloc_pages_nodemask+0x1364/0x1384
[242178.097608]  kmalloc_order+0x2c/0x510
[242178.097612]  kmalloc_order_trace+0x40/0x16c
[242178.097618]  __kmalloc+0x360/0x408
[242178.097624]  load_alloc_bitmap+0x160/0x284
[242178.097628]  exfat_fill_super+0xa3c/0xe7c
[242178.097635]  mount_bdev+0x2e8/0x3a0
[242178.097638]  exfat_fs_mount+0x40/0x50
[242178.097643]  mount_fs+0x138/0x2e8
[242178.097649]  vfs_kern_mount+0x90/0x270
[242178.097655]  do_mount+0x798/0x173c
[242178.097659]  ksys_mount+0x114/0x1ac
[242178.097665]  __arm64_sys_mount+0x24/0x34
[242178.097671]  el0_svc_common+0xb8/0x1b8
[242178.097676]  el0_svc_handler+0x74/0x90
[242178.097681]  el0_svc+0x8/0x340

By analyzing the exfat code,we found that continuous physical memory
is not required here,so kvmalloc_array is used can solve this problem.

Signed-off-by: gaoming <gaoming20@hihonor.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-12 23:32:11 +09:00
Pratham Pratap
c99a841d40 usb: gadget: cdev: Add spinlock to synchronize ports->cbits_updated
Consider a scenario in which open, write and close of AT port is being
done repeatedly. At some point in time, cbits_updated in f_cdev
structure gets overwritten by the previous close instance causing the AT
port to go unresponsive. This prevents port bridge service from sending
DTR/RTS settings to at_mdm0 from at_usb0.

Fix this by adding spinlock to synchronise the updation of
ports->cbits_updated field in f_cdev structure.

Change-Id: Ibf39aa90f3918cd5f22e32a3b06685db4c4298ae
Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com>
2023-07-11 11:59:48 -07:00
David Howells
331d3f5c42 exfat: splice: Use filemap_splice_read() instead of generic_file_splice_read()
Replace pointers to generic_file_splice_read() with calls to
filemap_splice_read().

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
cc: Jens Axboe <axboe@kernel.dk>
cc: Al Viro <viro@zeniv.linux.org.uk>
cc: David Hildenbrand <david@redhat.com>
cc: John Hubbard <jhubbard@nvidia.com>
cc: linux-mm@kvack.org
cc: linux-block@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Link: https://lore.kernel.org/r/20230522135018.2742245-29-dhowells@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:35:55 +09:00
Christoph Hellwig
796bbd0726 exfat: fs: build the legacy direct I/O code conditionally
Add a new LEGACY_DIRECT_IO config symbol that is only selected by the
file systems that still use the legacy blockdev_direct_IO code, so that
kernels without support for those file systems don't need to build the
code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20230125065839.191256-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:35:47 +09:00
Christian Brauner (Microsoft)
d8b0edab69 exfat: fs: port ->rename() to pass mnt_idmap
Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:34:25 +09:00
Christian Brauner (Microsoft)
88c55a85d0 exfat: fs: port ->mkdir() to pass mnt_idmap
Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:56 +09:00
Christian Brauner (Microsoft)
1610136b56 exfat: fs: port ->create() to pass mnt_idmap
Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:54 +09:00
Christian Brauner (Microsoft)
eb2bd5c43a exfat: fs: port ->getattr() to pass mnt_idmap
Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:50 +09:00
Christian Brauner (Microsoft)
f4f94fa720 exfat: fs: port ->setattr() to pass mnt_idmap
Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:47 +09:00
Yuezhang Mo
03ab6855b1 exfat: fix the newly allocated clusters are not freed in error handling
In error handling 'free_cluster', before num_alloc clusters allocated,
p_chain->size will not updated and always 0, thus the newly allocated
clusters are not freed.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:45 +09:00
Yuezhang Mo
7a55bf46a5 exfat: don't print error log in normal case
When allocating a new cluster, exFAT first allocates from the
next cluster of the last cluster of the file. If the last cluster
of the file is the last cluster of the volume, allocate from the
first cluster. This is a normal case, but the following error log
will be printed. It makes users confused, so this commit removes
the error log.

[1960905.181545] exFAT-fs (sdb1): hint_cluster is invalid (262130)

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:42 +09:00
Yuezhang Mo
cd17de5006 exfat: remove unneeded code from exfat_alloc_cluster()
In the removed code, num_clusters is 0, nothing is done in
exfat_chain_cont_cluster(), so it is unneeded, remove it.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:40 +09:00
Christoph Hellwig
0e44fbe12d exfat: remove ->writepage
Patch series "start removing writepage instances v2".

The VM doesn't need or want ->writepage for writeback and is fine with
just having ->writepages as long as ->migrate_folio is implemented.

This series removes all ->writepage instances that use
block_write_full_page directly and also have a plain mpage_writepages
based ->writepages.

This patch (of 7):

->writepage is a very inefficient method to write back data, and only used
through write_cache_pages or a a fallback when no ->migrate_folio method
is present.

Set ->migrate_folio to the generic buffer_head based helper, and remove
the ->writepage implementation.

Link: https://lkml.kernel.org/r/20221202102644.770505-1-hch@lst.de
Link: https://lkml.kernel.org/r/20221202102644.770505-2-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Bob Copeland <me@bobcopeland.com>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Jan Kara <jack@suse.com>
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2023-07-11 22:20:39 +09:00
Michael Bestas
c66e4a1259
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/datarmnet-ext into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/datarmnet-ext:
  rmnet_offload: I590f620cea3770efb8bc319e3a0322bbc8acaf85
  rmnet_offload: I3835da78f030c175bb6ce15cbcb73c50272dd7f2

Change-Id: I1769c803edba359f5ceaecd3aac9e23647f24253
2023-07-11 15:55:17 +03:00
Michael Bestas
e11e13749b
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/datarmnet into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/datarmnet:
  rmnet_core: Strengthen IPv6 fragment check in rmnet_frag_skip_exthdr()
  rmnet_core: Manually checksum csum_valid = 0 packets

Change-Id: Ic8d02b333ceb430f12209e5f8de32c42d617bd17
2023-07-11 15:53:54 +03:00
Michael Bestas
ce16abb069
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/dataipa into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/dataipa:
  msm: ipa3: Adding changes to increase workqueue priority
  msm: ipa3: fix pointer arithmetic to avoid out-of-bound
  msm: ipa3: Removing assert in halt q6 channel failed cases.

Change-Id: I9e71c61d64302bbbe37297de84e616abd3fd6da1
2023-07-11 15:52:40 +03:00
Michael Bestas
7a406906ce
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  ASoC: msm-pcm-voip: Avoid interger underflow
  dsp: q6core: validate payload size before access for AVCS
  dsp:  afe: check for param size before copying
  ASoC: msm-pcm-voip: Avoid interger underflow
  ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm capture copy
  dsp: q6core: Avoid OOB access in q6core
  dsp: q6voice: Add buf size check for cvs cal data
  ASoC: msm-pcm-host-voice: Handle OOB access in hpcm_start
  dsp: q6adm: Resolve mem corruption in adm cb

Change-Id: I049254180a236de36f3f526faa2e401c4dd805ee
2023-07-11 15:49:56 +03:00
Michael Bestas
ee00b849f3
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0 into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0:
  Release 2.0.8.33B
  qcacld-3.0: Print wow_nack reason code
  Release 2.0.8.33A
  qcacld-3.0: Don't start vdev trans if vdev ops is pending
  Release 2.0.8.33
  qcacld-3.0: Send the 6 GHz channel in WMI_ROAM_CHAN_LIST
  Release 2.0.8.32Z
  qcacld-3.0: Don't fill CCK rates for SAE Pre Auth frame
  Release 2.0.8.32Y
  qcacld-3.0: Update dot11 mode correctly for Getbssinfo

Change-Id: Ib8b32ed0d4ab2282a9e05729f7e3bb6ec49f6c8f
2023-07-11 15:47:05 +03:00
Michael Bestas
1f6fb86d15
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn:
  qcacmn: Get wow nack reason code

Change-Id: I8c847d4e7ae5d913988ec3667c67e4b93bf267bc
2023-07-11 15:46:17 +03:00
Michael Bestas
75e4a02651
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api:
  fw-api: Add evm info headers for qcn9224
  fw-api: CL 22994196 - update fw common interface files
  fw-api: CL 22946448 - update fw common interface files
  fw-api: CL 22928086 - update fw common interface files
  fw-api: CL 22895719 - update fw common interface files
  fw-api: CL 22882405 - update fw common interface files
  fw-api: CL 22860575 - update fw common interface files
  fw-api: CL 22845599 - update fw common interface files
  fw-api: CL 22832398 - update fw common interface files
  fw-api: CL 22832353 - update fw common interface files
  fw-api: CL 22808446 - update fw common interface files
  fw-api: CL 22808430 - update fw common interface files
  fw-api: CL 22791601 - update fw common interface files
  fw-api: CL 22788805 - update fw common interface files
  fw-api: CL 22765461 - update fw common interface files
  fw-api: CL 22691990 - update fw common interface files
  fw-api: CL 22674286 - update fw common interface files
  fw-api: CL 22650243 - update fw common interface files
  fw-api: CL 22641645 - update fw common interface files
  fw-api: CL 22630619 - update fw common interface files
  Revert "fw-api: Add evm info headers for qcn9224"
  fw-api: Add qcnn6432 target header files to fw-api project
  fw-api: CL 22585871 - update fw common interface files
  fw-api: CL 22585869 - update fw common interface files
  fw-api: CL 22545098 - update fw common interface files
  fw-api: CL 22522091 - update fw common interface files
  fw-api: CL 22520756 - update fw common interface files
  fw-api: CL 22520752 - update fw common interface files
  fw-api: Add evm info headers for qcn9224

Change-Id: Id8039f4e7e68a905241ace1b898e0d4e3ebcfc71
2023-07-11 15:45:18 +03:00
Michael Bestas
98fe78f9fe
Merge tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina
"LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-22000-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4:
  cpufreq: schedutil: Fix UAF issue
  msm: mhi_dev: Support async write in UCI for size greater than 8k
  mtd: msm_qpic_nand: Add boot_a and boot_b access to APPS
  qcom: cpufreq-hw: Use the topology coreid for offset
  soc: qcom: Add Upperbounds check for program header
  msm: adsprpc: Handle UAF in fastrpc_buf_free
  interconnect: qcom: sm8150: fix UAF under remove function
  interconnect: qcom: monaco: fix UAF under remove function
  interconnect: qcom: direwolf: fix UAF under remove function
  interconnect: qcom: yupik: fix UAF under remove function
  interconnect: qcom: sdxnightjar: fix UAF under remove function
  interconnect: qcom: sdxlemur: fix UAF under remove function
  interconnect: qcom: sm6150: fix UAF under remove function
  interconnect: qcom: shima: fix UAF under remove function
  interconnect: qcom: scshrike: fix UAF under remove function
  interconnect: qcom: lahaina: fix UAF under remove function
  interconnect: qcom: holi: fix UAF under remove function
  qcedev: vote for crypto clocks during module close
  msm: synx: Check for zero before reducing bind handles
  msm: adsprpc: Handle UAF in fastrpc internal munmap
  mtd: msm_qpic_nand: Add boot_a and boot_b access to APPS
  coresight-tmc: increase qdss pcie sw path throughput
  net: qrtr: Move service id based filter check before queueing skb
  defconfig: sdxlemur: Enable R8168 driver config
  virt: haven: rsc_mgr: Allocate right buffer size of requests

 Conflicts:
	arch/arm64/boot/dts/vendor/bindings/phy/amlogic,g12a-usb3-pcie-phy.yaml
	arch/arm64/boot/dts/vendor/bindings/sound/qcom,wcd9335.txt
	drivers/edac/qcom_edac.c
	drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
	drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
	drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
	mm/khugepaged.c

Change-Id: I5b49e94db45d481ea90ba77800b26c32bd7433ab
2023-07-11 15:43:42 +03:00
Michael Bestas
6e1a4f94cd
Merge tag 'ASB-2023-07-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
https://source.android.com/docs/security/bulletin/2023-07-01
CVE-2022-42703
CVE-2023-21255
CVE-2023-25012

* tag 'ASB-2023-07-05_11-5.4' of https://android.googlesource.com/kernel/common:
  UPSTREAM: ipvlan:Fix out-of-bounds caused by unclear skb->cb
  UPSTREAM: net/sched: cls_u32: Fix reference counter leak leading to overflow
  UPSTREAM: memstick: r592: Fix UAF bug in r592_remove due to race condition
  BACKPORT: btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
  ANDROID: HID: Only utilise UHID provided exports if UHID is enabled
  UPSTREAM: bluetooth: Perform careful capability checks in hci_sock_ioctl()
  ANDROID: HID; Over-ride default maximum buffer size when using UHID
  Revert "ANDROID: AVB error handler to invalidate vbmeta partition."
  UPSTREAM: mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
  UPSTREAM: mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
  UPSTREAM: efi: rt-wrapper: Add missing include
  BACKPORT: arm64: efi: Execute runtime services from a dedicated stack

Change-Id: I1f90844654d86b0a8507de963cb574813fdbf99b
2023-07-11 15:34:28 +03:00
Sai Chaitanya Kaveti
0c5f471d1c msm: ep_pcie: Set clock power management bit for EP
According to PCIe spec, PCIE_CAP_CLOCK_POWER_MAN bit in
LINK_CAPABILITIES_REG register should be set for EP. But it is seen as
cleared after core reset. In the current driver this bit is being set
but it is not taking effect. Enabling CLK_PM_EN in PCIE_ELBI_SYS_CTRL
register, so that PCIE_CAP_CLOCK_POWER_MAN is set.

Change-Id: I16654d5a477fa8eeaad61d6ec1dd32757627e2f9
Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
2023-07-07 11:46:00 +05:30
Gaurav Jindal
f81db81382 msm: camera: fd: Fix compilation issue
This commit fixes compilation issue.

CRs-Fixed: 3549085
Change-Id: Ia98fbbf67736c372fea4788b8e445c534126da21
Signed-off-by: Gaurag Jindal <quic_gjindal@quicinc.com>
2023-07-04 04:50:49 -07:00
t.feng
f95ca5bb23 UPSTREAM: ipvlan:Fix out-of-bounds caused by unclear skb->cb
[ Upstream commit 90cbed5247439a966b645b34eb0a2e037836ea8e ]

If skb enqueue the qdisc, fq_skb_cb(skb)->time_to_send is changed which
is actually skb->cb, and IPCB(skb_in)->opt will be used in
__ip_options_echo. It is possible that memcpy is out of bounds and lead
to stack overflow.
We should clear skb->cb before ip_local_out or ip6_local_out.

v2:
1. clean the stack info
2. use IPCB/IP6CB instead of skb->cb

crash on stable-5.10(reproduce in kasan kernel).
Stack info:
[ 2203.651571] BUG: KASAN: stack-out-of-bounds in
__ip_options_echo+0x589/0x800
[ 2203.653327] Write of size 4 at addr ffff88811a388f27 by task
swapper/3/0
[ 2203.655460] CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Not tainted
5.10.0-60.18.0.50.h856.kasan.eulerosv2r11.x86_64 #1
[ 2203.655466] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.10.2-0-g5f4c7b1-20181220_000000-szxrtosci10000 04/01/2014
[ 2203.655475] Call Trace:
[ 2203.655481]  <IRQ>
[ 2203.655501]  dump_stack+0x9c/0xd3
[ 2203.655514]  print_address_description.constprop.0+0x19/0x170
[ 2203.655530]  __kasan_report.cold+0x6c/0x84
[ 2203.655586]  kasan_report+0x3a/0x50
[ 2203.655594]  check_memory_region+0xfd/0x1f0
[ 2203.655601]  memcpy+0x39/0x60
[ 2203.655608]  __ip_options_echo+0x589/0x800
[ 2203.655654]  __icmp_send+0x59a/0x960
[ 2203.655755]  nf_send_unreach+0x129/0x3d0 [nf_reject_ipv4]
[ 2203.655763]  reject_tg+0x77/0x1bf [ipt_REJECT]
[ 2203.655772]  ipt_do_table+0x691/0xa40 [ip_tables]
[ 2203.655821]  nf_hook_slow+0x69/0x100
[ 2203.655828]  __ip_local_out+0x21e/0x2b0
[ 2203.655857]  ip_local_out+0x28/0x90
[ 2203.655868]  ipvlan_process_v4_outbound+0x21e/0x260 [ipvlan]
[ 2203.655931]  ipvlan_xmit_mode_l3+0x3bd/0x400 [ipvlan]
[ 2203.655967]  ipvlan_queue_xmit+0xb3/0x190 [ipvlan]
[ 2203.655977]  ipvlan_start_xmit+0x2e/0xb0 [ipvlan]
[ 2203.655984]  xmit_one.constprop.0+0xe1/0x280
[ 2203.655992]  dev_hard_start_xmit+0x62/0x100
[ 2203.656000]  sch_direct_xmit+0x215/0x640
[ 2203.656028]  __qdisc_run+0x153/0x1f0
[ 2203.656069]  __dev_queue_xmit+0x77f/0x1030
[ 2203.656173]  ip_finish_output2+0x59b/0xc20
[ 2203.656244]  __ip_finish_output.part.0+0x318/0x3d0
[ 2203.656312]  ip_finish_output+0x168/0x190
[ 2203.656320]  ip_output+0x12d/0x220
[ 2203.656357]  __ip_queue_xmit+0x392/0x880
[ 2203.656380]  __tcp_transmit_skb+0x1088/0x11c0
[ 2203.656436]  __tcp_retransmit_skb+0x475/0xa30
[ 2203.656505]  tcp_retransmit_skb+0x2d/0x190
[ 2203.656512]  tcp_retransmit_timer+0x3af/0x9a0
[ 2203.656519]  tcp_write_timer_handler+0x3ba/0x510
[ 2203.656529]  tcp_write_timer+0x55/0x180
[ 2203.656542]  call_timer_fn+0x3f/0x1d0
[ 2203.656555]  expire_timers+0x160/0x200
[ 2203.656562]  run_timer_softirq+0x1f4/0x480
[ 2203.656606]  __do_softirq+0xfd/0x402
[ 2203.656613]  asm_call_irq_on_stack+0x12/0x20
[ 2203.656617]  </IRQ>
[ 2203.656623]  do_softirq_own_stack+0x37/0x50
[ 2203.656631]  irq_exit_rcu+0x134/0x1a0
[ 2203.656639]  sysvec_apic_timer_interrupt+0x36/0x80
[ 2203.656646]  asm_sysvec_apic_timer_interrupt+0x12/0x20
[ 2203.656654] RIP: 0010:default_idle+0x13/0x20
[ 2203.656663] Code: 89 f0 5d 41 5c 41 5d 41 5e c3 cc cc cc cc cc cc cc
cc cc cc cc cc cc 0f 1f 44 00 00 0f 1f 44 00 00 0f 00 2d 9f 32 57 00 fb
f4 <c3> cc cc cc cc 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 be 08
[ 2203.656668] RSP: 0018:ffff88810036fe78 EFLAGS: 00000256
[ 2203.656676] RAX: ffffffffaf2a87f0 RBX: ffff888100360000 RCX:
ffffffffaf290191
[ 2203.656681] RDX: 0000000000098b5e RSI: 0000000000000004 RDI:
ffff88811a3c4f60
[ 2203.656686] RBP: 0000000000000000 R08: 0000000000000001 R09:
ffff88811a3c4f63
[ 2203.656690] R10: ffffed10234789ec R11: 0000000000000001 R12:
0000000000000003
[ 2203.656695] R13: ffff888100360000 R14: 0000000000000000 R15:
0000000000000000
[ 2203.656729]  default_idle_call+0x5a/0x150
[ 2203.656735]  cpuidle_idle_call+0x1c6/0x220
[ 2203.656780]  do_idle+0xab/0x100
[ 2203.656786]  cpu_startup_entry+0x19/0x20
[ 2203.656793]  secondary_startup_64_no_verify+0xc2/0xcb

[ 2203.657409] The buggy address belongs to the page:
[ 2203.658648] page:0000000027a9842f refcount:1 mapcount:0
mapping:0000000000000000 index:0x0 pfn:0x11a388
[ 2203.658665] flags:
0x17ffffc0001000(reserved|node=0|zone=2|lastcpupid=0x1fffff)
[ 2203.658675] raw: 0017ffffc0001000 ffffea000468e208 ffffea000468e208
0000000000000000
[ 2203.658682] raw: 0000000000000000 0000000000000000 00000001ffffffff
0000000000000000
[ 2203.658686] page dumped because: kasan: bad access detected

To reproduce(ipvlan with IPVLAN_MODE_L3):
Env setting:
=======================================================
modprobe ipvlan ipvlan_default_mode=1
sysctl net.ipv4.conf.eth0.forwarding=1
iptables -t nat -A POSTROUTING -s 20.0.0.0/255.255.255.0 -o eth0 -j
MASQUERADE
ip link add gw link eth0 type ipvlan
ip -4 addr add 20.0.0.254/24 dev gw
ip netns add net1
ip link add ipv1 link eth0 type ipvlan
ip link set ipv1 netns net1
ip netns exec net1 ip link set ipv1 up
ip netns exec net1 ip -4 addr add 20.0.0.4/24 dev ipv1
ip netns exec net1 route add default gw 20.0.0.254
ip netns exec net1 tc qdisc add dev ipv1 root netem loss 10%
ifconfig gw up
iptables -t filter -A OUTPUT -p tcp --dport 8888 -j REJECT --reject-with
icmp-port-unreachable
=======================================================
And then excute the shell(curl any address of eth0 can reach):

for((i=1;i<=100000;i++))
do
        ip netns exec net1 curl x.x.x.x:8888
done
=======================================================

Bug: 289225588
Fixes: 2ad7bf3638 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: "t.feng" <fengtao40@huawei.com>
Suggested-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 610a433810b277b3b77389733c07d22e8af68de2)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I08a12f6e3b1614210867cd23e9071918dc380faf
2023-06-28 17:43:14 +01:00
Shalini Manjunatha
f47869b550 ASoC: msm-pcm-q6-v2: Add dsp buf check
Fix is to add check for this ADSP returned buf offset + size,
if it is within the available buf size range

Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-06-27 16:30:54 +05:30
Lee Jones
6e030b7606 UPSTREAM: net/sched: cls_u32: Fix reference counter leak leading to overflow
[ Upstream commit 04c55383fa5689357bcdd2c8036725a55ed632bc ]

In the event of a failure in tcf_change_indev(), u32_set_parms() will
immediately return without decrementing the recently incremented
reference counter.  If this happens enough times, the counter will
rollover and the reference freed, leading to a double free which can be
used to do 'bad things'.

In order to prevent this, move the point of possible failure above the
point where the reference counter is incremented.  Also save any
meaningful return values to be applied to the return data at the
appropriate point in time.

This issue was caught with KASAN.

Bug: 273251569
Fixes: 705c709126 ("net: sched: cls_u32: no need to call tcf_exts_change for newly allocated struct")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 07f9cc229b44cbcee6385802d390091d915f38c3)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I95524bfda9a08a40b3d54515e528419dba18dc55
2023-06-26 12:07:16 +01:00