Compare commits

..

96 Commits

Author SHA1 Message Date
Steve Sakoman
bab87089ad build-appliance-image: Update to dunfell head revision
(From OE-Core rev: 77f6fbfa18b4ad77c3756cfdc45d441a20210781)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 09:48:48 -10:00
Steve Sakoman
d91c3c1242 poky.conf: bump version for 3.1.26
(From meta-yocto rev: 5faf10f83e45aceb3d14c904346d82ea3ce9bdcc)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 05:10:27 -10:00
Steve Sakoman
a7ed388d44 documentation: update for 3.1.26
(From yocto-docs rev: 9eae543ad41edbc3db7ec465e756507643cebb1d)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 05:10:27 -10:00
Richard Purdie
b93817cc62 selftest/reproducible: Allow native/cross reuse in test
We don't compare reproducibility of the native/cross components, only the
target ones. With the long build times of rust-native, the test now takes
crazy lengths of time so this tweak should allow us to reuse native/cross
artefacts from sstate whilst still testing the target output is
reproducible.

(From OE-Core rev: fd3d9b32256bceacd514bfd5ebfa0a30bcfdbd0c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b494d83c639a877cefeb7cbab6d37195e492f059)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 05:10:26 -10:00
Qiu Tingting
33e9349a4a e2fsprogs: fix ptest bug for second running
At second running, there are four new failed case:
  d_loaddump f_bigalloc_badinode f_bigalloc_orphan_list f_dup_resize

The test_data.tmp is necessary, but it is deleted by run-ptest.
So it should be restored after testing.

(From OE-Core rev: 496dc586446d09a77923bc191e5305ba06c8f59e)

Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit d0d08dd9a8a179e25b9cfcbac696c1d212a1910c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 05:10:26 -10:00
Randy MacLeod
036558afb0 vim: upgrade 9.0.1429 -> 9.0.1527
Fixes: https://nvd.nist.gov/vuln/detail/CVE-2023-2426
caf642c25 patch 9.0.1499: using uninitialized memory with fuzzy matching

(From OE-Core rev: 51a6a2f7917f18f67879ea9559084393ab68520b)

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 4f9a8df5aca99d0a5c2d2346b27ce7be08e7896c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 05:10:26 -10:00
Nikhil R
7ae33b3e6f libwebp: Fix CVE-2023-1999
Add patch to fix CVE-2023-1999

Link: a486d800b6

(From OE-Core rev: c1f8a40b65d72c8fdd2f4ae77fa4e682184c8891)

Signed-off-by: Nikhil R <nikhil.r@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-17 05:10:26 -10:00
Alex Kiernan
733d919af4 openssh: Move sshdgenkeys.service to sshd.socket
sshd.socket launches the templated sshd@.service, so by moving the
sshdgenkeys.service to sshd.socket, key generation can start in advance
of a connection.

(From OE-Core rev: 96798603273bbab40a7e19bbb67a9a5398648c21)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit af38a39b4bed9e43c5075008be47ca72191a489e)
Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Bruce Ashfield
f42e2c212f linux-yocto/5.4: update to v5.4.243
Updating  to the latest korg -stable release that comprises
the following commits:

    f53660ec669f Linux 5.4.243
    d60f15682a5c drm/amd/display: Fix hang when skipping modeset
    93ca0d7b88e8 mm/page_alloc: fix potential deadlock on zonelist_update_seq seqlock
    3f231e30cdeb drm/exynos: move to use request_irq by IRQF_NO_AUTOEN flag
    65a8b6d129cf drm/msm/adreno: Fix null ptr access in adreno_gpu_cleanup()
    62ac943eb2a9 firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()
    a781ea3437a0 drm/msm: Fix double pm_runtime_disable() call
    e4e88f74eb2f PM: domains: Restore comment indentation for generic_pm_domain.child_links
    ddcca7299de3 printk: declare printk_deferred_{enter,safe}() in include/linux/printk.h
    c2c3ffc79896 PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock
    6a24285f64ea PCI: pciehp: Use down_read/write_nested(reset_lock) to fix lockdep errors
    dde34ef0bc73 drbd: correctly submit flush bio on barrier
    373720b9289c serial: 8250: Fix serial8250_tx_empty() race with DMA Tx
    f2a1071100fe tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH
    ba04d6af5ac4 ext4: fix invalid free tracking in ext4_xattr_move_to_block()
    185062a21976 ext4: remove a BUG_ON in ext4_mb_release_group_pa()
    d7ff83a71d77 ext4: bail out of ext4_xattr_ibody_get() fails for any reason
    486efbbc9445 ext4: add bounds checking in get_max_inline_xattr_value_size()
    b4fa4768c9ac ext4: fix deadlock when converting an inline directory in nojournal mode
    2dda20290671 ext4: improve error recovery code paths in __ext4_remount()
    525c802de3f9 ext4: fix data races when using cached status extents
    4f4fd982d972 ext4: avoid a potential slab-out-of-bounds in ext4_group_desc_csum
    1b90fbc75901 ext4: fix WARNING in mb_find_extent
    f9e27d4bdb1f HID: wacom: insert timestamp to packed Bluetooth (BT) events
    d8b609e66244 HID: wacom: Set a default resolution for older tablets
    3decf3a750a9 drm/amdgpu: disable sdma ecc irq only when sdma RAS is enabled in suspend
    625d4112ea25 drm/amdgpu/gfx: disable gfx9 cp_ecc_error_irq only when enabling legacy gfx ras
    b1fabc379463 drm/amdgpu: fix an amdgpu_irq_put() issue in gmc_v9_0_hw_fini()
    c6bb59662432 drm/panel: otm8009a: Set backlight parent to panel device
    3e7703624612 f2fs: fix potential corruption when moving a directory
    dafc5a5c8fda ARM: dts: s5pv210: correct MIPI CSIS clock name
    ad751b896eae ARM: dts: exynos: fix WM8960 clock name in Itop Elite
    823496470790 remoteproc: st: Call of_node_put() on iteration error
    a1366ecb0905 remoteproc: stm32: Call of_node_put() on iteration error
    f16bc5111cc6 sh: nmi_debug: fix return value of __setup handler
    c9871a47f4ce sh: init: use OF_EARLY_FLATTREE for early init
    111b08116dac sh: math-emu: fix macro redefined warning
    8fb33166aed8 inotify: Avoid reporting event with invalid wd
    0ccea97abe6d platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i
    871641c7ebe5 cifs: fix pcchunk length type in smb2_copychunk_range
    3e2b4bceaaf9 btrfs: print-tree: parent bytenr must be aligned to sector size
    1e05bf5e80bb btrfs: don't free qgroup space unless specified
    b232f5e8cf81 btrfs: fix btrfs_prev_leaf() to not return the same key twice
    96f71f669bee perf symbols: Fix return incorrect build_id size in elf_read_build_id()
    78190a6ebe4e perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp()
    ffec80cc6761 perf vendor events power9: Remove UTF-8 characters from JSON files
    62f1ebfe9aac virtio_net: suppress cpu stall when free_unused_bufs
    1dc5faf30a6c virtio_net: split free_unused_bufs()
    b15637e717ad net: dsa: mt7530: fix corrupt frames using trgmii on 40 MHz XTAL MT7621
    544b0de2d767 ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init`
    35f2642f4abd drm/amdgpu: add a missing lock for AMDGPU_SCHED
    5cfe3f910f7c af_packet: Don't send zero-byte data in packet_sendmsg_spkt().
    fbcfa00386e1 ionic: remove noise from ethtool rxnfc error msg
    4a56f1f6fe92 rxrpc: Fix hard call timeout units
    dfa36eb38020 net/sched: act_mirred: Add carrier check
    cc5ccfb7c0ee writeback: fix call of incorrect macro
    9c1fcb97f98f net: dsa: mv88e6xxx: add mv88e6321 rsvd2cpu
    e80412439030 sit: update dev->needed_headroom in ipip6_tunnel_bind_dev()
    cc5fe387c629 net/sched: cls_api: remove block_cb from driver_list before freeing
    8acd3a28873f net/ncsi: clear Tx enable mode when handling a Config required AEN
    bc0905a76531 relayfs: fix out-of-bounds access in relay_file_read
    c038ae623a7c kernel/relay.c: fix read_pos error when multiple readers
    4f4de392f492 crypto: safexcel - Cleanup ring IRQ workqueues on load failure
    b9878f485d70 crypto: inside-secure - irq balance
    439d3a7056d5 dm verity: fix error handling for check_at_most_once on FEC
    0156f7dbd822 dm verity: skip redundant verity_handle_err() on I/O errors
    e4875d6e053d mailbox: zynqmp: Fix counts of child nodes
    ff0d64f5127e mailbox: zynq: Switch to flexible array to simplify code
    352b152905cc tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem
    9b2ed144318e nohz: Add TICK_DEP_BIT_RCU
    c8b6063f13ad netfilter: nf_tables: deactivate anonymous set from preparation phase
    29fb2a1a5f71 debugobject: Ensure pool refill (again)
    cef1b8a4df5c perf intel-pt: Fix CYC timestamps after standalone CBR
    5ead86d57583 perf auxtrace: Fix address filter entire kernel size
    29a1ef57c3be dm ioctl: fix nested locking in table_clear() to remove deadlock concern
    337b7af27356 dm flakey: fix a crash with invalid table line
    6d126899b074 dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path
    cbe0a7ec67c3 dm clone: call kmem_cache_destroy() in dm_clone_init() error path
    d8f66a19f8be s390/dasd: fix hanging blockdevice after request requeue
    5492d4081274 btrfs: scrub: reject unsupported scrub flags
    946e067b4cda scripts/gdb: fix lx-timerlist for Python3
    7cf5ce2857b8 clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent
    4379d5ce9235 wifi: rtl8xxxu: RTL8192EU always needs full init
    ecdcefd312d4 mailbox: zynqmp: Fix typo in IPI documentation
    38afc633d374 mailbox: zynqmp: Fix IPI isr handling
    14964127be77 md/raid10: fix null-ptr-deref in raid10_sync_request
    fe1cbbcb1a25 nilfs2: fix infinite loop in nilfs_mdt_get_block()
    4569a292a84e nilfs2: do not write dirty data after degenerating to read-only
    fd37a5c6998b parisc: Fix argument pointer in real64_call_asm()
    736aeb17b6a0 afs: Fix updating of i_size with dv jump from server
    27263ff39784 dmaengine: at_xdmac: do not enable all cyclic channels
    8c821199bc28 dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing
    24c9c4ad23d3 dmaengine: dw-edma: Fix to change for continuous transfer
    2e900f363174 phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port
    58e026465814 pwm: mtk-disp: Disable shadow registers before setting backlight values
    33f00f0a7368 pwm: mtk-disp: Adjust the clocks to avoid them mismatch
    e5e9e59c4564 pwm: mtk-disp: Don't check the return code of pwmchip_remove()
    8e238e88822f dmaengine: mv_xor_v2: Fix an error code.
    026df12f3c4d leds: TI_LMU_COMMON: select REGMAP instead of depending on it
    a34f6dcb78c6 ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
    6dfd85ada867 openrisc: Properly store r31 to pt_regs on unhandled exceptions
    2fd44d2bde34 clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails
    f2aaf419889c clocksource: davinci: axe a pointless __GFP_NOFAIL
    fc051820d616 clocksource/drivers/davinci: Avoid trailing '\n' hidden in pr_fmt()
    945e9898624d RDMA/mlx5: Use correct device num_ports when modify DC
    9bf843683a32 SUNRPC: remove the maximum number of retries in call_bind_status
    1dfa3c9dd27b Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
    ce6c42f0b644 input: raspberrypi-ts: Release firmware handle when not needed
    de85be00a8f3 firmware: raspberrypi: Introduce devm_rpi_firmware_get()
    d537afa08e15 firmware: raspberrypi: Keep count of all consumers
    919f470337e1 NFSv4.1: Always send a RECLAIM_COMPLETE after establishing lease
    fe60c3af70bf IB/hfi1: Fix SDMA mmu_rb_node not being evicted in LRU order
    b4f12e2402a5 RDMA/siw: Remove namespace check from siw_netdev_event()
    795d11e8ff35 clk: add missing of_node_put() in "assigned-clocks" property parsing
    0c770f95a2d7 power: supply: generic-adc-battery: fix unit scaling
    31ca78dc1f50 rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time
    8feca6259007 RDMA/mlx4: Prevent shift wrapping in set_user_sq_size()
    683cd87041ac rtc: omap: include header for omap_rtc_power_off_program prototype
    a48403e8c325 RDMA/rdmavt: Delete unnecessary NULL check
    b24e0e4612a5 RDMA/siw: Fix potential page_array out of range access
    318bc22decd4 perf/core: Fix hardlockup failure caused by perf throttle
    ff3edfb3c825 powerpc/rtas: use memmove for potentially overlapping buffer copy
    333a2a9846b9 macintosh: via-pmu-led: requires ATA to be set
    e2dd8bbab7b5 powerpc/sysdev/tsi108: fix resource printk format warnings
    770d583cd5ae powerpc/wii: fix resource printk format warnings
    f60c8d7c16bb powerpc/mpc512x: fix resource printk format warning
    97cd970f8add macintosh/windfarm_smu_sat: Add missing of_node_put()
    54dda7322255 spmi: Add a check for remove callback when removing a SPMI driver
    af9bfe1c0a50 staging: rtl8192e: Fix W_DISABLE# does not work after stop/start
    572d48361aa0 serial: 8250: Add missing wakeup event reporting
    488baa8038fa tty: serial: fsl_lpuart: adjust buffer length to the intended size
    8fa80b452bc9 firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
    26ca30516b2c usb: mtu3: fix kernel panic at qmu transfer done irq handler
    bd7a3e6416ab usb: chipidea: fix missing goto in `ci_hdrc_probe`
    f9e2abb6df6d sh: sq: Fix incorrect element size for allocating bitmap buffer
    e1431faa89bd uapi/linux/const.h: prefer ISO-friendly __typeof__
    6716203844bc spi: cadence-quadspi: fix suspend-resume implementations
    caaefbf823ab mtd: spi-nor: cadence-quadspi: Handle probe deferral while requesting DMA channel
    ee5ffe4cdfea mtd: spi-nor: cadence-quadspi: Don't initialize rx_dma_complete on failure
    7c69aeca59f2 mtd: spi-nor: cadence-quadspi: Provide a way to disable DAC mode
    df9708297bb2 mtd: spi-nor: cadence-quadspi: Make driver independent of flash geometry
    30ac77e99525 scripts/gdb: bail early if there are no generic PD
    35a2681e9937 PM: domains: Fix up terminology with parent/child
    0fbc62db7e10 scripts/gdb: bail early if there are no clocks
    0988baae3984 ia64: salinfo: placate defined-but-not-used warning
    d6cb7b6868b9 ia64: mm/contig: fix section mismatch warning/error
    d3c6d52148a1 of: Fix modalias string generation
    ca0f4ad2b7a3 vmci_host: fix a race condition in vmci_host_poll() causing GPF
    170e22324052 spi: fsl-spi: Fix CPM/QE mode Litte Endian
    863238433703 spi: qup: Don't skip cleanup in remove's error path
    814a9a6de1b1 linux/vt_buffer.h: allow either builtin or modular for macros
    3547e5bd0d10 ASoC: es8316: Handle optional IRQ assignment
    9650d5a1e7df ASoC: es8316: Use IRQF_NO_AUTOEN when requesting the IRQ
    f5ce428e3eae genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()
    0f31993721f9 PCI: imx6: Install the fault handler only on compatible match
    0fee5030c094 usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition
    7d2bc728cc8d iio: light: max44009: add missing OF device matching
    ee0e2f7af02a fpga: bridge: fix kernel-doc parameter description
    3fb02404c1e0 usb: host: xhci-rcar: remove leftover quirk handling
    36fb7843f1c3 pstore: Revert pmsg_lock back to a normal mutex
    602fa8af44fd tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp.
    638810f5d020 net: amd: Fix link leak when verifying config failed
    9ef809945edd netlink: Use copy_to_user() for optval in netlink_getsockopt().
    de0ffb5145c9 Revert "Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work"
    27c468ec1af1 ipv4: Fix potential uninit variable access bug in __ip_make_skb()
    3b9960e21e8b netfilter: nf_tables: don't write table validation state without mutex
    64d2c1cfd04f bpf: Don't EFAULT for getsockopt with optval=NULL
    3bf918f90f93 ixgbe: Enable setting RSS table to default values
    053b36c50bdd ixgbe: Allow flow hash to be set via ethtool
    ae23fc2b230a wifi: iwlwifi: mvm: check firmware response size
    ffdfaf27ebf1 wifi: iwlwifi: make the loop for card preparation effective
    3725b35fc0e5 md/raid10: fix memleak of md thread
    fb3f2f2fa0f3 md: update the optimal I/O size on reshape
    b6460f68c1cc md/raid10: fix memleak for 'conf->bio_split'
    8c5d5d7ffd1e md/raid10: fix leak of 'r10bio->remaining' for recovery
    1fee7e391d99 bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap
    d5fdcd2384ff nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage"
    b1e6b3fd1104 nvme: fix async event trace event
    eaaa0c6b0540 nvme: handle the persistent internal error AER
    c229821510df bpf, sockmap: fix deadlocks in the sockhash and sockmap
    74d90f92eafe scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup()
    01993768b3e7 crypto: drbg - Only fail when jent is unavailable in FIPS mode
    b21c7e28e801 crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors
    14efbe2499c1 bpftool: Fix bug for long instructions in program CFG dumps
    3e3533c56cf8 wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_reg()
    03109f1870e2 wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_rfreg()
    e163e64227ad rtlwifi: Replace RT_TRACE with rtl_dbg
    faec6b865468 rtlwifi: Start changing RT_TRACE into rtl_dbg
    7c5e804b6d52 f2fs: handle dqget error in f2fs_transfer_project_quota()
    7a2ae008a53c scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS
    a4245323d272 scsi: target: iscsit: Fix TAS handling during conn cleanup
    8e402d5198b3 net/packet: convert po->auxdata to an atomic flag
    f3ac72c7ab20 net/packet: convert po->origdev to an atomic flag
    4760229b820d net/packet: annotate accesses to po->xmit
    47464e0c658a vlan: partially enable SIOCSHWTSTAMP in container
    8f851a75bbc7 scm: fix MSG_CTRUNC setting condition for SO_PASSSEC
    7160c6940a97 wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()
    743ae09b28ce wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()
    72d5edceb2de tools: bpftool: Remove invalid \' json escape
    0d1792c98351 wifi: ath6kl: reduce WARN to dev_dbg() in callback
    8d17563174b0 wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()
    d98993186607 wifi: ath9k: hif_usb: fix memory leak of remain_skbs
    1286c4ce1f01 wifi: ath6kl: minor fix for allocation size
    a3e7a3d472c2 tick/common: Align tick period with the HZ tick.
    04be737176e6 tick: Get rid of tick_period
    3df29117d8a6 tick/sched: Optimize tick_do_update_jiffies64() further
    b6fe34d93655 tick/sched: Reduce seqcount held scope in tick_do_update_jiffies64()
    746eac77e008 tick/sched: Use tick_next_period for lockless quick check
    a23607579f12 timekeeping: Split jiffies seqlock
    22d7ec50ffdd debugobject: Prevent init race with static objects
    a687da500464 arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step
    442470948c04 x86/ioapic: Don't return 0 from arch_dynirq_lower_bound()
    824683dbec23 regulator: stm32-pwr: fix of_iomap leak
    53adb408b170 media: rc: gpio-ir-recv: Fix support for wake-up
    9df630dafa1a media: rcar_fdp1: Fix refcount leak in probe and remove function
    6fd6e2f29c18 media: rcar_fdp1: Fix the correct variable assignments
    75b55a3cbb4a media: rcar_fdp1: Make use of the helper function devm_platform_ioremap_resource()
    03d234459259 media: rcar_fdp1: fix pm_runtime_get_sync() usage count
    aebe8e43d85e media: rcar_fdp1: simplify error check logic at fdp_open()
    a4b6ab360f56 media: saa7134: fix use after free bug in saa7134_finidev due to race condition
    cd1583caed7e media: dm1105: Fix use after free bug in dm1105_remove due to race condition
    0c61a6897c47 x86/apic: Fix atomic update of offset in reserve_eilvt_offset()
    5224ea575196 regulator: core: Avoid lockdep reports when resolving supplies
    73b262115f5f regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
    9b53238b3be2 drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()
    0a6d476d9c9d mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
    f79421c36070 drm/msm/adreno: drop bogus pm_runtime_set_active()
    438d00b18d55 drm/msm/adreno: Defer enabling runpm until hw_init()
    594726c93841 drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}
    37c8085cf9c0 firmware: qcom_scm: Clear download bit during reboot
    620b983589e0 media: av7110: prevent underflow in write_ts_to_decoder()
    1205c52cf270 media: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.
    c6a315f0b140 media: bdisp: Add missing check for create_workqueue
    1a057b68952d ARM: dts: qcom: ipq8064: Fix the PCI I/O port range
    699bf5a793ca ARM: dts: qcom: ipq8064: reduce pci IO size to 64K
    1d207fcdf670 ARM: dts: qcom: ipq4019: Fix the PCI I/O port range
    e0162c92973b EDAC/skx: Fix overflows on the DRAM row address mapping arrays
    acb6f45775bb arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table
    0524eb688297 arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table
    a535b5d4a2c3 drm/probe-helper: Cancel previous job before starting new one
    4223f98d4d45 drm/vgem: add missing mutex_destroy
    8747cd580b59 drm/rockchip: Drop unbalanced obj unref
    9773c58594ff erofs: fix potential overflow calculating xattr_isize
    880c79bdb002 erofs: stop parsing non-compact HEAD index if clusterofs is invalid
    e998107daad2 tpm, tpm_tis: Do not skip reset of original interrupt vector
    1c131a32a9b5 selinux: ensure av_permissions.h is built when needed
    11458692ebd2 selinux: fix Makefile dependencies of flask.h
    823f554747f8 ubifs: Free memory for tmpfile name
    d3f1b113a503 ubi: Fix return value overwrite issue in try_write_vid_and_data()
    6f2eee5457bc ubifs: Fix memleak when insert_old_idx() failed
    2c2a76b7c4b5 Revert "ubifs: dirty_cow_znode: Fix memleak in error handling path"
    5d1f14beabab i2c: omap: Fix standard mode false ACK readings
    d482617fa662 KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted
    67d33b8c5696 reiserfs: Add security prefix to xattr name in reiserfs_security_write()
    2399b1fda025 ring-buffer: Sync IRQ works before buffer destruction
    a7fa8c9dc851 pwm: meson: Fix g12a ao clk81 name
    a3e0d3430f33 pwm: meson: Fix axg ao mux parents
    719459877d58 kheaders: Use array declaration instead of char
    4ec3be7003b6 ipmi: fix SSIF not responding under certain cond.
    bead854bcca2 ipmi:ssif: Add send_retries increment
    0f91290774c7 MIPS: fw: Allow firmware to pass a empty env
    3092933b2637 xhci: fix debugfs register accesses while suspended
    3c5a28658d12 debugfs: regset32: Add Runtime PM support
    2298b30010fd staging: iio: resolver: ads1210: fix config mode
    fbd11f086bf1 perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE)
    6525d2fd6f83 USB: dwc3: fix runtime pm imbalance on unbind
    2d5844aa6e56 USB: dwc3: fix runtime pm imbalance on probe errors
    0804f3715c09 asm-generic/io.h: suppress endianness warnings for readq() and writeq()
    944ff47a19f2 ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750
    f00e4bfd7f08 iio: adc: palmas_gpadc: fix NULL dereference on rmmod
    85ed09c33021 USB: serial: option: add UNISOC vendor and TOZED LT70C product
    48cdcb40d589 bluetooth: Perform careful capability checks in hci_sock_ioctl()
    c8258fc827c8 drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var
    425eea395f1f wifi: brcmfmac: slab-out-of-bounds read in brcmf_get_assoc_ies()
    3b7509b6f5e2 counter: 104-quad-8: Fix race condition between FLAG and CNTR reads

(From OE-Core rev: 1bef1a4cb24e49d23e4d84e05174e0ec1ec7cbe1)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Bruce Ashfield
19054d7f1b linux-yocto/5.4: update to v5.4.242
Updating  to the latest korg -stable release that comprises
the following commits:

    ea7862c507ec Linux 5.4.242
    d54a9f999ea7 ASN.1: Fix check for strdup() success
    2500d7edebfb iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger()
    760c2e6dee32 pwm: meson: Explicitly set .polarity in .get_state()
    7f2b8046da83 xfs: fix forkoff miscalculation related to XFS_LITINO(mp)
    c27a6bb1788f sctp: Call inet6_destroy_sock() via sk->sk_destruct().
    97ce6cde1f51 dccp: Call inet6_destroy_sock() via sk->sk_destruct().
    a01b75620e1a inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().
    9374db5bd1e3 tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct().
    2ac4697b7779 udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM).
    5a62248c5855 ext4: fix use-after-free in ext4_xattr_set_entry
    3b0044cb28f7 ext4: remove duplicate definition of ext4_xattr_ibody_inline_set()
    3c4fdbf368ba Revert "ext4: fix use-after-free in ext4_xattr_set_entry"
    ef2aab86c34c x86/purgatory: Don't generate debug info for purgatory.ro
    c22aefaef8ae MIPS: Define RUNTIME_DISCARD_EXIT in LD script
    a5167e902b64 mmc: sdhci_am654: Set HIGH_SPEED_ENA for SDR12 and SDR25
    1b8b54fc55a4 memstick: fix memory leak if card device is never registered
    5ad61a5268de nilfs2: initialize unused bytes in segment summary blocks
    988766b9d124 iio: light: tsl2772: fix reading proximity-diodes from device tree
    5cb867f1ecb4 xen/netback: use same error messages for same errors
    903f82b1a6b2 nvme-tcp: fix a possible UAF when failing to allocate an io queue
    34b74c32ff4f s390/ptrace: fix PTRACE_GET_LAST_BREAK error handling
    64cd99da25c1 net: dsa: b53: mmap: add phy ops
    89dcf0dd7aae scsi: core: Improve scsi_vpd_inquiry() checks
    f729b74bb489 scsi: megaraid_sas: Fix fw_crash_buffer_show()
    4f4ef354f95d selftests: sigaltstack: fix -Wuninitialized
    a725dddf2139 Input: i8042 - add quirk for Fujitsu Lifebook A574/H
    9df3f502e33d f2fs: Fix f2fs_truncate_partial_nodes ftrace event
    2f3730f182fc e1000e: Disable TSO on i219-LM card to increase speed
    0f0a291cc520 bpf: Fix incorrect verifier pruning due to missing register precision taints
    ba610df83b04 mlxfw: fix null-ptr-deref in mlxfw_mfa2_tlv_next()
    d8e120057cee i40e: fix i40e_setup_misc_vector() error handling
    59fba01b6c72 i40e: fix accessing vsi->active_filters without holding lock
    01125379e2dc netfilter: nf_tables: fix ifdef to also consider nf_tables=m
    7c1019391bd6 virtio_net: bugfix overflow inside xdp_linearize_page()
    35dceaeab97c net: sched: sch_qfq: prevent slab-out-of-bounds in qfq_activate_agg
    d61f24a45410 regulator: fan53555: Explicitly include bits header
    36f098e1e4d1 netfilter: br_netfilter: fix recent physdev match breakage
    375e445b1022 arm64: dts: meson-g12-common: specify full DMC range
    cb1f89fe934b ARM: dts: rockchip: fix a typo error for rk3288 spdif node

(From OE-Core rev: 012c751c14ad5cdd2ac8c868bf6e9a6ea4011789)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Bruce Ashfield
6b21362c83 linux-yocto/5.4: update to v5.4.241
Updating  to the latest korg -stable release that comprises
the following commits:

    58f42ed1cd31 Linux 5.4.241
    879593643717 xfs: force log and push AIL to clear pinned inodes when aborting mount
    c76dd368759a xfs: don't reuse busy extents on extent trim
    4679b73a8ed4 xfs: consider shutdown in bmapbt cursor delete assert
    9355fd118b4e xfs: shut down the filesystem if we screw up quota reservation
    48f75df5b3bb xfs: report corruption only as a regular error
    3cce34ceb2ef xfs: set inode size after creating symlink
    e76bd6da5123 xfs: fix up non-directory creation in SGID directories
    ad6613c98463 xfs: remove the di_version field from struct icdinode
    ca4533c951e1 xfs: simplify a check in xfs_ioctl_setattr_check_cowextsize
    e078b3de3e41 xfs: simplify di_flags2 inheritance in xfs_ialloc
    0c553917b61a xfs: only check the superblock version for dinode size calculation
    90aab52d062c xfs: add a new xfs_sb_version_has_v3inode helper
    edd36a57b4a6 xfs: remove the kuid/kgid conversion wrappers
    3ef81874f71c xfs: remove the icdinode di_uid/di_gid members
    cc508a41ae48 xfs: ensure that the inode uid/gid match values match the icdinode ones
    7a9dc7977140 xfs: merge the projid fields in struct xfs_icdinode
    4f3252e7e132 xfs: show the proper user quota options
    799cafa4f304 coresight-etm4: Fix for() loop drvdata->nr_addr_cmp range bug
    440bdc49f744 watchdog: sbsa_wdog: Make sure the timeout programming is within the limits
    70ca826d3ddb i2c: ocores: generate stop condition after timeout in polling mode
    5fb5bdcdcd5a ubi: Fix deadlock caused by recursively holding work_sem
    0b27716f2d44 mtd: ubi: wl: Fix a couple of kernel-doc issues
    e55588c44255 ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size
    a652c30fa2ba asymmetric_keys: log on fatal failures in PE/pkcs7
    5809dbacc431 verify_pefile: relax wrapper length check
    0213f027d030 drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F
    b3052e5d468b efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L
    02a78e653933 i2c: imx-lpi2c: clean rx/tx buffers upon new message
    1ef56397449e power: supply: cros_usbpd: reclassify "default case!" as debug
    7169d1638824 net: macb: fix a memory corruption in extended buffer descriptor mode
    c39fa0398a30 udp6: fix potential access to stale information
    9c46c49ad3ff RDMA/core: Fix GID entry ref leak when create_ah fails
    ad831a7079c9 sctp: fix a potential overflow in sctp_ifwdtsn_skip
    afffe0d1e6b9 qlcnic: check pci_reset_function result
    a841f6a0a39d niu: Fix missing unwind goto in niu_alloc_channels()
    fcd084e199b9 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
    1b77cb6f5e4a mtd: rawnand: stm32_fmc2: remove unsupported EDO mode
    4c1d882b53a3 mtd: rawnand: meson: fix bitmask for length in command word
    266746003439 mtdblock: tolerate corrected bit-flips
    50dbfd9dacda btrfs: fix fast csum implementation detection
    c6db5f2a31cd btrfs: print checksum type and implementation at mount time
    8a99e6200c38 Bluetooth: Fix race condition in hidp_session_thread
    c02421992505 Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}
    9025cea8e03b ALSA: hda/sigmatel: fix S/PDIF out on Intel D*45* motherboards
    4d419195d6b8 ALSA: firewire-tascam: add missing unwind goto in snd_tscm_stream_start_duplex()
    fe158eeccc38 ALSA: i2c/cs8427: fix iec958 mixer control deactivation
    aa23fa32e5ff ALSA: hda/sigmatel: add pin overrides for Intel DP45SG motherboard
    62ccf2e0b106 ALSA: emu10k1: fix capture interrupt handler unlinking
    9a3ba7b24d08 Revert "pinctrl: amd: Disable and mask interrupts on resume"
    2945f948aa84 irqdomain: Fix mapping-creation race
    e8f3aea716d2 irqdomain: Refactor __irq_domain_alloc_irqs()
    3804f265c1bf irqdomain: Look for existing mapping only once
    e7bba7ddb431 mm/swap: fix swap_info_struct race between swapoff and get_swap_pages()
    fd644712bccd ring-buffer: Fix race while reader and writer are on the same page
    c208b4321e8f drm/panfrost: Fix the panfrost_mmu_map_fault_addr() error path
    c381527918b1 net_sched: prevent NULL dereference if default qdisc setup failed
    987f599fc556 tracing: Free error logs of tracing instances
    d2136f05690c can: j1939: j1939_tp_tx_dat_new(): fix out-of-bounds memory access
    5a74a75fc3d3 ftrace: Mark get_lock_parent_ip() __always_inline
    95bbfeb4ff0e perf/core: Fix the same task check in perf_event_set_output
    666c25d35e5e ALSA: hda/realtek: Add quirk for Clevo X370SNW
    83b16a60e413 nilfs2: fix sysfs interface lifetime
    613bf23c070d nilfs2: fix potential UAF of struct nilfs_sc_info in nilfs_segctor_thread()
    aa8e50688d44 tty: serial: fsl_lpuart: avoid checking for transfer complete when UARTCTRL_SBK is asserted in lpuart32_tx_empty
    aabba4440409 tty: serial: sh-sci: Fix Rx on RZ/G2L SCI
    209ab5c234c5 tty: serial: sh-sci: Fix transmit end interrupt handler
    9a2a6443d655 iio: dac: cio-dac: Fix max DAC write value check for 12-bit
    e469ebb28dbe iio: adc: ti-ads7950: Set `can_sleep` flag for GPIO chip
    abc5b4f8cdff USB: serial: option: add Quectel RM500U-CN modem
    b9c11537efcf USB: serial: option: add Telit FE990 compositions
    38c00a22d67b usb: typec: altmodes/displayport: Fix configure initial pin assignment
    f417d3fea3de USB: serial: cp210x: add Silicon Labs IFS-USB-DATACABLE IDs
    47132be17d7b xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a passthrough iommu
    5fccf2c546ed NFSD: callback request does not use correct credential for AUTH_SYS
    3686380d9d60 sunrpc: only free unix grouplist after RCU settles
    1627119153d9 gpio: davinci: Add irq chip flag to skip set wake
    0cf600ca1bdf ipv6: Fix an uninit variable access bug in __ip6_make_skb()
    0443fff49d63 sctp: check send stream number after wait_for_sndbuf
    93f3885211ae net: don't let netpoll invoke NAPI if in xmit context
    0d2fa30078af icmp: guard against too small mtu
    a3593082e0da wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta
    4220f83b9f03 pwm: sprd: Explicitly set .polarity in .get_state()
    6e1f29397dea pwm: cros-ec: Explicitly set .polarity in .get_state()
    dbd764e9d422 pinctrl: amd: Disable and mask interrupts on resume
    dd7e19f97f71 pinctrl: amd: disable and mask interrupts on probe
    3f3e4bd3f0cc pinctrl: amd: Use irqchip template
    387236b9e002 smb3: fix problem with null cifs super block with previous patch
    2e64d7b182c6 treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()
    199197660bdd Revert "treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()"
    522af69af24f cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach()
    4311ae04b386 x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot
    110d425cdfb1 scsi: ses: Handle enclosure with just a primary component gracefully

(From OE-Core rev: 41eacaf738d753632fb17031e58dc898f2290a61)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Bruce Ashfield
aa9597253b linux-yocto/5.4: update to v5.4.240
Updating  to the latest korg -stable release that comprises
the following commits:

    32bea3bac5ca Linux 5.4.240
    4d4cb7663613 gfs2: Always check inode size of inline inodes
    928240c36891 firmware: arm_scmi: Fix device node validation for mailbox transport
    0f5c0e0a4c0b net: sched: fix race condition in qdisc_graft()
    22d95b544924 net_sched: add __rcu annotation to netdev->qdisc
    14b6ad56df25 ext4: fix kernel BUG in 'ext4_write_inline_data_end()'
    9b189af3577e btrfs: scan device in non-exclusive mode
    45a9877d6cc3 s390/uaccess: add missing earlyclobber annotations to __clear_user()
    0c6df5364798 drm/etnaviv: fix reference leak when mmaping imported buffer
    37958ac31fe2 ALSA: usb-audio: Fix regression on detection of Roland VS-100
    6dabafd82968 ALSA: hda/conexant: Partial revert of a quirk for Lenovo
    f3a67268784c NFSv4: Fix hangs when recovering open state after a server reboot
    c81e2965a9e0 pinctrl: at91-pio4: fix domain name assignment
    82c25ac3a258 xen/netback: don't do grant copy across page boundary
    99c8ba920fc2 Input: goodix - add Lenovo Yoga Book X90F to nine_bytes_report DMI table
    657d7c215ca9 cifs: fix DFS traversal oops without CONFIG_CIFS_DFS_UPCALL
    03af69bd674d cifs: prevent infinite recursion in CIFSGetDFSRefer()
    51d657371106 Input: focaltech - use explicitly signed char type
    f0f85f5e402b Input: alps - fix compatibility with -funsigned-char
    7e71d4d190df pinctrl: ocelot: Fix alt mode for ocelot
    70728d639efb net: mvneta: make tx buffer array agnostic
    704e06b97920 net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
    fd7cff506614 bnxt_en: Fix typo in PCI id to device description string mapping
    58279cea0b10 i40e: fix registers dump after run ethtool adapter self test
    5195de1d5f66 s390/vfio-ap: fix memory leak in vfio_ap device driver
    78bc7f0ab994 can: bcm: bcm_tx_setup(): fix KMSAN uninit-value in vfs_write
    105cc2683282 net/net_failover: fix txq exceeding warning
    e633fd26abfd regulator: Handle deferred clk
    be7b622cd63f regulator: fix spelling mistake "Cant" -> "Can't"
    46c4993a1514 ptp_qoriq: fix memory leak in probe()
    c122daa0fa4c scsi: megaraid_sas: Fix crash after a double completion
    317c07d382b1 mtd: rawnand: meson: invalidate cache on polling ECC bit
    d65de5ee8b72 mips: bmips: BCM6358: disable RAC flush for TP1
    9690e34f2247 dma-mapping: drop the dev argument to arch_sync_dma_for_*
    f6e2d76aa362 ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()
    856fb74f601a fbdev: au1200fb: Fix potential divide by zero
    deef33c08104 fbdev: lxfb: Fix potential divide by zero
    4f5cc5ffa8c5 fbdev: intelfb: Fix potential divide by zero
    868f247e47ef fbdev: nvidia: Fix potential divide by zero
    f3359f5fc9b7 sched_getaffinity: don't assume 'cpumask_size()' is fully initialized
    521877bf2651 fbdev: tgafb: Fix potential divide by zero
    7f12f99b8017 ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set()
    9155a5958ed0 ALSA: asihpi: check pao in control_message()
    88a3c63a9635 md: avoid signed overflow in slot_store()
    9966fc59d3a0 bus: imx-weim: fix branch condition evaluates to a garbage value
    d121f7883a17 fsverity: don't drop pagecache at end of FS_IOC_ENABLE_VERITY
    4c24eb49ab44 ocfs2: fix data corruption after failed write
    0c0e566f0387 tun: avoid double free in tun_free_netdev
    d253120a580a sched/fair: Sanitize vruntime of entity being migrated
    c23928c70bc8 sched/fair: sanitize vruntime of entity being placed
    885c28ceae7d dm crypt: add cond_resched() to dmcrypt_write()
    4a32a9a818a8 dm stats: check for and propagate alloc_percpu failure
    f8cbad984b16 i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer()
    8f5cbf6a8c0e nilfs2: fix kernel-infoleak in nilfs_ioctl_wrap_copy()
    4ae966a7f6a7 wifi: mac80211: fix qos on mesh interfaces
    f558789a886c usb: chipidea: core: fix possible concurrent when switch role
    6b3287b14739 usb: chipdea: core: fix return -EINVAL if request role is the same with current role
    0b2a56fe4659 usb: cdns3: Fix issue with using incorrect PCI device function
    e9e93fdfcefb dm thin: fix deadlock when swapping to thin device
    cd1e320ac095 igb: revert rtnl_lock() that causes deadlock
    123698a5c619 fsverity: Remove WQ_UNBOUND from fsverity read workqueue
    0eda2004f38d usb: gadget: u_audio: don't let userspace block driver unbind
    44f080d7d75a scsi: core: Add BLIST_SKIP_VPD_PAGES for SKhynix H28U74301AMR
    223274d5c310 cifs: empty interface list when server doesn't support query interfaces
    299a309b98df sh: sanitize the flags on sigreturn
    f4c610f6ca13 net: usb: qmi_wwan: add Telit 0x1080 composition
    e6b1fa6d0626 net: usb: cdc_mbim: avoid altsetting toggling for Telit FE990
    04f4a1aa9410 scsi: lpfc: Avoid usage of list iterator variable after loop
    11cdced6a03d scsi: ufs: core: Add soft dependency on governor_simpleondemand
    54ec697e3ca8 scsi: target: iscsi: Fix an error message in iscsi_check_key()
    97115221912c selftests/bpf: check that modifier resolves after pointer
    2100e374251a m68k: Only force 030 bus error if PC not in exception table
    d2b3bd0d4cad ca8210: fix mac_len negative array access
    9e7723b684c0 riscv: Bump COMMAND_LINE_SIZE value to 1024
    32518cd0fcc0 thunderbolt: Use const qualifier for `ring_interrupt_index`
    b40fe2e1f91b uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS583Gen 2
    9189f20b4c53 scsi: qla2xxx: Perform lockless command completion in abort path
    da0383f0e86c hwmon (it87): Fix voltage scaling for chips with 10.9mV ADCs
    13493ad6a220 platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl
    a18fb433ceb5 Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work
    b517808795d3 Bluetooth: btqcomsmd: Fix command timeout after setting BD address
    dcd4d3646221 net: mdio: thunder: Add missing fwnode_handle_put()
    707335918f73 hvc/xen: prevent concurrent accesses to the shared ring
    83e442eba39b nvme-tcp: fix nvme_tcp_term_pdu to match spec
    d673ae18406e net/sonic: use dma_mapping_error() for error check
    b72f453e886a erspan: do not use skb_mac_header() in ndo_start_xmit()
    82e07cc5a6ca atm: idt77252: fix kmemleak when rmmod idt77252
    fd6f643dea07 net/mlx5: Read the TC mapping of all priorities on ETS query
    d69c2ded95b1 bpf: Adjust insufficient default bpf_jit_limit
    97674f4cd05e keys: Do not cache key in task struct if key is requested from kernel thread
    f8ee2c8b0d0c net/ps3_gelic_net: Use dma_mapping_error
    6d7e18b1d00a net/ps3_gelic_net: Fix RX sk_buff length
    0e5c7d00ec4f net: qcom/emac: Fix use after free bug in emac_remove due to race condition
    a07ec453e86a xirc2ps_cs: Fix use after free bug in xirc2ps_detach
    42d72c6d1edc qed/qed_sriov: guard against NULL derefs from qed_iov_get_vf_info
    f2111c791d88 net: usb: smsc95xx: Limit packet length to skb->len
    5c4d71424df3 scsi: scsi_dh_alua: Fix memleak for 'qdata' in alua_activate()
    283fdc5cfbeb i2c: imx-lpi2c: check only for enabled interrupt flags
    90116b8289fd igbvf: Regard vf reset nack as success
    584771762c3e intel/igbvf: free irq on the error path in igbvf_request_msix()
    6999f854184e iavf: fix non-tunneled IPv6 UDP packet type and hashing
    4e752d2baea3 iavf: fix inverted Rx hash condition leading to disabled hash
    6fe078c2864b power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition
    754838aa0205 net: tls: fix possible race condition between do_tls_getsockopt_conf() and do_tls_setsockopt_conf()
    09b1a76e7879 Linux 5.4.239
    f0c95f229a67 selftests: Fix the executable permissions for fib_tests.sh

(From OE-Core rev: ff5d1f37b8a1bc7f51e95e5114890ee5185ff335)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Bruce Ashfield
c8d13f159e linux-yocto/5.4: update to v5.4.238
Updating  to the latest korg -stable release that comprises
the following commits:

    6849d8c4a61a Linux 5.4.238
    eb7716a054a6 HID: uhid: Over-ride the default maximum data buffer value with our own
    b687ac70e66a HID: core: Provide new max_buffer_size attribute to over-ride the default
    144019e81396 PCI: Unify delay handling for reset and resume
    d2130f37a4a0 s390/ipl: add missing intersection check to ipl_report handling
    3f5a833dca66 serial: 8250_em: Fix UART port type
    c5afb97d1b51 drm/i915: Don't use stolen memory for ring buffers with LLC
    8d26a4fecce5 x86/mm: Fix use of uninitialized buffer in sme_enable()
    a976ff743eb1 fbdev: stifb: Provide valid pixelclock and add fb_check_var() checks
    ac58b88ccbbb ftrace: Fix invalid address access in lookup_rec() when index is 0
    65e4c9a6d0c9 KVM: nVMX: add missing consistency checks for CR0 and CR4
    6fe55dce9dd6 tracing: Make tracepoint lockdep check actually test something
    780f69a2685b tracing: Check field value in hist_field_name()
    f1e3a20c6019 interconnect: fix mem leak when freeing nodes
    325608ab60fa tty: serial: fsl_lpuart: skip waiting for transmission complete when UARTCTRL_SBK is asserted
    c16cbd8233d6 ext4: fix possible double unlock when moving a directory
    6a1bd14d5e34 sh: intc: Avoid spurious sizeof-pointer-div warning
    bbf5eada4334 drm/amdkfd: Fix an illegal memory access
    2c96c52aeaa6 ext4: fix task hung in ext4_xattr_delete_inode
    20ba6f8a8073 ext4: fail ext4_iget if special inode unallocated
    ab519e29891d jffs2: correct logic when creating a hole in jffs2_write_begin
    00bfc67c65a1 mmc: atmel-mci: fix race between stop command and start of next command
    75f6faae2de6 media: m5mols: fix off-by-one loop termination error
    9eb394919c97 hwmon: (ina3221) return prober error code
    26c176ce9028 hwmon: (xgene) Fix use after free bug in xgene_hwmon_remove due to race condition
    13efd488d398 hwmon: (adt7475) Fix masking of hysteresis registers
    0d3095e958f0 hwmon: (adt7475) Display smoothing attributes in correct order
    674fce59d61d ethernet: sun: add check for the mdesc_grab()
    71da5991b643 net/iucv: Fix size of interrupt data
    e0d07a3203c3 net: usb: smsc75xx: Move packet length check to prevent kernel panic in skb_pull
    5c06bd3de134 ipv4: Fix incorrect table ID in IOCTL path
    c4fcfbf80c3c block: sunvdc: add check for mdesc_grab() returning NULL
    04c394208831 nvmet: avoid potential UAF in nvmet_req_complete()
    9fabdd79051a net: usb: smsc75xx: Limit packet length to skb->len
    b0c202a8dc63 nfc: st-nci: Fix use after free bug in ndlc_remove due to race condition
    668de67d4110 net: phy: smsc: bail out in lan87xx_read_status if genphy_read_status fails
    5aaab217c8f5 net: tunnels: annotate lockless accesses to dev->needed_headroom
    cba20ade78ef qed/qed_dev: guard against a possible division by zero
    6e18f66b704b i40e: Fix kernel crash during reboot when adapter is in recovery mode
    f0216046aeb8 ipvlan: Make skb->skb_iif track skb->dev for l3s mode
    0f9c1f26d434 nfc: pn533: initialize struct pn533_out_arg properly
    442aa78ed701 tcp: tcp_make_synack() can be called from process context
    88c3d3bb6469 scsi: core: Fix a procfs host directory removal regression
    4b4f5e34f08b scsi: core: Fix a comment in function scsi_host_dev_release()
    0d59732f2a5b netfilter: nft_redir: correct value of inet type `.maxattrs`
    90279211e96b ALSA: hda: Match only Intel devices with CONTROLLER_IN_GPU()
    0b7057c52377 ALSA: hda: Add Intel DG2 PCI ID and HDMI codec vid
    5bb9fcaadb8c ALSA: hda: Add Alderlake-S PCI ID and HDMI codec vid
    9efbdc743ded ALSA: hda - controller is in GPU on the DG1
    fc52e51c2c30 ALSA: hda - add Intel DG1 PCI and HDMI ids
    090305c36185 scsi: mpt3sas: Fix NULL pointer access in mpt3sas_transport_port_add()
    b8849e31a056 docs: Correct missing "d_" prefix for dentry_operations member d_weak_revalidate
    9e45e4571576 clk: HI655X: select REGMAP instead of depending on it
    dac08e46f0ad drm/meson: fix 1px pink line on GXM when scaling video overlay
    d7e48aa17a81 cifs: Move the in_send statistic to __smb_send_rqst()
    06c208002d0d drm/panfrost: Don't sync rpm suspension after mmu flushing
    c9900d1d86f0 xfrm: Allow transport-mode states with AF_UNSPEC selector
    4008fb9ad474 ext4: fix cgroup writeback accounting with fs-layer encryption

(From OE-Core rev: 175d05d717b972d9b6bf36f170bc6cfa69b57dce)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Vijay Anusuri
311a1d5935 go: Security fix CVE-2023-24540
Upstream-Status: Backport [ce7bd33345]

(From OE-Core rev: e569586ac9095d344967c5b9c4bfb07f70948936)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Ashish Sharma
7a5aa92590 golang: Fix CVE-2023-24539
Improper sanitization of CSS values in html/template

(From OE-Core rev: 737333d41d245154eb4b26ec8db79a2f9823c873)

Signed-off-by: Ashish Sharma <asharma@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Vijay Anusuri
09a8d85815 xserver-xorg: Security fix CVE-2023-0494 and CVE-2023-1393
Upstream-Status: Backport
[0ba6d8c370
&
26ef545b35]

(From OE-Core rev: 0a29894da0b41f8494f72ded25916887b4a5c729)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Vijay Anusuri
34d7cb536a ghostscript: Fix CVE-2023-28879
Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;h=37ed5022cecd584de868933b5b60da2e995b3179]

(From OE-Core rev: ec0c6f941826903b763be76c450f1d4e0e67908e)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:11 -10:00
Nikhil R
f51b7f407d ffmpeg: Fix CVE-2022-48434
Add a patch to fix CVE-2022-48434 which allows attackers to trigger a
use-after-free and execute arbitrary code in some circumstances

Link: https://ubuntu.com/security/CVE-2022-48434
Link: https://nvd.nist.gov/vuln/detail/CVE-2022-48434

(From OE-Core rev: 51c8ffc49d03b231ce76fa00f923e5f3f833f6fc)

Signed-off-by: Nikhil R <nikhilar2410@gmail.com>
Signed-off-by: Ranjitsinh Rathod ranjitsinh.rathod@kpit.com
Signed-off-by: Nikhil R <nikhilar2410@gmail.com>
Signed-off-by: Nikhil R <nikhilar2410@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-13 04:00:10 -10:00
Steve Sakoman
cd4656d9b2 selftest: skip virgl test on ubuntu 22.10, fedora 37, and all rocky
This test will fail any time the host has libdrm > 2.4.107

(From OE-Core rev: e4b98a42970574296e0da06842691b9fc1ffc9a1)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Thomas Roos
602a3ebec7 oeqa/utils/metadata.py: Fix running oe-selftest running with no distro set
This will use default values when no distribution is set.

[YOCTO #15086]

(From OE-Core rev: 1a28c6cfe0e6c4b44d01778f8034231040c6d4ad)

Signed-off-by: Thomas Roos <throos@amazon.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
(cherry picked from commit 888fe63b46efceeff08dbe8c4f66fec33d06cb7a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Martin Jansa
7edbc14f1a populate_sdk_ext.bbclass: set METADATA_REVISION with an DISTRO override
* otherwise it ends '<unknown>' inside esdk, because of parsing order:
  # $METADATA_REVISION [3 operations]
  #   set /OE/build/test-D/conf/local.conf:43
  #     "f2da54ef432eac89b0f18eaad68e602b6990b5de"
  #   immediate /OE/build/test-D/layers/poky/meta/classes/metadata_scm.bbclass:9
  #     "${@oe.buildcfg.detect_revision(d)}"
  #   set /OE/build/test-D/layers/poky/meta/classes/metadata_scm.bbclass:10
  #     [vardepvalue] "${METADATA_REVISION}"
  # pre-expansion value:
  #   "<unknown>"
  METADATA_REVISION="<unknown>"

* This causes base-files.do_install and following tasks to have different
  signatures between esdk and the build directory where this esdk was created:

  bitbake-diffsigs {test-D,poky/build-uninative-disabled}/tmp/stamps/qemux86_64-poky-linux/base-files/*do_install*sigdata*
  NOTE: Starting bitbake server...
  basehash changed from 5b6981cf58bfd57d416b0e31611b73a26baae635dd1ac31c08d46f95064c3ffc to dbdce042da4d7813d632b6d1cc87a16f728ad20e55fecbc392830e6acf72babd
  Variable METADATA_REVISION value changed from '<unknown>' to 'f2da54ef432eac89b0f18eaad68e602b6990b5de'

  and an warning from "python3 /OE/build/test-D/ext-sdk-prepare.py" when eSDK is being prepared for use:
  WARNING: The base-files:do_install sig is computed to be 83b9c9a6ef1145baac5a1e0d08814b9156af239c58fc42df95c25a9cd8a7f201,
    but the sig is locked to 3dc22233059075978e5503691e98e79e7cc60db94259dfcd886bca2291c0add7 in SIGGEN_LOCKEDSIGS_t-qemux86-64

[RP: Add commit about why we need the override for future reference]
(From OE-Core rev: 8f0e2e505d11697d0a1280b0a77a3fe8d72a4d49)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
(cherry picked from commit 675ea7281c17f77bf5dea17cfd4d9da0928382a0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Randolph Sapp
b2cec0246c wic/bootimg-efi: if fixed-size is set then use that for mkdosfs
This is a bit of a compatibility issue more than anything. Some devices
get upset if the FAT file system contains less blocks than the
partition.

The fixed-size argument is currently respected by the partition creation
step but not by the file system creation step. Let's make it so the file
system respects this value as well.

(From OE-Core rev: 2126242c19b0c3dea12c605da8b24b08a9cb803f)

Signed-off-by: Randolph Sapp <rs@ti.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit d16301ccdfb97bf126738262eec594008c282df1)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Khem Raj
2aeb276dd5 perf: Depend on native setuptools3
perf has need for python setuptools when scripting is enabled
from 6.0.0 onwards it seems to throw an explicit error

(From OE-Core rev: cfdaa6afaca28dd91c9738a97bb21eab5dae2817)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit da3d00178809bbf7cc453401e0c5937796ebc2c1)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Marek Vasut
37a03beb6d cpio: Fix wrong CRC with ASCII CRC for large files
Due to signedness, the checksum is not computed when filesize is bigger
a 2GB. Pick a fix for this problem from CPIO ML, where the fix has been
posted for 5 years. Since CPIO upstream is effectively unresponsive and
any and all attempts to communicate with the maintainer and get the fix
applied upstream failed, add the fix here instead.

(From OE-Core rev: bfff138af4bdd356ac66571e6ad91c1a5599b935)

(From OE-Core rev: 0a8fb1c00e75e8434e0ef433d9074d54f038fba1)

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Dmitry Baryshkov
f8902083fd linux-firmware: upgrade 20230210 -> 20230404
The LICENCE.qat_firmware license file was updated to reflect Intel
licensing (it removed a term regarding patent licenses).

License-Update: additional files

(From OE-Core rev: 0a6a31e24414e156e005ef1d6a72ff668d83796a)

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
(cherry picked from commit fd43b59ab32e2115fcda7ad63d3a5ccc2683c7d5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Alex Kiernan
6828c2c8db pypi.bbclass: Set CVE_PRODUCT to PYPI_PACKAGE
The CVE product name for PyPI packages is (usually) the same as the PyPI
package name (and not our recipe name), so use that as the default.

(From OE-Core rev: 1c37b96cd4fdfad21bf24b8b883e371c3bca56de)

Signed-off-by: Alex Kiernan <alexk@zuma.ai>
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 61f6b0ad09bf87cdc2d3f08770b7c44cad1d0e58)
Signed-off-by: Sanjay Chitroda <schitrod@cisco.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Siddharth
ed5cd048ae curl: ammend fix for CVE-2023-27534 to fix error when ssh is enabled
The upstream patch for CVE-2023-27534 does three things:
1) creates new path with dynbuf(dynamic buffer)
2) solves the tilde error which causes CVE-2023-27534
3) modifies the below added functionality to not add a trailing "/" to the user home dir if it already ends with one with dynbuf.

dynbuf functionalities are added in curl in later versions and are not essential to fix the vulnerability but does add extra feature in later versions.
This patch completes the 3rd task of the patch which was implemented without using dynbuf

Upstream-Status: Backport from [6c51adeb71]

(From OE-Core rev: df489f644e41108cf0e2ff55af7ce5e9bca40471)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Hitendra Prajapati
1824a583fa git: fix CVE-2023-25652
Git is a revision control system. Prior to versions 2.30.9, 2.31.8, 2.32.7,
2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1, by feeding
specially crafted input to `git apply --reject`, a path outside the working
tree can be overwritten with partially controlled contents (corresponding to
the rejected hunk(s) from the given patch). A fix is available in versions
2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3,
and 2.40.1. As a workaround, avoid using `git apply` with `--reject` when applying
patches from an untrusted source. Use `git apply --stat` to inspect a patch before
applying; avoid applying one that create a conflict where a link corresponding to
the `*.rej` file exists.

References:
https://nvd.nist.gov/vuln/detail/CVE-2023-25652

Upstream-Status: Backport from 9db05711c9

(From OE-Core rev: 6747482316b8f7839a09bf041d8c11b559f84b44)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:26 -10:00
Hitendra Prajapati
967c2d4145 git: fix CVE-2023-29007
Git is a revision control system. Prior to versions 2.30.9, 2.31.8, 2.32.7, 2.33.8,
2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1, a specially crafted
`.gitmodules` file with submodule URLs that are longer than 1024 characters can used
to exploit a bug in `config.c::git_config_copy_or_rename_section_in_file()`. This bug
can be used to inject arbitrary configuration into a user's `$GIT_DIR/config` when
attempting to remove the configuration section associated with that submodule. When the
attacker injects configuration values which specify executables to run (such as
`core.pager`, `core.editor`, `core.sshCommand`, etc.) this can lead to a remote code
execution. A fix A fix is available in versions 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8,
2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1. As a workaround, avoid running
`git submodule deinit` on untrusted repositories or without prior inspection of any
submodule sections in `$GIT_DIR/config`.

References:
https://nvd.nist.gov/vuln/detail/CVE-2023-29007

Upstream patches:
528290f8c6
29198213c9
a5bb10fd5e
e91cfe6085
3bb3d6bac5

(From OE-Core rev: db4c152441aebe4c04a7bb7aceb88d8941a6576b)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-25 05:49:25 -10:00
Arturo Buzarra
a540df3791 run-postinsts: Set dependency for ldconfig to avoid boot issues
If a package with a postsints script requires ldconfig, the package class adds
a ldconfig postinst fragment to initialize it before. Systemd has its own
ldconfig.service to initialize it and sometimes if both services are running
at the same time in the first boot, the first one will work, but the second
one will fail with the following error:

    ldconfig[141]: /sbin/ldconfig: Renaming of /etc/ld.so.cache~ to /etc/ld.so.cache failed: No such file or directory

This commit adds a ordering dependency between them to make sure that only one
service is running at the same time.

(From OE-Core rev: 1bc254e7969f3d5470bacf9ad9f065d38b7b7fde)

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4e9d812e127dc6743f52f4881e509e8e2e833afe)
Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Ranjitsinh Rathod
eda8a27490 libbsd: Add correct license for all packages
BSD-4-Clause is only applicable to the {PN}-doc package as when I
check for the source code I find below files which only uses the
license BSD-4-Clause

~/sources/libbsd$ grep -rl "All advertising materials mentioning features or use of this software" *|grep -v \.1|grep -v \.5|grep -v \.8 | sort
COPYING
man/arc4random.3bsd
man/getprogname.3bsd
man/tree.3bsd

~/sources/libbsd$ grep -rnB6 "BSD-4"
COPYING-9-Files:
COPYING-10- man/arc4random.3bsd
COPYING-11- man/tree.3bsd
COPYING-12-Copyright:
COPYING-13- Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
COPYING-14- All rights reserved.
COPYING:15:License: BSD-4-clause-Niels-Provos

(From OE-Core rev: 187f1588240a0eb5cc753c2114fd6c0cef66e14f)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Yoann Congal
397d3430bf linux-yocto: Exclude 294 CVEs already fixed upstream
Exclude CVEs that are fixed in current linux-yocto version v5.4.237.

To get the commit fixing a CVE, I used the Debian kernel-sec repo [1].

[1]: 86d5040aee

(From OE-Core rev: ec0f3e5869c596a308a164f93cb031e04034a8ed)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Ashish Sharma
f5051dae9f connman: Fix CVE-2023-28488 DoS in client.c
Avoid overwriting the read packet length after the initial test. Thus
move all the length checks which depends on the total length first
and do not use the total lenght from the IP packet afterwards.

Fixes CVE-2023-28488

Reported by Polina Smirnova <moe.hwr@gmail.com>

(From OE-Core rev: 47a9ae5592392bd10740e4571b06c8c739705058)

Signed-off-by: Ashish Sharma <asharma@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Peter Marko
97ffdc1519 libxml2: patch CVE-2023-28484 and CVE-2023-29469
Backports from:
* e4f85f1bd2
* 547edbf1cb

(From OE-Core rev: c0cfcd3945257efd40745e0ebb84495441acb590)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Vivek Kumbhar
f668b3ab56 freetype: fix CVE-2023-2004 integer overflowin in tt_hvadvance_adjust() in src/truetype/ttgxvar.c
Fix An integer overflow vulnerability was discovered in Freetype in tt_hvadvance_adjust() function in src/truetype/ttgxvar.c

(From OE-Core rev: 24c87e674db9c1d4a8922c3af78a0004c061e70f)

Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Shubham Kulkarni
79dcce4413 go: Security fix for CVE-2023-24538
html/template: disallow actions in JS template literals

Backport from b1e3ecfa06

(From OE-Core rev: c8a597b76505dab7649f4c9b18e1e14b0e3d57af)

Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-16 06:18:21 -10:00
Steve Sakoman
a631bfc3a3 build-appliance-image: Update to dunfell head revision
(From OE-Core rev: fd4cc8d7b5156c43d162a1a5a809fae507457ef4)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 12:31:05 -10:00
Steve Sakoman
ee461b4235 poky.conf: bump version for 3.1.25
(From meta-yocto rev: 0faaa6c13564565a5fe7f7ff00000c146c511cc4)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:12:38 -10:00
Steve Sakoman
68801aaf80 documentation: update for 3.1.25
(From yocto-docs rev: 19b7932e6af89943b899687c1f5cb91181cd3580)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Christoph Lauer
38f85fe6dd populate_sdk_base: add zip options
Add SDK_ZIP_OPTIONS to remove symbolic link creation in zip archive or add options, e.g. for encryption of the zip archive.

(From OE-Core rev: 04b62f9459b401c276255f166d0738b6f902a576)

(From OE-Core rev: b9e0c3ced645cab74b2488a26b8f656a94b2a6f5)

Signed-off-by: Christoph Lauer <christoph.lauer@xtronic.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Vivek Kumbhar
62034cd625 go: fix CVE-2023-24534 denial of service from excessive memory allocation
A parsed MIME header is a map[string][]string. In the common case,
a header contains many one-element []string slices. To avoid
allocating a separate slice for each key, ReadMIMEHeader looks
ahead in the input to predict the number of keys that will be
parsed, and allocates a single []string of that length.
The individual slices are then allocated out of the larger one.

The prediction of the number of header keys was done by counting
newlines in the input buffer, which does not take into account
header continuation lines (where a header key/value spans multiple
lines) or the end of the header block and the start of the body.
This could lead to a substantial amount of overallocation, for
example when the body consists of nothing but a large block of
newlines.

Fix header key count prediction to take into account the end of
the headers (indicated by a blank line) and continuation lines
(starting with whitespace).

Thanks to Jakob Ackermann (@das7pad) for reporting this issue.

Fixes CVE-2023-24534
For #58975
Fixes #59267

(From OE-Core rev: daa6aa9c7198a07322f1828a9db457fec86191cf)

Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Vijay Anusuri
87a450e222 curl: Security fix CVE-2023-27533, CVE-2023-27535 and CVE-2023-27536
Upstream-Status: Backport [https://git.launchpad.net/ubuntu/+source/curl/tree/debian/patches?h=ubuntu/focal-security & 538b1e79a6 & ed5095ed94 & f18af4f874 & 8f4608468b & cb49e67303]

(From OE-Core rev: 08ffa2437967a642a4c8e35e2158bb369454764a)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Virendra Thakur
d58a0c3239 qemu: Whitelist CVE-2023-0664
This CVE is related to Windows.

Link: https://nvd.nist.gov/vuln/detail/CVE-2023-0664

(From OE-Core rev: 8efb0fc7e7db4bad3dbc40d8f890a6c2e7be38fa)

Signed-off-by: Virendra Thakur <virendrak@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Omkar Patil
667eb766ab openssl: Fix CVE-2023-0466
Add patch to fix CVE-2023-0466

Link: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=0d16b7e99aafc0b4a6d729eec65a411a7e025f0a

(From OE-Core rev: a80d772593b3a38c062e546557d5f8d76eb71fe4)

Signed-off-by: Omkar Patil <omkar.patil@kpit.com>
Signed-off-by: Omkar Patil <omkarpatil10.93@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Omkar Patil
56c03791cd openssl: Fix CVE-2023-0465
Add patch to fix CVE-2023-0465

Link: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=b013765abfa80036dc779dd0e50602c57bb3bf95

(From OE-Core rev: cbca55301bb065a6506e65cf64cc90b598e39789)

Signed-off-by: Omkar Patil <omkar.patil@kpit.com>
Signed-off-by: Omkar Patil <omkarpatil10.93@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Nikhil R
acd638685c openssl: Fix CVE-2023-0464
Fix CVE-2023-0464 for openssl

A security vulnerability has been identified in all supported versions
of OpenSSL related to the verification of X.509 certificate chains
that include policy constraints.  Attackers may be able to exploit
this vulnerability by creating a malicious certificate chain that
triggers exponential use of computational resources, leading
to a denial-of-service(DoS) attack on affected systems.

Link: https://git.openssl.org/gitweb/?p=openssl.git;a=patch;h=879f7080d7e141f415c79eaa3a8ac4a3dad0348b

(From OE-Core rev: 0c50550e2c8fca3263776c2bb985a8c58b920b99)

Signed-off-by: Nikhil R <nikhil.r@kpit.com>
Signed-off-by: Omkar Patil <omkarpatil10.93@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Shubham Kulkarni
a4f1c6baa3 go: Ignore CVE-2022-1705
The vulnerability was introduced in go1.15beta1 with commit d5734d4.
Dunfell uses go1.14 version which does not contain the affected code.

Ref: https://security-tracker.debian.org/tracker/CVE-2022-1705

(From OE-Core rev: 6e4a952efc94a3bb94216db1cbd738f4fb70217f)

Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Vijay Anusuri
799673e3f4 sudo: Security fix for CVE-2023-28486 and CVE-2023-28487
import patches from ubuntu to fix
 CVE-2023-28486
 CVE-2023-28487

Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/sudo/tree/debian/patches?h=ubuntu/focal-security
Upstream commit 334daf92b3 & 12648b4e0a]

(From OE-Core rev: 4870543273bef9831c075ee0bce108c54355a92f)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-03 04:09:42 -10:00
Steve Sakoman
6fd646cdb1 bitbake: tests/fetch.py: fix link to project documentation
(Bitbake rev: e16a9ca7e9286790ac37a067fdc8fde3a35a1c44)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-02 11:18:39 +01:00
Vivek Kumbhar
538185bd1c go: fix CVE-2023-24537 Infinite loop in parsing
Setting a large line or column number using a //line directive can cause
integer overflow even in small source files.

Limit line and column numbers in //line directives to 2^30-1, which
is small enough to avoid int32 overflow on all reasonbly-sized files.

(From OE-Core rev: d1943e6a0ec00653c81cd4c0bb0d6b7e0909094c)

Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:07 -10:00
Shubham Kulkarni
6dd6670429 go: Security fix for CVE-2020-29510
encoding/xml: replace comments inside directives with a space

Backport from a9cfd55e2b

(From OE-Core rev: 76d855f3d2c250ac85ca6f24bf0e178fb32607f9)

Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:07 -10:00
Hitendra Prajapati
51a1d78e2a screen: CVE-2023-24626 allows sending SIGHUP to arbitrary PIDs
Upstream-Status: Backport from https://git.savannah.gnu.org/cgit/screen.git/commit/?id=e9ad41bfedb4537a6f0de20f00b27c7739f168f7

(From OE-Core rev: d1f99b928b0a57bec879dde1b1b94c3c09286ea0)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:06 -10:00
Peter Marko
e610a24db7 go: ignore CVE-2022-41716
This CVE is specific to Microsoft Windows, ignore it.

Patch fixing it (https://go-review.googlesource.com/c/go/+/446916)
also adds a redundant check to generic os/exec which
could be backported but it should not be necessary as
backport always takes a small risk to break old code.

(From OE-Core rev: 4263f3fda59aacb4f159d2dffb52e5f66249b5e4)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:06 -10:00
rajmohan r
afb4425be9 systemd: Fix CVE-2023-26604
Below patch files to fix CVE-2023-26604
CVE-2023-26604-1.patch, CVE-2023-26604-2.patch and
CVE-2023-26604-3.patch and CVE-2023-26604-4.patch

make pager secure when under euid is changed or explicitly
requested

Reference:
CVE-2023-26604-1.patch:
612ebf6c91
CVE-2023-26604-2.patch:
1b5b507cd2
CVE-2023-26604-3.patch:
0a42426d79
CVE-2023-26604-4.patch:
b8f736b30e

(From OE-Core rev: 7880eb801dcee44a9e8920d249057492d1de6b12)

Signed-off-by: rajmohan r <rajmohan.r@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:06 -10:00
Shubham Kulkarni
20c932eb01 go-runtime: Security fix for CVE-2022-41722
path/filepath: do not Clean("a/../c:/b") into c:\b on Windows

Backport from bdf07c2e16

(From OE-Core rev: 70135bf04eb7173434a7240ddf11639d13aab003)

Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:06 -10:00
Hitendra Prajapati
e0d5b78c92 curl: CVE-2023-27538 fix SSH connection too eager reuse
Upstream-Status: Backport from af369db4d3

(From OE-Core rev: b2740d1ff74b2c55011b5d4230c7b06b5109376d)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-26 04:19:06 -10:00
Hitendra Prajapati
00af542d30 curl: CVE-2023-27534 SFTP path ~ resolving discrepancy
Upstream-Status: Backport from 4e2b52b5f7

(From OE-Core rev: 9aefb4e46cf4fbf14b46f9adaf3771854553e7f3)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-19 04:32:59 -10:00
Hitendra Prajapati
bcb3c107d3 ruby: CVE-2023-28756 ReDoS vulnerability in Time
Upstream-Status: Backport from 957bb7cb81

(From OE-Core rev: 52d26edffdd0444588ecad56b40a65e225889a01)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-19 04:32:59 -10:00
Gaurav Gupta
a526ef88ee qemu: fix build error introduced by CVE-2021-3929 fix
The patch for CVE-2021-3929 applied on dunfell returns a value for a
void function. This results in the following compiler warning/error:

hw/block/nvme.c:77:6: error: void function
'nvme_addr_read' should not return a value [-Wreturn-type]

return NVME_DATA_TRAS_ERROR;
^      ~~~~~~~~~~~~~~~~~~~~

In newer versions of qemu, the functions is changed to have a return
value, but that is not present in the version of qemu used in “dunfell”.

Backport some of the patches to correct this.

(From OE-Core rev: 4ad98f0b27615ad59ae61110657cf69004c61ef4)

Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-19 04:32:59 -10:00
Bhabu Bindu
0c1e54eee1 ffmpeg: fix for CVE-2022-3341
avformat/nutdec: Add check for avformat_new_stream
Check for failure of avformat_new_stream() and propagate
the error code.

Upstream-Status: Backport [https://git.yoctoproject.org/poky/commit/?h=kirkstone&id=bba70ce34115151362bfdc49a545ee708eb297ca]

(From OE-Core rev: e17ddd0fafb562ed7ebe7708dac9bcef2d6cecc1)

(From OE-Core rev: 0c68435a7c0ff1c417119dbd408e75443c09afcb)

Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bba70ce341)
Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-19 04:32:59 -10:00
Martin Jansa
fcb3d9a63e bmap-tools: switch to main branch
* master branch was removed upstream:
  downloads/git2/github.com.intel.bmap-tools $ git remote prune origin
  Pruning origin
  URL: https://github.com/intel/bmap-tools
   * [pruned] refs/heads/master
   * [pruned] refs/pull/73/merge

* downloads/git2/github.com.intel.bmap-tools $ git branch -a --contains c0673962a8ec1624b5189dc1d24f33fe4f06785a
  main
  release-3.0

(From OE-Core rev: 4045bf02bbc6e87a05ba689a63c675e49c940772)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 369fee186d6916322b9be9d936b654d0c5910cb3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Randy MacLeod
79b0cf9cfa vim: upgrade 9.0.1403 -> 9.0.1429
Fixes: CVE-2023-1127, CVE-2023-1170, CVE-2023-1175,
       CVE-2023-1264, CVE-2023-1355

(From OE-Core rev: 821229f48f5b31aeb646f08c7e4656dc4ce8b0f4)

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 2415072c3800feb164dd4d1fa0b56bd141a5cbd8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Geoffrey GIRY
d8057ae9aa cve-check: Fix false negative version issue
NVD DB store version and update in the same value, separated by '_'.
The proposed patch check if the version from NVD DB contains a "_",
ie 9.2.0_p1 is convert to 9.2.0p1 before version comparison.

[YOCTO #14127]

Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr>
(From OE-Core rev: eb439b1283b60e6665694ff28c89fbd633eda6b0)

Signed-off-by: Geoffrey GIRY <geoffrey.giry@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 7d00f6ec578084a0a0e5caf36241d53036d996c4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Hitendra Prajapati
5150ad7fcb qemu: fix compile error which imported by CVE-2022-4144
Upstream-Status: Backport from https://github.com/qemu/qemu/commit/61c34fc && 8efec0ef8b

(From OE-Core rev: d17f4c741c66268ce54ff89be2be9b0402c98df2)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Vijay Anusuri
8064d53745 git: Security fix for CVE-2023-22490 and CVE-2023-23946
Upstream-Status: Backport from
58325b93c5
&
cf8f6ce02a
& bffc762f87

(From OE-Core rev: 071fb3b177bcbdd02ae2c28aad97af681c091e42)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Shubham Kulkarni
8ed92cf2b3 go-runtime: Security fix for CVE-2022-41723
Disable cmd/internal/moddeps test, since this update includes PRIVATE
track fixes.

Backport from 5c3e11bd0b

(From OE-Core rev: 53a303fb5908edaf29e35abb08fff93e7c0ff92c)

Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Hitendra Prajapati
ba7aa15473 curl: CVE-2023-23916 HTTP multi-header compression denial of service
Upstream-Status: Backport from 119fb18719

(From OE-Core rev: b121b59cf6f642f46c97c96f3c4cf4cd84ff2af5)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-04-14 05:44:12 -10:00
Joshua Watt
a307ef21c1 classes/package: Use gzip for extended package data
The master version of extended package data uses zstd for efficient
compression, but it relies on the zstd tool to be present on the host
system. Since dunfell supports older distros, we don't want to add this
tool as an additional requirement so switch to using gzip instead.

(From OE-Core rev: 1c7d555379c4b0962bccd018870989050d87675f)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Joshua Watt
006f140687 create-spdx: Use gzip for compression
The master version of the SPDX classes uses zstd for efficient
compression, but it relies on the zstd tool to be present on the host
system. Since dunfell supports older distros, we don't want to add this
tool as an additional requirement so switch to using gzip instead.

(From OE-Core rev: 55b08fd641767a3d2e080727828ca37d9e610109)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Joshua Watt
77e8b40bae licenses: Add GPL+ licenses to map
Adds some missing licenses mappings related to the "+" versions of the
GPL licenses

(From OE-Core rev: 5f9a8809acf1ab4e73c3085b8fd100f4568ebd86)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Joshua Watt
3cf950b245 classes/package: Add extended packaged data
Adds extended package data which is encoded as JSON which allows it to
encode more structure than the "flat" package data files. The extended
data might be much larger than the standard package data, so it is not
read by default and instead requires
oe.packagedata.read_subpkgdata_extended() to be called

Currently, the file sizes and ELF debug sources are saved off into the
extended package data

(cherry picked from commit db9cf430e54ae68da80fbc3fba80ce88d8df164d)

(From OE-Core rev: 2318cb79ef1652fb19d696a8d43826e39c22834e)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Saul Wold <saul.wold@windriver.com>
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Joshua Watt
7e24067f78 classes/create-spdx: Backport
Backports the create-spdx classes from the latest versions on master.
This backport is a simple copy with no modifications, as its too
complex to cherry-pick all the corresponding changes. This will give an
appropriate base commit for subsequent changes and if necessary
additional backport cherry-picks from master in the future.

(From OE-Core rev: 48fbddf32ffa3ec44a788f42895c1730a84b5a91)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Piotr Łobacz
0ce97636c9 systemd: fix wrong nobody-group assignment
The generated /etc/group file had a wrong group name for nobody-group
which was nobody with same id as nogroup groupd. This was leading to
duplcate groups, with same ids and different names.

More can be read on this link:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11766

(From OE-Core rev: 0928857e4aaa524f36e028d4fe0cc48cc4d40148)

Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d69fccf2e5d108dd7c6059310924588d36a45865)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Richard Purdie
90adc17feb pybootchartui: Fix python syntax issue
Fix:

scripts/pybootchartgui/pybootchartgui/parsing.py:134: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if pid is 0:

(From OE-Core rev: 413523515dbb064680841fffa2cfdba8b2bac6f6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c9a6511ae618035b8efad01646e37ba28ce1e3f8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Ross Burton
2ace3a0b1e lib/resulttool: fix typo breaking resulttool log --ptest
ptestresult_get_log() looked for a key called 'ptestresuls.sections',
which should be 'ptestresult.sections'

(From OE-Core rev: 288609a3bb2760b5bb9d86e9c130b227f9bd5039)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 7c8c9f7283e54bf8b1521fbaad7dceb66a8fcdbb)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Mikko Rapeli
1f1d3d2647 oeqa rtc.py: skip if read-only-rootfs
hwclock command fails on read-only-rootfs:

AssertionError: 1 != 0 : Failed to reset RTC time, output: hwclock: cannot open /etc/adjtime: Read-only file system

(From OE-Core rev: 5b85a6fa84b02e7ebae011979456d33b8774dd21)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 017bf8c160f6ab67d9f8e8d9e30b15bf84f73807)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Bruce Ashfield
07f99e3dea linux-yocto/5.4: update to v5.4.237
Updating  to the latest korg -stable release that comprises
the following commits:

    e4b5c766f505 Linux 5.4.237
    6a16810068e7 s390/dasd: add missing discipline function
    7a934a77f11a UML: define RUNTIME_DISCARD_EXIT
    87fcce7a6f86 sh: define RUNTIME_DISCARD_EXIT
    eb9dbb70cdd5 s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36
    219cc98501ff powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds
    4eede1173fb5 powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT
    d0fcf59038c5 arch: fix broken BuildID for arm64 and riscv
    a4bd6d4df382 x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS
    1aed78cfda7f drm/i915: Don't use BAR mappings for ring buffers with LLC
    52fc917855ce ipmi:watchdog: Set panic count to proper value on a panic
    dbfae25b0196 ipmi/watchdog: replace atomic_add() and atomic_sub()
    f266cdd6796f media: ov5640: Fix analogue gain control
    fc9bc831509f PCI: Add SolidRun vendor ID
    094a073605b1 macintosh: windfarm: Use unsigned type for 1-bit bitfields
    737985dbcb67 alpha: fix R_ALPHA_LITERAL reloc for large modules
    2fea235ef07f MIPS: Fix a compilation issue
    6b06c4ae64e3 ext4: Fix deadlock during directory rename
    a99a61d9e1bf riscv: Use READ_ONCE_NOCHECK in imprecise unwinding stack mode
    1a517302dbe0 net/smc: fix fallback failed while sendmsg with fastopen
    3a747490f9c3 scsi: megaraid_sas: Update max supported LD IDs to 240
    d800996fcf60 btf: fix resolving BTF_KIND_VAR after ARRAY, STRUCT, UNION, PTR
    9f2e063dcbe2 netfilter: tproxy: fix deadlock due to missing BH disable
    16f3aae1aa2d bnxt_en: Avoid order-5 memory allocation for TPA data
    9dc16be373b3 net: caif: Fix use-after-free in cfusbl_device_notify()
    8018aa0863d6 net: lan78xx: fix accessing the LAN7800's internal phy specific registers from the MAC driver
    1c618f150c82 net: usb: lan78xx: Remove lots of set but unused 'ret' variables
    e4e5006c13f3 selftests: nft_nat: ensuring the listening side is up before starting the client
    783f218940b3 ila: do not generate empty messages in ila_xlat_nl_cmd_get_mapping()
    0a3664a1058d nfc: fdp: add null check of devm_kmalloc_array in fdp_nci_i2c_read_device_properties
    43f33642f260 drm/msm/a5xx: fix setting of the CP_PREEMPT_ENABLE_LOCAL register
    8dac5a63cf79 ext4: Fix possible corruption when moving a directory
    891a3cba425c scsi: core: Remove the /proc/scsi/${proc_name} directory earlier
    57f78226b127 cifs: Fix uninitialized memory read in smb3_qfs_tcon()
    a6e44cb21534 SMB3: Backup intent flag missing from some more ops
    1b48c70feefc iommu/vt-d: Fix PASID directory pointer coherency
    985d9fa06b4b irqdomain: Fix domain registration race
    01ed8ff22a5b irqdomain: Change the type of 'size' in __irq_domain_add() to be consistent
    36c5682cbb46 ipmi:ssif: Add a timer between request retries
    e8ba1b693a8b ipmi:ssif: Increase the message retry time
    89fb3fa84883 ipmi:ssif: Remove rtc_us_timer
    d1a7f56b20da ipmi:ssif: resend_msg() cannot fail
    59349bfcffb1 ipmi:ssif: make ssif_i2c_send() void
    5e97dc748d13 iommu/amd: Add a length limitation for the ivrs_acpihid command-line parameter
    774c63f53688 iommu/amd: Fix ill-formed ivrs_ioapic, ivrs_hpet and ivrs_acpihid options
    11852cc78f67 iommu/amd: Add PCI segment support for ivrs_[ioapic/hpet/acpihid] commands
    3cdf19a29cc1 nfc: change order inside nfc_se_io error path
    0d8a6c9a6415 ext4: zero i_disksize when initializing the bootloader inode
    74d775083e9f ext4: fix WARNING in ext4_update_inline_data
    b36093c6f772 ext4: move where set the MAY_INLINE_DATA flag is set
    c24f83849379 ext4: fix another off-by-one fsmap error on 1k block filesystems
    aee90b0278e3 ext4: fix RENAME_WHITEOUT handling for inline directories
    1277ba3db6dc drm/connector: print max_requested_bpc in state debugfs
    e40c1e9da1ec x86/CPU/AMD: Disable XSAVES on AMD family 0x17
    6631c8da02cf fs: prevent out-of-bounds array speculation when closing a file descriptor
    b829e8b6e1a7 Linux 5.4.236
    6e55d8422373 staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh
    9498448b9ede staging: rtl8192e: Remove function ..dm_check_ac_dc_power calling a script
    6ee84b8b7904 wifi: cfg80211: Partial revert "wifi: cfg80211: Fix use after free for wext"
    126ee8982bfc Linux 5.4.235
    d03bc164f32f dt-bindings: rtc: sun6i-a31-rtc: Loosen the requirements on the clocks
    6ab670546319 media: uvcvideo: Fix race condition with usb_kill_urb
    0b8962c64bd6 media: uvcvideo: Provide sync and async uvc_ctrl_status_event
    2b1c5145b07d tcp: Fix listen() regression in 5.4.229.
    800a1c4c8a7f Bluetooth: hci_sock: purge socket queues in the destruct() callback
    27c64d90d944 x86/resctl: fix scheduler confusion with 'current'
    81da72aaf57a x86/resctrl: Apply READ_ONCE/WRITE_ONCE to task_struct.{rmid,closid}
    bde541a57b42 net: tls: avoid hanging tasks on the tx_lock
    d94fbfcd9a26 phy: rockchip-typec: Fix unsigned comparison with less than zero
    f0ee43d61d8d PCI: Add ACS quirk for Wangxun NICs
    f6d3aee1c663 kernel/fail_function: fix memory leak with using debugfs_lookup()
    195c1e9f454e usb: uvc: Enumerate valid values for color matching
    da4e715a466c USB: ene_usb6250: Allocate enough memory for full object
    117097966866 usb: host: xhci: mvebu: Iterate over array indexes instead of using pointer math
    f5b76a81665e iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_config_word()
    11b4b3b76988 iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_status_word()
    b854c66dd7a8 tools/iio/iio_utils:fix memory leak
    ea9b58789687 mei: bus-fixup:upon error print return values of send and receive
    c7ca2ca12a9f tty: serial: fsl_lpuart: disable the CTS when send break signal
    953a4a352a0c tty: fix out-of-bounds access in tty_driver_lookup_tty()
    70369a11170d staging: emxx_udc: Add checks for dma_alloc_coherent()
    2072ed7c1a4a media: uvcvideo: Silence memcpy() run-time false positive warnings
    e2cc773f1fc3 media: uvcvideo: Quirk for autosuspend in Logitech B910 and C910
    e4c535eccefb media: uvcvideo: Handle errors from calls to usb_string
    4e4e6ca62e77 media: uvcvideo: Handle cameras with invalid descriptors
    7195e642b49a mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
    fde59e273b03 firmware/efi sysfb_efi: Add quirk for Lenovo IdeaPad Duet 3
    2cc6a3e98f05 tracing: Add NULL checks for buffer in ring_buffer_free_read_page()
    4cfeb55a10b6 thermal: intel: BXT_PMIC: select REGMAP instead of depending on it
    e23f1d9e6e03 thermal: intel: quark_dts: fix error pointer dereference
    584f664c572f scsi: ipr: Work around fortify-string warning
    e93bda4ebb27 rtc: sun6i: Always export the internal oscillator
    728b047f4ca3 rtc: sun6i: Make external 32k oscillator optional
    9c7c1cf29fc3 vc_screen: modify vcs_size() handling in vcs_read()
    821362a2dfaf tcp: tcp_check_req() can be called from process context
    77606e383ecb ARM: dts: spear320-hmi: correct STMPE GPIO compatible
    dda4f0a424c2 net/sched: act_sample: fix action bind logic
    271eed173642 nfc: fix memory leak of se_io context in nfc_genl_se_io
    f81af781f98c net/mlx5: Geneve, Fix handling of Geneve object id as error code
    4b71f2b54332 9p/rdma: unmap receive dma buffer in rdma_request()/post_recv()
    7cc9dbae8a5f 9p/xen: fix connection sequence
    9d1c625c99c5 9p/xen: fix version parsing
    edfba7b3228a net: fix __dev_kfree_skb_any() vs drop monitor
    cec326443f01 sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop
    aba298b35619 ipv6: Add lwtunnel encap size of all siblings in nexthop calculation
    5d0d38805d32 netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()
    fe65d6f26ba9 watchdog: pcwd_usb: Fix attempting to access uninitialized memory
    59e391b3fc50 watchdog: Fix kmemleak in watchdog_cdev_register
    7c428fc97499 watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
    a8816afcaf1d x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list
    b5be23f6ae61 ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed
    1cb14c06d603 ubi: Fix UAF wear-leveling entry in eraseblk_count_seq_show()
    7fcbc41d762a ubifs: ubifs_writepage: Mark page dirty after writing inode failed
    510b80abe8d2 ubifs: dirty_cow_znode: Fix memleak in error handling path
    0875edcad42f ubifs: Re-statistic cleaned znode count if commit failed
    234c53e57424 ubi: Fix possible null-ptr-deref in ubi_free_volume()
    1f206002c6bc ubifs: Fix memory leak in alloc_wbufs()
    07b60f7452d2 ubi: Fix unreferenced object reported by kmemleak in ubi_resize_volume()
    9c8be1f165ba ubi: Fix use-after-free when volume resizing failed
    e86d1b2bb716 ubifs: Reserve one leb for each journal head while doing budget
    82c096d0c99a ubifs: do_rename: Fix wrong space budget when target inode's nlink > 1
    bf8f5495849d ubifs: Fix wrong dirty space budget for dirty inode
    f29168fb527c ubifs: Rectify space budget for ubifs_xrename()
    86660306273a ubifs: Rectify space budget for ubifs_symlink() if symlink is encrypted
    4ca0d746226f ubifs: Fix build errors as symbol undefined
    f7adb740f97b ubi: ensure that VID header offset + VID header size <= alloc, size
    6480c3a12755 um: vector: Fix memory leak in vector_config
    01c92f033b27 fs: f2fs: initialize fsdata in pagecache_write()
    c4a89ebe9205 f2fs: use memcpy_{to,from}_page() where possible
    b915fac02098 pwm: stm32-lp: fix the check on arr and cmp registers update
    1abd3858023a pwm: sifive: Always let the first pwm_apply_state succeed
    30a3636fe6e2 pwm: sifive: Reduce time the controller lock is held
    62462a5b4f4d fs/jfs: fix shift exponent db_agl2size negative
    7a6fb69bbcb2 net/sched: Retire tcindex classifier
    b3d346ece979 kbuild: Port silent mode detection to future gnu make.
    68b0cdcfa135 wifi: ath9k: use proper statements in conditionals
    96a8424a27ed drm/radeon: Fix eDP for single-display iMac11,2
    6e6173886f58 drm/i915/quirks: Add inverted backlight quirk for HP 14-r206nv
    efc72cceb761 PCI: Avoid FLR for AMD FCH AHCI adapters
    bcc1bafb067d PCI: hotplug: Allow marking devices as disconnected during bind/unbind
    2a50583117b2 PCI/PM: Observe reset delay irrespective of bridge_d3
    40af9a6deed7 scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()
    79ec5dd5fb07 scsi: ses: Fix possible desc_ptr out-of-bounds accesses
    8e454aba7280 scsi: ses: Fix possible addl_desc_ptr out-of-bounds accesses
    467afb1dd630 scsi: ses: Fix slab-out-of-bounds in ses_enclosure_data_process()
    6069e04a922a scsi: ses: Don't attach if enclosure has no components
    70e9a93f0945 scsi: qla2xxx: Fix erroneous link down
    3a564de3a299 scsi: qla2xxx: Fix DMA-API call trace on NVMe LS requests
    05a0f6fa52a8 scsi: qla2xxx: Fix link failure in NPIV environment
    18d347d1b08e ktest.pl: Add RUN_TIMEOUT option with default unlimited
    150ee1fc9080 ktest.pl: Fix missing "end_monitor" when machine check fails
    2f42bfc54d3a ktest.pl: Give back console on Ctrt^C on monitor
    b53d209d717b mm/thp: check and bail out if page in deferred queue already
    24900f35962b mm: memcontrol: deprecate charge moving
    964e9e1288fd media: ipu3-cio2: Fix PM runtime usage_count in driver unbind
    58c0d0b2d474 mips: fix syscall_get_nr
    229edf8d7b76 alpha: fix FEN fault handling
    9787b328c42c rbd: avoid use-after-free in do_rbd_add() when rbd_dev_create() fails
    7055754dd07c ARM: dts: exynos: correct TMU phandle in Odroid XU
    7b6707d66e28 ARM: dts: exynos: correct TMU phandle in Exynos4
    3c4a56ef7c53 dm flakey: don't corrupt the zero page
    a2be4225c31d dm flakey: fix logic when corrupting a bio
    64fbe39232ed thermal: intel: powerclamp: Fix cur_state for multi package system
    6f1959c17d4c wifi: cfg80211: Fix use after free for wext
    342cb34c5285 wifi: rtl8xxxu: Use a longer retry limit of 48
    a92b67e768bd ext4: refuse to create ea block when umounted
    3b28c799a133 ext4: optimize ea_inode block expansion
    87005d0ab5c4 ALSA: hda/realtek: Add quirk for HP EliteDesk 800 G6 Tower PC
    84ed1ade54b8 ALSA: ice1712: Do not left ice->gpio_mutex locked in aureon_add_controls()
    df129eaa2b88 irqdomain: Drop bogus fwspec-mapping error handling
    72232dbe14f9 irqdomain: Fix disassociation race
    2101663687e6 irqdomain: Fix association race
    f9d93201893d ima: Align ima_file_mmap() parameters with mmap_file LSM hook
    4d47cba0741c Documentation/hw-vuln: Document the interaction between IBRS and STIBP
    34c1b60e7a80 x86/speculation: Allow enabling STIBP with legacy IBRS
    979e197968a1 x86/microcode/AMD: Fix mixed steppings support
    727bc2c2856b x86/microcode/AMD: Add a @cpu parameter to the reloading functions
    4c26edf2ea23 x86/microcode/amd: Remove load_microcode_amd()'s bsp parameter
    a0415b79dd3f x86/kprobes: Fix arch_check_optimized_kprobe check within optimized_kprobe range
    ec206a38d3d2 x86/kprobes: Fix __recover_optprobed_insn check optimizing logic
    e4ce333cc66e x86/reboot: Disable SVM, not just VMX, when stopping CPUs
    37459195d971 x86/reboot: Disable virtualization in an emergency if SVM is supported
    87459b9fce2d x86/crash: Disable virt in core NMI crash handler to avoid double shootdown
    ee80fb1dca07 x86/virt: Force GIF=1 prior to disabling SVM (for reboot flows)
    4c9812d9890d KVM: s390: disable migration mode when dirty tracking is disabled
    10c2a20d73e9 KVM: Destroy target device if coalesced MMIO unregistration fails
    38a1f5e9fc56 udf: Fix file corruption when appending just after end of preallocated extent
    d747b31e2925 udf: Detect system inodes linked into directory hierarchy
    ce17ef97de84 udf: Preserve link count of system files
    7bd8d9e1cf56 udf: Do not update file length for failed writes to inline files
    3d20e3b768af udf: Do not bother merging very long extents
    4e41b1c5a272 udf: Truncate added extents on failed expansion
    dee96928d8f4 ocfs2: fix non-auto defrag path not working issue
    669134a66d37 ocfs2: fix defrag path triggering jbd2 ASSERT
    68a47ca95805 f2fs: fix cgroup writeback accounting with fs-layer encryption
    2bef8314fcf9 f2fs: fix information leak in f2fs_move_inline_dirents()
    3776ef785e10 fs: hfsplus: fix UAF issue in hfsplus_put_super
    eda6879272e4 hfs: fix missing hfs_bnode_get() in __hfs_bnode_create
    8ecde537edc3 ARM: dts: exynos: correct HDMI phy compatible in Exynos4
    e71e6fa07fe4 s390/kprobes: fix current_kprobe never cleared after kprobes reenter
    18075c0dc331 s390/kprobes: fix irq mask clobbering on kprobe reenter from post_handler
    c5db76fcddc1 s390: discard .interp section
    a9391f8bc98f ipmi_ssif: Rename idle state and check
    0ff4c222bd05 rtc: pm8xxx: fix set-alarm race
    69b8af77ef6b firmware: coreboot: framebuffer: Ignore reserved pixel color bits
    791402dd0514 wifi: rtl8xxxu: fixing transmisison failure for rtl8192eu
    3132aa35cfc2 nfsd: zero out pointers after putting nfsd_files on COPY setup error
    38b4d3eacb88 dm cache: add cond_resched() to various workqueue loops
    3b46b2cb917e dm thin: add cond_resched() to various workqueue loops
    2c055b6a07af drm: panel-orientation-quirks: Add quirk for Lenovo IdeaPad Duet 3 10IGL5
    718ce68b3a7f pinctrl: at91: use devm_kasprintf() to avoid potential leaks
    4000384684f6 hwmon: (coretemp) Simplify platform device handling
    5026260ac2b2 regulator: s5m8767: Bounds check id indexing into arrays
    12527ae49d0c regulator: max77802: Bounds check regulator id against opmode
    7fae534a304b ASoC: kirkwood: Iterate over array indexes instead of using pointer math
    90c278c6d099 docs/scripts/gdb: add necessary make scripts_gdb step
    3a9a4a9725c6 drm/msm/dsi: Add missing check for alloc_ordered_workqueue
    f9f55fc64928 drm/radeon: free iio for atombios when driver shutdown
    5ccd8d09fee5 HID: Add Mapping for System Microphone Mute
    341a4c04ed48 drm/omap: dsi: Fix excessive stack usage
    d236103782de drm/amd/display: Fix potential null-deref in dm_resume
    5bc391944d9e uaccess: Add minimum bounds check on kernel buffer size
    0467681f0947 coda: Avoid partial allocation of sig_inputArgs
    1a98c4d9263d net/mlx5: fw_tracer: Fix debug print
    21856d5615a7 ACPI: video: Fix Lenovo Ideapad Z570 DMI match
    c727c1eb58e0 wifi: mt76: dma: free rx_head in mt76_dma_rx_cleanup
    51c0dca573c0 m68k: Check syscall_trace_enter() return code
    87363d1ab55e net: bcmgenet: Add a check for oversized packets
    fe00ab1eb3bc ACPI: Don't build ACPICA with '-Os'
    8ec82cfe4e74 ice: add missing checks for PF vsi type
    f81c0d484a0c inet: fix fast path in __inet_hash_connect()
    67e4519afba2 wifi: mt7601u: fix an integer underflow
    423a1297ea72 wifi: brcmfmac: ensure CLM version is null-terminated to prevent stack-out-of-bounds
    f3a324362b5e x86/bugs: Reset speculation control settings on init
    c8157f67b003 timers: Prevent union confusion from unexpected restart_syscall()
    f570968d0154 thermal: intel: Fix unsigned comparison with less than zero
    596d1fea0519 rcu: Suppress smp_processor_id() complaint in synchronize_rcu_expedited_wait()
    17dbe90e13f5 wifi: brcmfmac: Fix potential stack-out-of-bounds in brcmf_c_preinit_dcmds()
    9e8bf9f95f7a blk-iocost: fix divide by 0 error in calc_lcoefs()
    f10001af0f72 ARM: dts: exynos: Use Exynos5420 compatible for the MIPI video phy
    dae4d5ae6b87 udf: Define EFSCORRUPTED error code
    824b167fa8dd rpmsg: glink: Avoid infinite loop on intent for missing channel
    a41bb59eff7a media: usb: siano: Fix use after free bugs caused by do_submit_urb
    2a72e3b6bb08 media: i2c: ov7670: 0 instead of -EINVAL was returned
    d120334278b3 media: rc: Fix use-after-free bugs caused by ene_tx_irqsim()
    448ce1cd5038 media: i2c: ov772x: Fix memleak in ov772x_probe()
    086a80b842bc media: ov5675: Fix memleak in ov5675_init_controls()
    ec6bd0dccd9c powerpc: Remove linker flag from KBUILD_AFLAGS
    44aef56083aa media: platform: ti: Add missing check for devm_regulator_get
    fc85fb57631a remoteproc: qcom_q6v5_mss: Use a carveout to authenticate modem headers
    3acbec356d7e MIPS: vpe-mt: drop physical_memsize
    a3c920040517 MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
    1abc7be57c1c powerpc/eeh: Set channel state after notifying the drivers
    7719aba7a39c powerpc/eeh: Small refactor of eeh_handle_normal_event()
    a39becb905b9 powerpc/rtas: ensure 4KB alignment for rtas_data_buf
    0616586eefd0 powerpc/rtas: make all exports GPL
    d8ca49859179 powerpc/pseries/lparcfg: add missing RTAS retry status handling
    421c59c23aba powerpc/pseries/lpar: add missing RTAS retry status handling
    2c5ad2d642a3 clk: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled()
    4d178dc25fb6 powerpc/powernv/ioda: Skip unallocated resources when mapping to PE
    b1c1b6da5ab0 clk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC
    e3617778eb1b Input: ads7846 - don't check penirq immediately for 7845
    ea9c4fbfda69 Input: ads7846 - don't report pressure for ads7845
    17761a1c7fcd clk: renesas: cpg-mssr: Remove superfluous check in resume code
    8ff19db90352 clk: renesas: cpg-mssr: Use enum clk_reg_layout instead of a boolean flag
    330b70949cb4 clk: renesas: cpg-mssr: Fix use after free if cpg_mssr_common_init() failed
    f34eb1e4336e mtd: rawnand: sunxi: Fix the size of the last OOB region
    cdfdd882fae9 clk: qcom: gcc-qcs404: fix names of the DSI clocks used as parents
    b419e91378ed clk: qcom: gcc-qcs404: disable gpll[04]_out_aux parents
    588edb4fb1f1 mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read()
    6e0a0eb18e04 selftests/ftrace: Fix bash specific "==" operator
    16a35042ff8a sparc: allow PM configs for sparc32 COMPILE_TEST
    090a22f5999d perf tools: Fix auto-complete on aarch64
    5d32f3e9227a perf llvm: Fix inadvertent file creation
    ce43565a6cd1 gfs2: jdata writepage fix
    3524d6da0fe8 cifs: Fix warning and UAF when destroy the MR list
    324c0c34fff1 cifs: Fix lost destroy smbd connection when MR allocate failed
    a22f1ecab6d4 nfsd: fix race to check ls_layouts
    5a195fa41d01 hid: bigben_probe(): validate report count
    9f525559ea39 HID: asus: Fix mute and touchpad-toggle keys on Medion Akoya E1239T
    bc786dfeb792 HID: asus: Add support for multi-touch touchpad on Medion Akoya E1239T
    bad4a822a118 HID: asus: Add report_size to struct asus_touchpad_info
    63792d0ae94e HID: asus: Only set EV_REP if we are adding a mapping
    25e14bf0c894 HID: bigben: use spinlock to safely schedule workers
    715edb0109ca HID: bigben_worker() remove unneeded check on report_field
    12533ad8545c HID: bigben: use spinlock to protect concurrent accesses
    05cb432c0909 ASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared
    84beaa3e2eec ASoC: dapm: declare missing structure prototypes
    d6250e00bf42 spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one()
    b89d2ed56406 dm: remove flush_scheduled_work() during local_exit()
    e6d9a876d914 hwmon: (mlxreg-fan) Return zero speed for broken fan
    870a0f519ac2 spi: bcm63xx-hsspi: Fix multi-bit mode setting
    dd271f179806 spi: bcm63xx-hsspi: fix pm_runtime
    904b717bb527 scsi: aic94xx: Add missing check for dma_map_single()
    3414be1c8cd1 hwmon: (ltc2945) Handle error case in ltc2945_value_store
    75a1c3f82232 gpio: vf610: connect GPIO label to dev name
    584cb84e2c6d ASoC: soc-compress.c: fixup private_data on snd_soc_new_compress()
    a161f1d92aab drm/mediatek: Clean dangling pointer on bind error path
    b8b166db7885 drm/mediatek: Drop unbalanced obj unref
    367c80fb343f drm/mediatek: Use NULL instead of 0 for NULL pointer
    a0555f90d823 drm/mediatek: remove cast to pointers passed to kfree
    2b59e87c92f0 gpu: host1x: Don't skip assigning syncpoints to channels
    3975ea6eaffe drm/msm/mdp5: Add check for kzalloc
    2a8bb9dce7fd drm: Initialize struct drm_crtc_state.no_vblank from device settings
    9b2f5844903a drm/bridge: Introduce drm_bridge_get_next_bridge()
    bb08be7232ef drm/bridge: Rename bridge helpers targeting a bridge chain
    2c33a6141de2 drm/exynos: Don't reset bridge->next
    dadd30fcc7e3 drm/msm/dpu: Add check for pstates
    a6afb8293ec0 drm/msm/dpu: Add check for cstate
    8f9fdc830d6d drm/msm: use strscpy instead of strncpy
    d7ea84cddf81 drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness
    a9eafb0448ab ALSA: hda/ca0132: minor fix for allocation size
    a80767caeddc ASoC: fsl_sai: initialize is_dsp_mode flag
    95ab6d7905eb pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain
    fc34608fa275 drm/msm/hdmi: Add missing check for alloc_ordered_workqueue
    62430b3210c8 gpu: ipu-v3: common: Add of_node_put() for reference returned by of_graph_get_port_by_id()
    31701e54d318 drm/vc4: dpi: Fix format mapping for RGB565
    d66f26b93c13 drm/vc4: dpi: Add option for inverting pixel clock and output enable
    7ddd8a5ecf6f drm/bridge: megachips: Fix error handling in i2c_register_driver()
    d56e589f8b6f drm: mxsfb: DRM_MXSFB should depend on ARCH_MXS || ARCH_MXC
    c879003a6f5e drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formats
    c82ca67ca01b selftest: fib_tests: Always cleanup before exit
    c31985922ec9 selftests/net: Interpret UDP_GRO cmsg data as an int value
    616574788880 irqchip/irq-bcm7120-l2: Set IRQ_LEVEL for level triggered interrupts
    3947b16613ef irqchip/irq-brcmstb-l2: Set IRQ_LEVEL for level triggered interrupts
    d77209007869 can: esd_usb: Move mislocated storage of SJA1000_ECC_SEG bits in case of a bus error
    3cf2181e438f thermal/drivers/hisi: Drop second sensor hi3660
    21c701cbc84e wifi: mac80211: make rate u32 in sta_set_rate_info_rx()
    b70d56e728ff crypto: crypto4xx - Call dma_unmap_page when done
    a3b75b1e767a wifi: mwifiex: fix loop iterator in mwifiex_update_ampdu_txwinsize()
    c002d2741400 wifi: iwl4965: Add missing check for create_singlethread_workqueue()
    7e594abc0424 wifi: iwl3945: Add missing check for create_singlethread_workqueue
    5de7a4254eb2 treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()
    9198eefd1053 usb: gadget: udc: Avoid tasklet passing a global
    cf04507f425b RISC-V: time: initialize hrtimer based broadcast clock event device
    142bcf724056 m68k: /proc/hardware should depend on PROC_FS
    c4d8c23efed6 crypto: rsa-pkcs1pad - Use akcipher_request_complete
    8c1447495f05 rds: rds_rm_zerocopy_callback() correct order for list_add_tail()
    291e6a682008 libbpf: Fix alen calculation in libbpf_nla_dump_errormsg()
    60aaccf16d1e Bluetooth: L2CAP: Fix potential user-after-free
    d19bd48535fc OPP: fix error checking in opp_migrate_dentry()
    522d319cda95 tap: tap_open(): correctly initialize socket uid
    d92d87000eda tun: tun_chr_open(): correctly initialize socket uid
    11c9c7227273 net: add sock_init_data_uid()
    276ccbc15feb mptcp: add sk_stop_timer_sync helper
    07fceab32096 irqchip/ti-sci: Fix refcount leak in ti_sci_intr_irq_domain_probe
    c7d78d36e19e irqchip/irq-mvebu-gicp: Fix refcount leak in mvebu_gicp_probe
    9e79ac4f70fd irqchip/alpine-msi: Fix refcount leak in alpine_msix_init_domains
    7cce0c9fdd3f net/mlx5: Enhance debug print in page allocation failure
    dbd6ae095674 powercap: fix possible name leak in powercap_register_zone()
    63551e4b7cbc crypto: seqiv - Handle EBUSY correctly
    c61e7d182ee3 crypto: essiv - Handle EBUSY correctly
    bfef5e3e7375 crypto: essiv - remove redundant null pointer check before kfree
    2d1ac2f2e2be crypto: ccp - Failure on re-initialization due to duplicate sysfs filename
    40627e6e291c ACPI: battery: Fix missing NUL-termination with large strings
    bf6dc175a2b5 wifi: ath9k: Fix potential stack-out-of-bounds write in ath9k_wmi_rsp_callback()
    cd8316767099 wifi: ath9k: hif_usb: clean up skbs if ath9k_hif_usb_rx_stream() fails
    c3ff385b948d ath9k: htc: clean up statistics macros
    a49c13eccea4 ath9k: hif_usb: simplify if-if to if-else
    564bc2222bf5 wifi: ath9k: htc_hst: free skb in ath9k_htc_rx_msg() if there is no callback function
    17a0e61cd982 wifi: orinoco: check return value of hermes_write_wordrec()
    573dfeba2d4e ACPICA: nsrepair: handle cases without a return value correctly
    987b0ff1b9d9 lib/mpi: Fix buffer overrun when SG is too long
    b55ada30b5cd genirq: Fix the return type of kstat_cpu_irqs_sum()
    6b9f61c8b821 ACPICA: Drop port I/O validation for some regions
    c300697690e2 crypto: x86/ghash - fix unaligned access in ghash_setkey()
    0c4f20c8fc7d wifi: wl3501_cs: don't call kfree_skb() under spin_lock_irqsave()
    14ba31bb1b66 wifi: libertas: cmdresp: don't call kfree_skb() under spin_lock_irqsave()
    38ef77720371 wifi: libertas: main: don't call kfree_skb() under spin_lock_irqsave()
    1879fe9e4016 wifi: libertas: if_usb: don't call kfree_skb() under spin_lock_irqsave()
    0b7b7347449f wifi: libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
    318005127c80 wifi: brcmfmac: unmap dma buffer in brcmf_msgbuf_alloc_pktid()
    d869a1895052 wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
    a12610e83789 wifi: wilc1000: fix potential memory leak in wilc_mac_xmit()
    a6059cf02a0d wilc1000: let wilc_mac_xmit() return NETDEV_TX_OK
    112c1af02b8f wifi: ipw2200: fix memory leak in ipw_wdev_init()
    ba1d3623fea5 wifi: ipw2x00: don't call dev_kfree_skb() under spin_lock_irqsave()
    0d438ae7bac9 ipw2x00: switch from 'pci_' to 'dma_' API
    28ea268d95e5 wifi: rtlwifi: Fix global-out-of-bounds bug in _rtl8812ae_phy_set_txpower_limit()
    5d171ab48b42 rtlwifi: fix -Wpointer-sign warning
    5dd30d1acc70 wifi: rtl8xxxu: don't call dev_kfree_skb() under spin_lock_irqsave()
    23b34e08de5c wifi: libertas: fix memory leak in lbs_init_adapter()
    1864b22e238c wifi: iwlegacy: common: don't call dev_kfree_skb() under spin_lock_irqsave()
    9004aa391a1a net/wireless: Delete unnecessary checks before the macro call “dev_kfree_skb”
    fe4d7280cf4d wifi: rsi: Fix memory leak in rsi_coex_attach()
    82d68c324497 block: bio-integrity: Copy flags when bio_integrity_payload is cloned
    084cd75643b6 sched/rt: pick_next_rt_entity(): check list_entry
    0ff7ba5e8bbd sched/deadline,rt: Remove unused parameter from pick_next_[rt|dl]_entity()
    ee986d80acde s390/dasd: Fix potential memleak in dasd_eckd_init()
    8bc5a76268fb s390/dasd: Prepare for additional path event handling
    946515fad41a blk-mq: correct stale comment of .get_budget
    2dc5f68fe664 blk-mq: wait on correct sbitmap_queue in blk_mq_mark_tag_wait
    8c225150ea27 blk-mq: remove stale comment for blk_mq_sched_mark_restart_hctx
    260dcf1ccdc6 block: Limit number of items taken from the I/O scheduler in one go
    578c8f09c04b Revert "scsi: core: run queue if SCSI device queue isn't ready and queue is idle"
    2d3c3aa4123a arm64: dts: mediatek: mt7622: Add missing pwm-cells to pwm node
    38af86810d48 ARM: dts: imx7s: correct iomuxc gpr mux controller cells
    7fe5dc2fee91 arm64: dts: amlogic: meson-gxl-s905d-phicomm-n1: fix led node name
    8b7aa62f4a3a arm64: dts: amlogic: meson-gxl: add missing unit address to eth-phy-mux node name
    d5fbeae6d608 arm64: dts: amlogic: meson-gx: add missing unit address to rng node name
    c5cd41bd10e2 arm64: dts: amlogic: meson-gx: add missing SCPI sensors compatible
    1e3ec4d1d7f3 arm64: dts: amlogic: meson-axg: fix SCPI clock dvfs node name
    e515d4118583 arm64: dts: amlogic: meson-gx: fix SCPI clock dvfs node name
    1e1b84b0220b ARM: imx: Call ida_simple_remove() for ida_simple_get
    b0a1b2f3ef90 ARM: dts: exynos: correct wr-active property in Exynos3250 Rinato
    91ac4bf35ad6 ARM: OMAP1: call platform_device_put() in error case in omap1_dm_timer_init()
    af3352c16efd arm64: dts: meson: remove CPU opps below 1GHz for G12A boards
    9dd61d95429b arm64: dts: meson-gx: Fix the SCPI DVFS node name and unit address
    cba890c4bd9d arm64: dts: meson-g12a: Fix internal Ethernet PHY unit name
    69bdc5d01406 arm64: dts: meson-gx: Fix Ethernet MAC address unit name
    ede0334bf4df ARM: zynq: Fix refcount leak in zynq_early_slcr_init
    45b44ba5dfc9 arm64: dts: qcom: qcs404: use symbol names for PCIe resets
    8041f9a2a958 ARM: OMAP2+: Fix memory leak in realtime_counter_init()
    dd08e68d04d0 HID: asus: use spinlock to safely schedule workers
    136a9bcc0ed2 HID: asus: use spinlock to protect concurrent accesses
    9a25b22fd577 HID: asus: Remove check for same LED brightness on set

(From OE-Core rev: 4279a46f94a535a0b389f27c5c3b1e16aa9eb63d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Bruce Ashfield
2b2f5660b9 linux-yocto/5.4: update to v5.4.234
Updating  to the latest korg -stable release that comprises
the following commits:

    a103859aaa71 Linux 5.4.234
    a1e89c8b29d0 USB: core: Don't hold device lock while reading the "descriptors" sysfs file
    96d380d2ae98 USB: serial: option: add support for VW/Skoda "Carstick LTE"
    91c877d4311f dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size
    465ce31a2bcc vc_screen: don't clobber return value in vcs_read
    ee8cd3abe722 net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues().
    db25b41eb531 bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state
    23affaed760b HID: core: Fix deadloop in hid_apply_multiplier.
    93b17c7e1e1c neigh: make sure used and confirmed times are valid
    bc4601ad979a IB/hfi1: Assign npages earlier
    98e626c115f8 btrfs: send: limit number of clones and allocated memory size
    ae03fa7ad343 ACPI: NFIT: fix a potential deadlock during NFIT teardown
    785bde845991 ARM: dts: rockchip: add power-domains property to dp node on rk3288
    da2bba879eca arm64: dts: rockchip: drop unused LED mode property from rk3328-roc-cc

(From OE-Core rev: 75c94d4da6cc2efba436bcb3b5cec5ebc9a76151)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Bruce Ashfield
8c4a94a6de linux-yocto/5.4: update to v5.4.233
Updating  to the latest korg -stable release that comprises
the following commits:

    69f65d442efe Linux 5.4.233
    c6cc0121d44d bpf: add missing header file include
    5d873a6c658f Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs"
    99e3fd21f8fc ext4: Fix function prototype mismatch for ext4_feat_ktype
    6f86bb6f853f wifi: mwifiex: Add missing compatible string for SD8787
    6c750ed0367f uaccess: Add speculation barrier to copy_from_user()
    4d2e5de071fd mac80211: mesh: embedd mesh_paths and mpp_paths into ieee80211_if_mesh
    787ef0db0140 drm/i915/gvt: fix double free bug in split_2MB_gtt_entry
    100cf2af1b39 alarmtimer: Prevent starvation by small intervals and SIG_IGN
    dab2066c5fff powerpc: dts: t208x: Disable 10G on MAC1 and MAC2
    113e0cde39bb can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len
    f93a1a5bdcdd KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS
    db209f39f1d1 KVM: x86: Fail emulation during EMULTYPE_SKIP on any exception
    dc399695dfe9 random: always mix cycle counter in add_latent_entropy()
    eff0e02f7d3f powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
    ead0689bd6fd wifi: rtl8xxxu: gen2: Turn on the rate control
    0a77a966aa4a drm/etnaviv: don't truncate physical page address
    fa2845b21671 drm: etnaviv: fix common struct sg_table related issues
    4626550b09ea scatterlist: add generic wrappers for iterating over sgtable objects
    fe3e217272a8 dma-mapping: add generic helpers for mapping sgtable objects
    64121e2adf7d Linux 5.4.232
    8b47e324af71 iommu/amd: Pass gfp flags to iommu_map_page() in amd_iommu_map()
    7519069f1fb8 net: sched: sch: Fix off by one in htb_activate_prios()
    5660a6ffa7a4 ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak
    52844d8382cd nilfs2: fix underflow in second superblock position calculations
    9f95a161a7de kvm: initialize all of the kvm_debugregs structure before sending it to userspace
    9f4abf204827 i40e: Add checking for null for nlmsg_find_attr()
    e71554a09edf ipv6: Fix tcp socket connection with DSCP.
    388886f9708e ipv6: Fix datagram socket connection with DSCP.
    905199dac226 ixgbe: add double of VLAN header when computing the max MTU
    df099e65564a net: mpls: fix stale pointer if allocation fails during device rename
    736f8f66d7a9 net: stmmac: Restrict warning on disabling DMA store and fwd mode
    1a2c7951424c bnxt_en: Fix mqprio and XDP ring checking logic
    de44bdebcfe4 net: stmmac: fix order of dwmac5 FlexPPS parametrization sequence
    a753352622b4 net/usb: kalmia: Don't pass act_len in usb_bulk_msg error path
    0c2651c76369 dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions.
    a4e9411769a7 sctp: sctp_sock_filter(): avoid list_entry() on possibly empty list
    e1b54b561250 net: bgmac: fix BCM5358 support by setting correct flags
    8a4d05b0ffc8 i40e: add double of VLAN header when computing the max MTU
    fdeb4c258bc6 ixgbe: allow to increase MTU to 3K with XDP enabled
    32d81fd54e4e revert "squashfs: harden sanity check in squashfs_read_xattr_id_table"
    4c8011e77c27 net: Fix unwanted sign extension in netdev_stats_to_stats64()
    6b08c9fc72c6 Revert "mm: Always release pages to the buddy allocator in memblock_free_late()."
    8c07792e79cf hugetlb: check for undefined shift on 32 bit architectures
    7caeb5457bd0 sched/psi: Fix use-after-free in ep_remove_wait_queue()
    6c38aa4020b6 ALSA: hda/realtek - fixed wrong gpio assigned
    6e0ef3fc6560 ALSA: hda/conexant: add a new hda codec SN6180
    e9b488d60f51 mmc: mmc_spi: fix error handling in mmc_spi_probe()
    761db46b29b4 mmc: sdio: fix possible resource leaks in some error paths
    98895c225e28 ipv4: Fix incorrect route flushing when source address is deleted
    04a331c9dd66 Revert "ipv4: Fix incorrect route flushing when source address is deleted"
    85eda8088334 xfs: sync lazy sb accounting on quiesce of read-only mounts
    fb8ee907c145 xfs: prevent UAF in xfs_log_item_in_current_chkpt
    7c07806ab05c xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
    313699d5053c xfs: ensure inobt record walks always make forward progress
    7f9309a9f580 xfs: fix missing CoW blocks writeback conversion retry
    6246b3a18f7e xfs: only relog deferred intent items if free space in the log gets low
    09d61814476c xfs: expose the log push threshold
    5d711e41361c xfs: periodically relog deferred intent items
    870e7d710843 xfs: change the order in which child and parent defer ops are finished
    f5af1d5c2dfe xfs: fix an incore inode UAF in xfs_bui_recover
    efcdc2e70e01 xfs: clean up xfs_bui_item_recover iget/trans_alloc/ilock ordering
    abad319deef5 xfs: clean up bmap intent item recovery checking
    6601531db861 xfs: xfs_defer_capture should absorb remaining transaction reservation
    411b14e68c68 xfs: xfs_defer_capture should absorb remaining block reservations
    3324249e6ecd xfs: proper replay of deferred ops queued during log recovery
    1c89c0430561 xfs: fix finobt btree block recovery ordering
    6678b2787bb4 xfs: log new intent items created as part of finishing recovered intent items
    562da8e70463 xfs: refactor xfs_defer_finish_noroll
    42a2406f9015 xfs: turn dfp_intent into a xfs_log_item
    e11f1516fc9f xfs: merge the ->diff_items defer op into ->create_intent
    e84096edf886 xfs: merge the ->log_item defer op into ->create_intent
    64b21eaa33f5 xfs: factor out a xfs_defer_create_intent helper
    d24633f3c258 xfs: remove the xfs_inode_log_item_t typedef
    e0373eeaaaa3 xfs: remove the xfs_efd_log_item_t typedef
    94e0639992dd xfs: remove the xfs_efi_log_item_t typedef
    83ef55c4281f netfilter: nft_tproxy: restrict to prerouting hook
    b6ac5e6be513 btrfs: free device in btrfs_close_devices for a single device filesystem
    4326d0080f7e aio: fix mremap after fork null-deref
    62b19b9f3a0d nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association
    16409f7d9ca5 s390/decompressor: specify __decompress() buf len to avoid overflow
    fbe71c5dacaa net: sched: sch: Bounds check priority
    09561d5e6ab0 net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC
    a74d3b0ea984 net/rose: Fix to not accept on connected socket
    ec54c946b412 tools/virtio: fix the vringh test for virtio ring changes
    6644685f7971 ASoC: cs42l56: fix DT probe
    d23b66b16e30 selftests/bpf: Verify copy_register_state() preserves parent/live fields
    a94695e0f9c6 migrate: hugetlb: check for hugetlb shared PMD in node migration
    bcd34f1eea88 bpf: Always return target ifindex in bpf_fib_lookup
    776f2ccfdcef nvme-pci: Move enumeration by class to be last in the table
    5c8680988279 arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive
    4b97dab7cd98 arm64: dts: meson-g12-common: Make mmc host controller interrupts level-sensitive
    f0302e98edc8 arm64: dts: meson-gx: Make mmc host controller interrupts level-sensitive
    1509e9391616 riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte
    bb3187311ec2 ceph: flush cap releases when the session is flushed
    9b5d37d3288d usb: typec: altmodes/displayport: Fix probe pin assign check
    d9758f7deb5a usb: core: add quirk for Alcor Link AK9563 smartcard reader
    43379fcacea2 net: USB: Fix wrong-direction WARNING in plusb.c
    1bcb431237f1 pinctrl: intel: Restore the pins that used to be in Direct IRQ mode
    2b763f7de108 pinctrl: single: fix potential NULL dereference
    cc1affa23403 pinctrl: aspeed: Fix confusing types in return value
    f209431be199 ALSA: pci: lx6464es: fix a debug loop
    1aab663ecb78 selftests: forwarding: lib: quote the sysctl values
    ba38eacade35 rds: rds_rm_zerocopy_callback() use list_first_entry()
    87a5e3fc8416 ice: Do not use WQ_MEM_RECLAIM flag for workqueue
    f312958f588a ionic: clean interrupt before enabling queue to avoid credit race
    a532f7ebf9fd net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY
    73b8e217fe6f bonding: fix error checking in bond_debug_reregister()
    c89ddf134c53 xfrm: fix bug with DSCP copy to v6 from v4 tunnel
    80282a3d103f RDMA/usnic: use iommu_map_atomic() under spin_lock()
    fe4d70866839 iommu: Add gfp parameter to iommu_ops::map
    4a779187db39 IB/IPoIB: Fix legacy IPoIB due to wrong number of queues
    7896accedf5b IB/hfi1: Restore allocated resources on failed copyout
    ae774f480da3 can: j1939: do not wait 250 ms if the same addr was already claimed
    56ee31167ce5 tracing: Fix poll() and select() do not work on per_cpu trace_pipe and trace_pipe_raw
    039f935ae009 ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control()
    7e43bb69bc6f btrfs: zlib: zero-initialize zlib workspace
    ed29d8b309b5 btrfs: limit device extents to the device size
    9f296c615ec4 iio:adc:twl6030: Enable measurement of VAC
    9cf5e99c1ae1 wifi: brcmfmac: Check the count value of channel spec to prevent out-of-bounds reads
    e5142a4935c1 f2fs: fix to do sanity check on i_extra_isize in is_alive()
    3b3d3127f5b4 fbdev: smscufx: fix error handling code in ufx_usb_probe
    8edda487f085 powerpc/imc-pmu: Revert nest_init_lock to being a mutex
    fc8548c75c03 serial: 8250_dma: Fix DMA Rx rearm race
    71d6b277c4e5 serial: 8250_dma: Fix DMA Rx completion race
    ec5b4ca3d30b xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()
    5af2f74f9074 mm: swap: properly update readahead statistics in unuse_pte_range()
    ce62df33fcff nvmem: core: fix cell removal on error
    1369322c1de5 Squashfs: fix handling and sanity checking of xattr_ids count
    d49c85a19133 mm/swapfile: add cond_resched() in get_swap_pages()
    c127bf9a952a fpga: stratix10-soc: Fix return value check in s10_ops_write_init()
    6d86b4ceb09b mm: hugetlb: proc: check for hugetlb shared PMD in /proc/PID/smaps
    845a3708f04f riscv: disable generation of unwind tables
    c89af52d91ca parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case
    8e6cc45ba8ab parisc: Fix return code of pdc_iodc_print()
    7f5df45fcb26 iio:adc:twl6030: Enable measurements of VUSB, VBAT and others
    4b82cc9f7f05 iio: adc: berlin2-adc: Add missing of_node_put() in error path
    a300e358c6fc iio: hid: fix the retval in accel_3d_capture_sample
    2035cfb9586f efi: Accept version 2 of memory attributes table
    f6ea834e8dce watchdog: diag288_wdt: fix __diag288() inline assembly
    78e55b52b205 watchdog: diag288_wdt: do not use stack buffers for hardware data
    4abcd352a022 fbcon: Check font dimension limits
    e00d6a74c3c4 Input: i8042 - add Clevo PCX0DX to i8042 quirk table
    faed5af8a9c3 Input: i8042 - add TUXEDO devices to i8042 quirk tables
    ee77a19ee5b3 Input: i8042 - merge quirk tables
    a789c05516a4 Input: i8042 - move __initconst to fix code styling warning
    d0332cbf53da vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF
    5bf0010b87be usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait
    db3798943ab7 usb: dwc3: qcom: enable vbus override when in OTG dr-mode
    fefffc782500 usb: dwc3: dwc3-qcom: Fix typo in the dwc3 vbus override API
    e4650c04de90 iio: adc: stm32-dfsdm: fill module aliases
    165511b99ebc net/x25: Fix to not accept on connected socket
    b05664e036e1 i2c: rk3x: fix a bunch of kernel-doc warnings
    d4d765f4761f scsi: iscsi_tcp: Fix UAF during login when accessing the shost ipaddress
    6122ce1de1b2 scsi: target: core: Fix warning on RT kernels
    d92a25627bcd efi: fix potential NULL deref in efi_mem_reserve_persistent
    ed6c5e8caf55 net: openvswitch: fix flow memory leak in ovs_flow_cmd_new
    743f7b51fe7c virtio-net: Keep stop() to follow mirror sequence of open()
    aed972fbf6fa selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking
    df1213a26704 selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs
    6c70ece3d374 selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided
    d47f886d0c38 selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning
    db3f016ad500 ata: libata: Fix sata_down_spd_limit() when no link speed is reported
    6950df42a03c can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate
    cb079b077026 net: phy: meson-gxl: Add generic dummy stubs for MMD register access
    db76fc535fbd squashfs: harden sanity check in squashfs_read_xattr_id_table
    dffe83a198a6 netfilter: br_netfilter: disable sabotage_in hook after first suppression
    20355b9569bd netrom: Fix use-after-free caused by accept on already connected socket
    03eb2a1b03f3 fix "direction" argument of iov_iter_kvec()
    34b0fab797f0 fix iov_iter_bvec() "direction" argument
    50b70599c00b WRITE is "data source", not destination...
    21081886de0c scsi: Revert "scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT"
    14be8b0c4eed arm64: dts: imx8mm: Fix pad control for UART1_DTE_RX
    d6870f3800db ALSA: hda/via: Avoid potential array out-of-bound in add_secret_dac_path()
    412fddc09612 ASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use
    79dfde344e0f bus: sunxi-rsb: Fix error handling in sunxi_rsb_init()
    53785fd9b315 firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region

(From OE-Core rev: ad0877d917c2213fd7129ad9571f259d836cc75a)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Bruce Ashfield
fd5bb826ea linux-yocto/5.4: update to v5.4.231
Updating  to the latest korg -stable release that comprises
the following commits:

    59342376e8f0 Linux 5.4.231
    268d595d4da3 Revert "xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()"
    6c24a20223db usb: host: xhci-plat: add wakeup entry at sysfs
    1c1291a84e94 Bluetooth: fix null ptr deref on hci_sync_conn_complete_evt
    af51fc23a03f ipv6: ensure sane device mtu in tunnels
    a7cc1b5d76a2 exit: Use READ_ONCE() for all oops/warn limit reads
    eb768617dafa docs: Fix path paste-o for /sys/kernel/warn_count
    6f18d28c2634 panic: Expose "warn_count" to sysfs
    7c1273646f7e panic: Introduce warn_limit
    51538bdde3c2 panic: Consolidate open-coded panic_on_warn checks
    7020a9234e86 exit: Allow oops_limit to be disabled
    5a3482f2c1cc exit: Expose "oops_count" to sysfs
    28facdf7b097 exit: Put an upper limit on how often we can oops
    3fa431bac23c ia64: make IA64_MCA_RECOVERY bool instead of tristate
    86926761ca80 csky: Fix function name in csky_alignment() and die()
    3bf1fa2c7b0f h8300: Fix build errors from do_exit() to make_task_dead() transition
    fcae924b945e hexagon: Fix function name in die()
    49a128ae2823 objtool: Add a missing comma to avoid string concatenation
    9a18c9c8336f exit: Add and use make_task_dead.
    2f87e255123f mm: kasan: do not panic if both panic_on_warn and kasan_multishot set
    119f6bcef753 panic: unset panic_on_warn inside panic()
    f6c20ed17ef0 sysctl: add a new register_sysctl_init() interface
    dbe634ce8243 dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init
    1986cd616b63 blk-cgroup: fix missing pd_online_fn() while activating policy
    4923160393b0 bpf: Skip task with pid=1 in send_signal_common()
    bd393f0ad5b5 ARM: dts: imx: Fix pca9547 i2c-mux node name
    8667280a673a x86/asm: Fix an assembler warning with current binutils
    1a5119369a50 clk: Fix pointer casting to prevent oops in devm_clk_release()
    fbf7b0e4cef3 perf/x86/amd: fix potential integer overflow on shift of a int
    f571e340050d netfilter: conntrack: unify established states for SCTP paths
    8770cd9d7c14 x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL
    4d1757f9fe57 block: fix and cleanup bio_check_ro
    3a10a4d5d08a nfsd: Ensure knfsd shuts down when the "nfsd" pseudofs is unmounted
    52462669581f Revert "Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode"
    f7a564412931 net: mdio-mux-meson-g12a: force internal PHY off on mux switch
    2635c4fd91ca net: xgene: Move shared header file into include/linux
    a70b966c6c1e net/phy/mdio-i2c: Move header file to include/linux/mdio
    a9a022a0db1a net/tg3: resolve deadlock in tg3_reset_task() during EEH
    92a65b0f207b thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type()
    e249cea3abd5 net: ravb: Fix possible hang if RIS2_QFF1 happen
    a7585028ac0a sctp: fail if no bound addresses can be used for a given scope
    dae05cd3716f net/sched: sch_taprio: do not schedule in taprio_reset()
    fe9b9e621ceb netrom: Fix use-after-free of a listening socket.
    67ac3b4cd551 netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE
    8f0eb24f1a7a ipv4: prevent potential spectre v1 gadget in fib_metrics_match()
    746db9ec1e67 ipv4: prevent potential spectre v1 gadget in ip_metrics_convert()
    4cde1d2f16b6 netlink: annotate data races around sk_state
    c64bb8547160 netlink: annotate data races around dst_portid and dst_group
    ea11a52f55c9 netlink: annotate data races around nlk->portid
    cfdd81ae4752 netfilter: nft_set_rbtree: skip elements in transaction from garbage collection
    ddd49cbbd4c1 net: fix UaF in netns ops registration error path
    3e5082b1c66c netlink: prevent potential spectre v1 gadgets
    66e10d5f3996 EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info
    594618c701ac EDAC/device: Respect any driver-supplied workqueue polling value
    a536d87ec73f ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment
    768e8cdf93e7 thermal: intel: int340x: Protect trip temperature from concurrent updates
    aa33d334bd7e KVM: x86/vmx: Do not skip segment attributes if unusable bit is set
    91be54849d53 cifs: Fix oops due to uncleared server->smbd_conn in reconnect
    bcb65adaa9a1 ftrace/scripts: Update the instructions for ftrace-bisect.sh
    31b2414abeaa trace_events_hist: add check for return value of 'create_hist_field'
    76b2390fdc80 tracing: Make sure trace_printk() can output as soon as it can be used
    4a4a22dda0a3 module: Don't wait for GOING modules
    1cd70d842731 scsi: hpsa: Fix allocation size for scsi_host_alloc()
    4d55f918e1cd Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
    e588a5872d41 Revert "Revert "xhci: Set HCD flag to defer primary roothub registration""
    8eb5a68064a5 fs: reiserfs: remove useless new_opts in reiserfs_remount
    a61bc9197d90 netfilter: conntrack: do not renew entry stuck in tcp SYN_SENT state
    d39117d7797f Revert "selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID"
    b4253b47bf5e mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting
    14b70b4b4a1c mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning
    7e66f28ce510 mmc: sdhci-esdhc-imx: clear pending interrupt and halt cqhci
    a58c144b9e69 lockref: stop doing cpu_relax in the cmpxchg loop
    d6ff82a4d712 platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK
    295690bb0596 platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD
    890d850cb25b scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id
    45b3fc9cc64b KVM: s390: interrupt: use READ_ONCE() before cmpxchg()
    dc0867c44722 spi: spidev: remove debug messages that access spidev->spi without locking
    0dfd34fb4506 ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets
    9e02118045f8 ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC
    3163f4ed49bd cpufreq: armada-37xx: stop using 0 as NULL pointer
    1ec79234c20a s390/debug: add _ASM_S390_ prefix to header guard
    18699224059c drm: Add orientation quirk for Lenovo ideapad D330-10IGL
    aff2bc578482 ASoC: fsl_micfil: Correct the number of steps on SX controls
    1c587aa6cd23 cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist
    8cca0afccefd tcp: fix rate_app_limited to default to 1
    11a4d51a4f18 net: dsa: microchip: ksz9477: port map correction in ALU table entry register
    02a4a7dc90c2 driver core: Fix test_async_probe_init saves device in wrong array
    276052159ba9 w1: fix WARNING after calling w1_process()
    82867190ce30 w1: fix deadloop in __w1_remove_master_device()
    c9ada353403d tcp: avoid the lookup process failing to get sk in ehash table
    e963b33723f7 dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
    9b4482267eee dmaengine: xilinx_dma: Fix devm_platform_ioremap_resource error handling
    fe39e74a6435 dmaengine: xilinx_dma: use devm_platform_ioremap_resource()
    d3065cc56221 HID: betop: check shape of output reports
    d16b83c804ad net: macb: fix PTP TX timestamp failure due to packet padding
    18dd3b30d4c7 dmaengine: Fix double increment of client_count in dma_chan_get()
    cbed756bd198 drm/panfrost: fix GENERIC_ATOMIC64 dependency
    914c58fec1a6 net: mlx5: eliminate anonymous module_init & module_exit
    7335ba0c0345 usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
    a8d40942df07 usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
    edec50677b41 HID: revert CHERRY_MOUSE_000C quirk
    efa29f4ba01e net: stmmac: fix invalid call to mdiobus_get_phy()
    8c3653c4e71f HID: check empty report_list in bigben_probe()
    89e7fe3999e0 HID: check empty report_list in hid_validate_values()
    8a7b9560a3a8 net: mdio: validate parameter addr in mdiobus_get_phy()
    ce1e79bf31aa net: usb: sr9700: Handle negative len
    4fd6a6b1019e l2tp: Don't sleep and disable BH under writer-side sk_callback_lock
    7188c37f3c25 l2tp: Serialize access to sk_user_data with sk_callback_lock
    24c7614d31c8 net: fix a concurrency bug in l2tp_tunnel_register()
    1200388a0b1c net/sched: sch_taprio: fix possible use-after-free
    9042a9a3f29c wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid
    de0e084f85ff gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
    8df414fce41c net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs
    a59cdbda3714 net: nfc: Fix use-after-free in local_cleanup()
    2a05d513d2b9 phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in rockchip_usb2phy_power_on()
    81b3374944d2 bpf: Fix pointer-leak due to insufficient speculative store bypass mitigation
    8b35c7f6920d amd-xgbe: Delay AN timeout during KR training
    b85e0bb478fd amd-xgbe: TX Flow Ctrl Registers are h/w ver dependent
    3d41f4eeabd0 affs: initialize fsdata in affs_truncate()
    03965f8ad2cd IB/hfi1: Fix expected receive setup error exit issues
    f5c918dc4ed9 IB/hfi1: Reserve user expected TIDs
    d307c75f4328 IB/hfi1: Reject a zero-length user expected buffer
    902063a9fea5 RDMA/core: Fix ib block iterator counter overflow
    048c17b619b4 tomoyo: fix broken dependency on *.conf.default
    8d23f5d25264 EDAC/highbank: Fix memory leak in highbank_mc_probe()
    97445814efcd HID: intel_ish-hid: Add check for ishtp_dma_tx_map
    4be51ea91a8b ARM: imx: add missing of_node_put()
    12a763015b83 ARM: imx35: Retrieve the IIM base address from devicetree
    3b76bc159878 ARM: imx31: Retrieve the IIM base address from devicetree
    61669e6dec15 ARM: imx27: Retrieve the SYSCTRL base address from devicetree
    d4e913bad2b5 ARM: dts: imx6qdl-gw560x: Remove incorrect 'uart-has-rtscts'
    6d7f38426895 memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe()
    8959188b2f31 memory: atmel-sdramc: Fix missing clk_disable_unprepare in atmel_ramc_probe()
    310268050d58 clk: Provide new devm_clk helpers for prepared and enabled clocks
    c7ef7185a15f clk: generalize devm_clk_get() a bit

(From OE-Core rev: 13e4ca633d1f0897b5bbe1b40d399faa95bac24c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Chee Yang Lee
342bf915dc git: ignore CVE-2023-22743
(From OE-Core rev: 3f106ad3ebafbf850e42bcb46661cc0b6e40e4cc)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit 70adf86b515934168a6185dcff4a8edb39a40017)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Chee Yang Lee
72707c04e1 qemu: fix multple CVEs
import patches from ubuntu to fix
 CVE-2020-15469
 CVE-2020-15859
 CVE-2020-17380
 CVE-2020-35504
 CVE-2020-35505
 CVE-2021-3409
 CVE-2022-26354
https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches?h=ubuntu/focal-security

Combine patches for both CVE-2020-25085 and CVE-2021-3409 also fix CVE-2020-17380.
so mark CVE-2020-17380 fixed by CVE-2021-3409 patches. CVE-2020-17380 patch backported since
oecore rev 6b4c58a31ec11e557d40c31f2532985dd53e61eb.

(From OE-Core rev: 3ee2e9027d57dd5ae9f8795436c1acd18a9f1e24)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 20:23:23 +01:00
Richard Purdie
f76c7b8e63 base-files: Drop localhost.localdomain from hosts file
This was likely something we took inspiration from elsewhere with.
It was added in:

https://git.openembedded.org/openembedded/commit/packages/netbase/netbase/hosts?id=c8e5702127e507e82e6f68a4b8c546803accea9d

in 2005. Debian added this entry around 2004 and discussed and dropped
it in 2005:

https://lists.debian.org/debian-devel/2005/10/msg00559.html

resulting in:

3c15ee521b

We should drop this for some of the reasons in those threads,
it doesn't seem to be doing anything too helpful and isn't what most
applications expect.

(From OE-Core rev: a04b207c4ffa900313a0b5e3079ad2eec7d31f27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e730d005fa8aec07f9ae25c58d4566eaa92a6997)
Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Kenfe-Mickael Laventure
1c69728f31 populate_sdk_ext: Handle spaces within user $PATH
The script generated by the sdk_ext_postinst function was not quoting
the user existing PATH when updating it causing the export command to
fail.

Add necessary double quotes around $PATH.

(From OE-Core rev: b8298401c710146ae35f282048b66d5773a513ed)

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 00e96bf250eaaded839caf465dbc0af5b604aed7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Kenfe-Mickael Laventure
048d8b8c71 toolchain-scripts: Handle spaces within user $PATH
The environment-setup script generated by the recipe was not quoting the
user existing PATH when updating it causing the export command to fail.

Add necessary double quotes around $PATH.

(From OE-Core rev: ad6aaa77f1d08b4ca66f46e318f1a09b645d9e23)

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 42177ff2d45ee70ad00917bb6fbabca49dae4f59)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Kenfe-Mickael Laventure
afaadab7e9 buildtools-tarball: Handle spaces within user $PATH
The environment-setup script generated by the recipe was not quoting the
user existing PATH when updating it causing the export command to fail.

Add necessary double quotes around $PATH.

(From OE-Core rev: 9ececa2c36eff7c954d92e9d13a2fe8c1fae9bd2)

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 2d4c032bf3187aaa953a0c33a999074e695f54bb)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Richard Purdie
f160d63cb5 glibc: Add missing binutils dependency
glibc has it's dependencies handled more manually due to it's place
in the toolchain bootstrap. It depends upon the compiler and indirectly
through that to binutils. This did mean that if binutils changes and the
compiler does not, sstate and hash equivalence could mean that glibc
wouldn't rebuild.

Add a direct dependency on binutils that if it changes, it forces glibc
to rebuild, as it should.

(From OE-Core rev: ea6d768d0910e2076a971bdba57605dd9d68763a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c4a7b3decff636292f5e76e95406a22b6fe4a994)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Richard Purdie
9cfc1a05ba staging/multilib: Fix manifest corruption
The previous fix wasn't enough to address all the possible ways the
manifests might be ordered. Rework the previous fix so it is tied
to the multilib cross-canadian code which is causing the problem.

RECIPE_SYSROOT_MANIFEST_SUBDIR is not documented as I'd hope nobody
ever needs to use this outside the core multilib code.

(From OE-Core rev: 271ac31e15d00d636e888a1f3b7d4e22e0b8267a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit beab42e00713880cd95a04729c892f8662fbcbed)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Richard Purdie
1daa0b9922 staging: Separate out different multiconfig manifests
"""
require conf/multilib.conf
MACHINE = "qemuarm64"
MULTILIBS = "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 = "armv7athf-neon"

bitbake gcc-cross-canadian-arm
"""

and then inspecting the lib32* manifest files under recipe-sysroot-native shows
them referencing lib32-recipe-sysroot instead of recipe-sysroot as used by
gcc-cross-canadian recipes.

To fix this separate out the manifest by multilib. It is caching mechanism to
optimise disk usage so this doesn't break anything, just separated out some files.

(From OE-Core rev: eb9c6f7ac91431a6296789c23900f2a3016ef619)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 891d3faa3ed3d1cc231da58e5fa1325f05d5ade5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Alban Bedel
97b1bdd293 systemd: Fix systemd when used with busybox less
Per default systemd use a pager for the output of most of its tools
and it expect this pager to be color capable. But that is not the case
when the busybox `less` is used, which lead to output garbled by color
escape sequences.

To fix this issue add a profile frament that disable the systemd pager
when busybox `less` is detected.

(From OE-Core rev: 06271fd8d26bc34448524157077c23eb1ea29c52)

Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit de7e36a7858ebca4615975967fcad1c399eacdb0)
Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Ross Burton
be80f805d4 vim: set modified-by to the recipe MAINTAINER
Clause II.3 of the Vim license states that any distribution of Vim that
has been extended or modified must _at least_ indicate in the :version
output that this is the case.

Handily, Vim has a --with-modified-by argument to add a line in that
text, so use MAINTAINER.  This is the distribution maintainer contact,
by default it is OE-Core Developers
<openembedded-core@lists.openembedded.org>.

(From OE-Core rev: e630b404b1d1797be5e915592a6ef71e34aaf680)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit acc007e23445aa53182e13902dd9509c39dd5645)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Ross Burton
0f0b0b0a9b vim: upgrade to 9.0.1403
This incorporates fixes for CVE-2023-1127, CVE-2023-1170, CVE-2023-1175.

Also remove runtime/doc/uganda.txt from the license checksum: the Vim
license is also in the top-level LICENSE file so this is redundant.

(From OE-Core rev: 9351cd3bf259260c17e7c99612b3c28d58a89bf3)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 71111e6b62d37c5e6853d7940dec2993df127a35)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Chee Yang Lee
7b2e3ff618 libksba: fix CVE-2022-3515
(From OE-Core rev: 16d8176218230007dac98cd0d941da03a354e90c)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Chee Yang Lee
1351d0261b ghostscript: add CVE tag for check-stack-limits-after-function-evalution.patch
This patch fix CVE-2021-45944.
https://nvd.nist.gov/vuln/detail/CVE-2021-45944

(From OE-Core rev: d966b565d39bf50f058b388235ccea5ab0c2e60b)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Hitendra Prajapati
e88f47da0e QEMU: CVE-2022-4144 QXL: qxl_phys2virt unsafe address translation can lead to out-of-bounds read
Upstream-Status: Backport from 6dbbf05514

(From OE-Core rev: 754cce68614c7985d5848134635a6b318f4505ab)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>

Replace the tabs with spaces to correct the indent.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:59 +00:00
Andrej Valek
51a742eab1 libarchive: fix CVE-2022-26280
Backport fix from https://github.com/libarchive/libarchive/issues/1672

(From OE-Core rev: b23482f9ea1cc930a3d5ecfe5fc465e2f720a949)

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-25 23:00:58 +00:00
138 changed files with 16736 additions and 80 deletions

View File

@@ -1338,7 +1338,7 @@ class FetchCheckStatusTest(FetcherTest):
"http://downloads.yoctoproject.org/releases/sato/sato-engine-0.2.tar.gz",
"http://downloads.yoctoproject.org/releases/sato/sato-engine-0.3.tar.gz",
"https://yoctoproject.org/",
"https://yoctoproject.org/documentation",
"https://docs.yoctoproject.org/",
"http://downloads.yoctoproject.org/releases/opkg/opkg-0.1.7.tar.gz",
"http://downloads.yoctoproject.org/releases/opkg/opkg-0.3.0.tar.gz",
"ftp://sourceware.org/pub/libffi/libffi-1.20.tar.gz",

View File

@@ -1,13 +1,13 @@
DISTRO : "3.1.24"
DISTRO : "3.1.26"
DISTRO_NAME_NO_CAP : "dunfell"
DISTRO_NAME : "Dunfell"
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
YOCTO_DOC_VERSION : "3.1.24"
YOCTO_DOC_VERSION : "3.1.26"
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.4"
DISTRO_REL_TAG : "yocto-3.1.24"
DOCCONF_VERSION : "3.1.24"
DISTRO_REL_TAG : "yocto-3.1.26"
DOCCONF_VERSION : "3.1.26"
BITBAKE_SERIES : "1.46"
POKYVERSION : "23.0.24"
POKYVERSION : "23.0.26"
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"

View File

@@ -1,6 +1,6 @@
DISTRO = "poky"
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
DISTRO_VERSION = "3.1.24"
DISTRO_VERSION = "3.1.26"
DISTRO_CODENAME = "dunfell"
SDK_VENDOR = "-pokysdk"
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: GPL-2.0-only
#
# Include this class when you don't care what version of SPDX you get; it will
# be updated to the latest stable version that is supported
inherit create-spdx-2.2

View File

@@ -253,7 +253,7 @@ def check_cves(d, patched_cves):
"""
Connect to the NVD database and find unpatched cves.
"""
from oe.cve_check import Version
from oe.cve_check import Version, convert_cve_version
pn = d.getVar("PN")
real_pv = d.getVar("PV")
@@ -317,6 +317,9 @@ def check_cves(d, patched_cves):
if cve in cve_whitelist:
ignored = True
version_start = convert_cve_version(version_start)
version_end = convert_cve_version(version_end)
if (operator_start == '=' and pv == version_start) or version_start == '-':
vulnerable = True
else:

View File

@@ -45,6 +45,7 @@ python multilib_virtclass_handler () {
e.data.setVar("RECIPE_SYSROOT", "${WORKDIR}/recipe-sysroot")
e.data.setVar("STAGING_DIR_TARGET", "${WORKDIR}/recipe-sysroot")
e.data.setVar("STAGING_DIR_HOST", "${WORKDIR}/recipe-sysroot")
e.data.setVar("RECIPE_SYSROOT_MANIFEST_SUBDIR", "nativesdk-" + variant)
e.data.setVar("MLPREFIX", variant + "-")
override = ":virtclass-multilib-" + variant
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)

View File

@@ -1140,6 +1140,14 @@ python split_and_strip_files () {
# Modified the file so clear the cache
cpath.updatecache(file)
def strip_pkgd_prefix(f):
nonlocal dvar
if f.startswith(dvar):
return f[len(dvar):]
return f
#
# First lets process debug splitting
#
@@ -1153,6 +1161,8 @@ python split_and_strip_files () {
for file in staticlibs:
results.append( (file,source_info(file, d)) )
d.setVar("PKGDEBUGSOURCES", {strip_pkgd_prefix(f): sorted(s) for f, s in results})
sources = set()
for r in results:
sources.update(r[1])
@@ -1460,6 +1470,7 @@ PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS
python emit_pkgdata() {
from glob import glob
import json
import gzip
def process_postinst_on_target(pkg, mlprefix):
pkgval = d.getVar('PKG_%s' % pkg)
@@ -1532,6 +1543,8 @@ fi
with open(data_file, 'w') as fd:
fd.write("PACKAGES: %s\n" % packages)
pkgdebugsource = d.getVar("PKGDEBUGSOURCES") or []
pn = d.getVar('PN')
global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split()
variants = (d.getVar('MULTILIB_VARIANTS') or "").split()
@@ -1551,17 +1564,32 @@ fi
pkgval = pkg
d.setVar('PKG_%s' % pkg, pkg)
extended_data = {
"files_info": {}
}
pkgdestpkg = os.path.join(pkgdest, pkg)
files = {}
files_extra = {}
total_size = 0
seen = set()
for f in pkgfiles[pkg]:
relpth = os.path.relpath(f, pkgdestpkg)
fpath = os.sep + os.path.relpath(f, pkgdestpkg)
fstat = os.lstat(f)
files[os.sep + relpth] = fstat.st_size
files[fpath] = fstat.st_size
extended_data["files_info"].setdefault(fpath, {})
extended_data["files_info"][fpath]['size'] = fstat.st_size
if fstat.st_ino not in seen:
seen.add(fstat.st_ino)
total_size += fstat.st_size
if fpath in pkgdebugsource:
extended_data["files_info"][fpath]['debugsrc'] = pkgdebugsource[fpath]
del pkgdebugsource[fpath]
d.setVar('FILES_INFO', json.dumps(files, sort_keys=True))
process_postinst_on_target(pkg, d.getVar("MLPREFIX"))
@@ -1582,6 +1610,10 @@ fi
sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
subdata_extended_file = pkgdatadir + "/extended/%s.json.gz" % pkg
with gzip.open(subdata_extended_file, "wt", encoding="utf-8") as f:
json.dump(extended_data, f, sort_keys=True, separators=(",", ":"))
# Symlinks needed for rprovides lookup
rprov = d.getVar('RPROVIDES_%s' % pkg) or d.getVar('RPROVIDES')
if rprov:
@@ -1612,7 +1644,8 @@ fi
write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
}
emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides"
emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides ${PKGDESTWORK}/extended"
emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS"
ldconfig_postinst_fragment() {
if [ x"$D" = "x" ]; then

View File

@@ -51,6 +51,8 @@ TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
SDK_ARCHIVE_TYPE ?= "tar.xz"
SDK_XZ_COMPRESSION_LEVEL ?= "-9"
SDK_XZ_OPTIONS ?= "${XZ_DEFAULTS} ${SDK_XZ_COMPRESSION_LEVEL}"
SDK_ZIP_OPTIONS ?= "-y"
# To support different sdk type according to SDK_ARCHIVE_TYPE, now support zip and tar.xz
python () {
@@ -58,7 +60,7 @@ python () {
d.setVar('SDK_ARCHIVE_DEPENDS', 'zip-native')
# SDK_ARCHIVE_CMD used to generate archived sdk ${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE} from input dir ${SDK_OUTPUT}/${SDKPATH} to output dir ${SDKDEPLOYDIR}
# recommand to cd into input dir first to avoid archive with buildpath
d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; zip -r -y ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE} .')
d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; zip -r ${SDK_ZIP_OPTIONS} ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE} .')
else:
d.setVar('SDK_ARCHIVE_DEPENDS', 'xz-native')
d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')

View File

@@ -363,7 +363,8 @@ python copy_buildsystem () {
f.write('BUILDCFG_HEADER = ""\n\n')
# Write METADATA_REVISION
f.write('METADATA_REVISION = "%s"\n\n' % d.getVar('METADATA_REVISION'))
# Needs distro override so it can override the value set in the bbclass code (later than local.conf)
f.write('METADATA_REVISION:%s = "%s"\n\n' % (d.getVar('DISTRO'), d.getVar('METADATA_REVISION')))
f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n')
f.write('WITHIN_EXT_SDK = "1"\n\n')
@@ -669,7 +670,7 @@ sdk_ext_postinst() {
# A bit of another hack, but we need this in the path only for devtool
# so put it at the end of $PATH.
echo "export PATH=$target_sdk_dir/sysroots/${SDK_SYS}${bindir_nativesdk}:\$PATH" >> $env_setup_script
echo "export PATH=\"$target_sdk_dir/sysroots/${SDK_SYS}${bindir_nativesdk}:\$PATH\"" >> $env_setup_script
echo "printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script

View File

@@ -24,3 +24,5 @@ S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/"
UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/"
CVE_PRODUCT ?= "python:${PYPI_PACKAGE}"

View File

@@ -267,6 +267,10 @@ python extend_recipe_sysroot() {
pn = d.getVar("PN")
stagingdir = d.getVar("STAGING_DIR")
sharedmanifests = d.getVar("COMPONENTS_DIR") + "/manifests"
# only needed by multilib cross-canadian since it redefines RECIPE_SYSROOT
manifestprefix = d.getVar("RECIPE_SYSROOT_MANIFEST_SUBDIR")
if manifestprefix:
sharedmanifests = sharedmanifests + "/" + manifestprefix
recipesysroot = d.getVar("RECIPE_SYSROOT")
recipesysrootnative = d.getVar("RECIPE_SYSROOT_NATIVE")

View File

@@ -44,7 +44,7 @@ toolchain_create_sdk_env_script () {
for i in ${CANADIANEXTRAOS}; do
EXTRAPATH="$EXTRAPATH:$sdkpathnative$bindir/${TARGET_ARCH}${TARGET_VENDOR}-$i"
done
echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$PATH' >> $script
echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':"$PATH"' >> $script
echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig' >> $script
echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script

View File

@@ -22,21 +22,28 @@ SPDXLICENSEMAP[GPLv1.0] = "GPL-1.0"
SPDXLICENSEMAP[GPL-1.0-only] = "GPL-1.0"
SPDXLICENSEMAP[GPL-2] = "GPL-2.0"
SPDXLICENSEMAP[GPLv2] = "GPL-2.0"
SPDXLICENSEMAP[GPLv2+] = "GPL-2.0+"
SPDXLICENSEMAP[GPLv2.0] = "GPL-2.0"
SPDXLICENSEMAP[GPLv2.0+] = "GPL-2.0+"
SPDXLICENSEMAP[GPL-2.0-only] = "GPL-2.0"
SPDXLICENSEMAP[GPL-3] = "GPL-3.0"
SPDXLICENSEMAP[GPLv3] = "GPL-3.0"
SPDXLICENSEMAP[GPLv3+] = "GPL-3.0+"
SPDXLICENSEMAP[GPLv3.0] = "GPL-3.0"
SPDXLICENSEMAP[GPLv3.0+] = "GPL-3.0+"
SPDXLICENSEMAP[GPL-3.0-only] = "GPL-3.0"
#LGPL variations
SPDXLICENSEMAP[LGPLv2] = "LGPL-2.0"
SPDXLICENSEMAP[LGPLv2+] = "LGPL-2.0+"
SPDXLICENSEMAP[LGPLv2.0] = "LGPL-2.0"
SPDXLICENSEMAP[LGPL-2.0-only] = "LGPL-2.0"
SPDXLICENSEMAP[LGPL2.1] = "LGPL-2.1"
SPDXLICENSEMAP[LGPLv2.1] = "LGPL-2.1"
SPDXLICENSEMAP[LGPLv2.1+] = "LGPL-2.1+"
SPDXLICENSEMAP[LGPL-2.1-only] = "LGPL-2.1"
SPDXLICENSEMAP[LGPLv3] = "LGPL-3.0"
SPDXLICENSEMAP[LGPLv3+] = "LGPL-3.0+"
SPDXLICENSEMAP[LGPL-3.0-only] = "LGPL-3.0"
#MPL variations

File diff suppressed because it is too large Load Diff

View File

@@ -172,3 +172,40 @@ def get_cpe_ids(cve_product, version):
cpe_ids.append(cpe_id)
return cpe_ids
def convert_cve_version(version):
"""
This function converts from CVE format to Yocto version format.
eg 8.3_p1 -> 8.3p1, 6.2_rc1 -> 6.2-rc1
Unless it is redefined using CVE_VERSION in the recipe,
cve_check uses the version in the name of the recipe (${PV})
to check vulnerabilities against a CVE in the database downloaded from NVD.
When the version has an update, i.e.
"p1" in OpenSSH 8.3p1,
"-rc1" in linux kernel 6.2-rc1,
the database stores the version as version_update (8.3_p1, 6.2_rc1).
Therefore, we must transform this version before comparing to the
recipe version.
In this case, the parameter of the function is 8.3_p1.
If the version uses the Release Candidate format, "rc",
this function replaces the '_' by '-'.
If the version uses the Update format, "p",
this function removes the '_' completely.
"""
import re
matches = re.match('^([0-9.]+)_((p|rc)[0-9]+)$', version)
if not matches:
return version
version = matches.group(1)
update = matches.group(2)
if matches.group(3) == "rc":
return version + '-' + update
return version + update

View File

@@ -57,6 +57,17 @@ def read_subpkgdata_dict(pkg, d):
ret[newvar] = subd[var]
return ret
def read_subpkgdata_extended(pkg, d):
import json
import gzip
fn = d.expand("${PKGDATA_DIR}/extended/%s.json.gz" % pkg)
try:
with gzip.open(fn, "rt", encoding="utf-8") as f:
return json.load(f)
except FileNotFoundError:
return None
def _pkgmap(d):
"""Return a dictionary mapping package to recipe name."""

84
meta/lib/oe/sbom.py Normal file
View File

@@ -0,0 +1,84 @@
#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: GPL-2.0-only
#
import collections
DepRecipe = collections.namedtuple("DepRecipe", ("doc", "doc_sha1", "recipe"))
DepSource = collections.namedtuple("DepSource", ("doc", "doc_sha1", "recipe", "file"))
def get_recipe_spdxid(d):
return "SPDXRef-%s-%s" % ("Recipe", d.getVar("PN"))
def get_download_spdxid(d, idx):
return "SPDXRef-Download-%s-%d" % (d.getVar("PN"), idx)
def get_package_spdxid(pkg):
return "SPDXRef-Package-%s" % pkg
def get_source_file_spdxid(d, idx):
return "SPDXRef-SourceFile-%s-%d" % (d.getVar("PN"), idx)
def get_packaged_file_spdxid(pkg, idx):
return "SPDXRef-PackagedFile-%s-%d" % (pkg, idx)
def get_image_spdxid(img):
return "SPDXRef-Image-%s" % img
def get_sdk_spdxid(sdk):
return "SPDXRef-SDK-%s" % sdk
def write_doc(d, spdx_doc, subdir, spdx_deploy=None, indent=None):
from pathlib import Path
if spdx_deploy is None:
spdx_deploy = Path(d.getVar("SPDXDEPLOY"))
dest = spdx_deploy / subdir / (spdx_doc.name + ".spdx.json")
dest.parent.mkdir(exist_ok=True, parents=True)
with dest.open("wb") as f:
doc_sha1 = spdx_doc.to_json(f, sort_keys=True, indent=indent)
l = spdx_deploy / "by-namespace" / spdx_doc.documentNamespace.replace("/", "_")
l.parent.mkdir(exist_ok=True, parents=True)
l.symlink_to(os.path.relpath(dest, l.parent))
return doc_sha1
def read_doc(fn):
import hashlib
import oe.spdx
import io
import contextlib
@contextlib.contextmanager
def get_file():
if isinstance(fn, io.IOBase):
yield fn
else:
with fn.open("rb") as f:
yield f
with get_file() as f:
sha1 = hashlib.sha1()
while True:
chunk = f.read(4096)
if not chunk:
break
sha1.update(chunk)
f.seek(0)
doc = oe.spdx.SPDXDocument.from_json(f)
return (doc, sha1.hexdigest())

357
meta/lib/oe/spdx.py Normal file
View File

@@ -0,0 +1,357 @@
#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: GPL-2.0-only
#
#
# This library is intended to capture the JSON SPDX specification in a type
# safe manner. It is not intended to encode any particular OE specific
# behaviors, see the sbom.py for that.
#
# The documented SPDX spec document doesn't cover the JSON syntax for
# particular configuration, which can make it hard to determine what the JSON
# syntax should be. I've found it is actually much simpler to read the official
# SPDX JSON schema which can be found here: https://github.com/spdx/spdx-spec
# in schemas/spdx-schema.json
#
import hashlib
import itertools
import json
SPDX_VERSION = "2.2"
#
# The following are the support classes that are used to implement SPDX object
#
class _Property(object):
"""
A generic SPDX object property. The different types will derive from this
class
"""
def __init__(self, *, default=None):
self.default = default
def setdefault(self, dest, name):
if self.default is not None:
dest.setdefault(name, self.default)
class _String(_Property):
"""
A scalar string property for an SPDX object
"""
def __init__(self, **kwargs):
super().__init__(**kwargs)
def set_property(self, attrs, name):
def get_helper(obj):
return obj._spdx[name]
def set_helper(obj, value):
obj._spdx[name] = value
def del_helper(obj):
del obj._spdx[name]
attrs[name] = property(get_helper, set_helper, del_helper)
def init(self, source):
return source
class _Object(_Property):
"""
A scalar SPDX object property of a SPDX object
"""
def __init__(self, cls, **kwargs):
super().__init__(**kwargs)
self.cls = cls
def set_property(self, attrs, name):
def get_helper(obj):
if not name in obj._spdx:
obj._spdx[name] = self.cls()
return obj._spdx[name]
def set_helper(obj, value):
obj._spdx[name] = value
def del_helper(obj):
del obj._spdx[name]
attrs[name] = property(get_helper, set_helper)
def init(self, source):
return self.cls(**source)
class _ListProperty(_Property):
"""
A list of SPDX properties
"""
def __init__(self, prop, **kwargs):
super().__init__(**kwargs)
self.prop = prop
def set_property(self, attrs, name):
def get_helper(obj):
if not name in obj._spdx:
obj._spdx[name] = []
return obj._spdx[name]
def set_helper(obj, value):
obj._spdx[name] = list(value)
def del_helper(obj):
del obj._spdx[name]
attrs[name] = property(get_helper, set_helper, del_helper)
def init(self, source):
return [self.prop.init(o) for o in source]
class _StringList(_ListProperty):
"""
A list of strings as a property for an SPDX object
"""
def __init__(self, **kwargs):
super().__init__(_String(), **kwargs)
class _ObjectList(_ListProperty):
"""
A list of SPDX objects as a property for an SPDX object
"""
def __init__(self, cls, **kwargs):
super().__init__(_Object(cls), **kwargs)
class MetaSPDXObject(type):
"""
A metaclass that allows properties (anything derived from a _Property
class) to be defined for a SPDX object
"""
def __new__(mcls, name, bases, attrs):
attrs["_properties"] = {}
for key in attrs.keys():
if isinstance(attrs[key], _Property):
prop = attrs[key]
attrs["_properties"][key] = prop
prop.set_property(attrs, key)
return super().__new__(mcls, name, bases, attrs)
class SPDXObject(metaclass=MetaSPDXObject):
"""
The base SPDX object; all SPDX spec classes must derive from this class
"""
def __init__(self, **d):
self._spdx = {}
for name, prop in self._properties.items():
prop.setdefault(self._spdx, name)
if name in d:
self._spdx[name] = prop.init(d[name])
def serializer(self):
return self._spdx
def __setattr__(self, name, value):
if name in self._properties or name == "_spdx":
super().__setattr__(name, value)
return
raise KeyError("%r is not a valid SPDX property" % name)
#
# These are the SPDX objects implemented from the spec. The *only* properties
# that can be added to these objects are ones directly specified in the SPDX
# spec, however you may add helper functions to make operations easier.
#
# Defaults should *only* be specified if the SPDX spec says there is a certain
# required value for a field (e.g. dataLicense), or if the field is mandatory
# and has some sane "this field is unknown" (e.g. "NOASSERTION")
#
class SPDXAnnotation(SPDXObject):
annotationDate = _String()
annotationType = _String()
annotator = _String()
comment = _String()
class SPDXChecksum(SPDXObject):
algorithm = _String()
checksumValue = _String()
class SPDXRelationship(SPDXObject):
spdxElementId = _String()
relatedSpdxElement = _String()
relationshipType = _String()
comment = _String()
annotations = _ObjectList(SPDXAnnotation)
class SPDXExternalReference(SPDXObject):
referenceCategory = _String()
referenceType = _String()
referenceLocator = _String()
class SPDXPackageVerificationCode(SPDXObject):
packageVerificationCodeValue = _String()
packageVerificationCodeExcludedFiles = _StringList()
class SPDXPackage(SPDXObject):
ALLOWED_CHECKSUMS = [
"SHA1",
"SHA224",
"SHA256",
"SHA384",
"SHA512",
"MD2",
"MD4",
"MD5",
"MD6",
]
name = _String()
SPDXID = _String()
versionInfo = _String()
downloadLocation = _String(default="NOASSERTION")
supplier = _String(default="NOASSERTION")
homepage = _String()
licenseConcluded = _String(default="NOASSERTION")
licenseDeclared = _String(default="NOASSERTION")
summary = _String()
description = _String()
sourceInfo = _String()
copyrightText = _String(default="NOASSERTION")
licenseInfoFromFiles = _StringList(default=["NOASSERTION"])
externalRefs = _ObjectList(SPDXExternalReference)
packageVerificationCode = _Object(SPDXPackageVerificationCode)
hasFiles = _StringList()
packageFileName = _String()
annotations = _ObjectList(SPDXAnnotation)
checksums = _ObjectList(SPDXChecksum)
class SPDXFile(SPDXObject):
SPDXID = _String()
fileName = _String()
licenseConcluded = _String(default="NOASSERTION")
copyrightText = _String(default="NOASSERTION")
licenseInfoInFiles = _StringList(default=["NOASSERTION"])
checksums = _ObjectList(SPDXChecksum)
fileTypes = _StringList()
class SPDXCreationInfo(SPDXObject):
created = _String()
licenseListVersion = _String()
comment = _String()
creators = _StringList()
class SPDXExternalDocumentRef(SPDXObject):
externalDocumentId = _String()
spdxDocument = _String()
checksum = _Object(SPDXChecksum)
class SPDXExtractedLicensingInfo(SPDXObject):
name = _String()
comment = _String()
licenseId = _String()
extractedText = _String()
class SPDXDocument(SPDXObject):
spdxVersion = _String(default="SPDX-" + SPDX_VERSION)
dataLicense = _String(default="CC0-1.0")
SPDXID = _String(default="SPDXRef-DOCUMENT")
name = _String()
documentNamespace = _String()
creationInfo = _Object(SPDXCreationInfo)
packages = _ObjectList(SPDXPackage)
files = _ObjectList(SPDXFile)
relationships = _ObjectList(SPDXRelationship)
externalDocumentRefs = _ObjectList(SPDXExternalDocumentRef)
hasExtractedLicensingInfos = _ObjectList(SPDXExtractedLicensingInfo)
def __init__(self, **d):
super().__init__(**d)
def to_json(self, f, *, sort_keys=False, indent=None, separators=None):
class Encoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, SPDXObject):
return o.serializer()
return super().default(o)
sha1 = hashlib.sha1()
for chunk in Encoder(
sort_keys=sort_keys,
indent=indent,
separators=separators,
).iterencode(self):
chunk = chunk.encode("utf-8")
f.write(chunk)
sha1.update(chunk)
return sha1.hexdigest()
@classmethod
def from_json(cls, f):
return cls(**json.load(f))
def add_relationship(self, _from, relationship, _to, *, comment=None, annotation=None):
if isinstance(_from, SPDXObject):
from_spdxid = _from.SPDXID
else:
from_spdxid = _from
if isinstance(_to, SPDXObject):
to_spdxid = _to.SPDXID
else:
to_spdxid = _to
r = SPDXRelationship(
spdxElementId=from_spdxid,
relatedSpdxElement=to_spdxid,
relationshipType=relationship,
)
if comment is not None:
r.comment = comment
if annotation is not None:
r.annotations.append(annotation)
self.relationships.append(r)
def find_by_spdxid(self, spdxid):
for o in itertools.chain(self.packages, self.files):
if o.SPDXID == spdxid:
return o
return None
def find_external_document_ref(self, namespace):
for r in self.externalDocumentRefs:
if r.spdxDocument == namespace:
return r
return None

View File

@@ -1,5 +1,6 @@
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfFeature
from oeqa.runtime.decorator.package import OEHasPackage
import re
@@ -16,12 +17,14 @@ class RTCTest(OERuntimeTestCase):
self.logger.debug('Starting systemd-timesyncd daemon')
self.target.run('systemctl enable --now --runtime systemd-timesyncd')
@skipIfFeature('read-only-rootfs',
'Test does not work with read-only-rootfs in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['coreutils', 'busybox'])
def test_rtc(self):
(status, output) = self.target.run('hwclock -r')
self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output)
(status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"')
self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime)
@@ -32,7 +35,6 @@ class RTCTest(OERuntimeTestCase):
(status, output) = self.target.run('date %s' % current_datetime)
self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output)
(status, output) = self.target.run('hwclock -w')
self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output)

View File

@@ -48,6 +48,25 @@ class CVECheck(OESelftestTestCase):
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'")
def test_convert_cve_version(self):
from oe.cve_check import convert_cve_version
# Default format
self.assertEqual(convert_cve_version("8.3"), "8.3")
self.assertEqual(convert_cve_version(""), "")
# OpenSSL format version
self.assertEqual(convert_cve_version("1.1.1t"), "1.1.1t")
# OpenSSH format
self.assertEqual(convert_cve_version("8.3_p1"), "8.3p1")
self.assertEqual(convert_cve_version("8.3_p22"), "8.3p22")
# Linux kernel format
self.assertEqual(convert_cve_version("6.2_rc8"), "6.2-rc8")
self.assertEqual(convert_cve_version("6.2_rc31"), "6.2-rc31")
def test_recipe_report_json(self):
config = """
INHERIT += "cve-check"

View File

@@ -188,7 +188,7 @@ class ReproducibleTests(OESelftestTestCase):
def setUpLocal(self):
super().setUpLocal()
needed_vars = ['TOPDIR', 'TARGET_PREFIX', 'BB_NUMBER_THREADS']
needed_vars = ['TOPDIR', 'TARGET_PREFIX', 'BB_NUMBER_THREADS', 'BB_HASHSERVE']
bb_vars = get_bb_vars(needed_vars)
for v in needed_vars:
setattr(self, v.lower(), bb_vars[v])
@@ -259,7 +259,7 @@ class ReproducibleTests(OESelftestTestCase):
# mirror, forcing a complete build from scratch
config += textwrap.dedent('''\
SSTATE_DIR = "${TMPDIR}/sstate"
SSTATE_MIRRORS = ""
SSTATE_MIRRORS = "file://.*/.*-native.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH file://.*/.*-cross.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
''')
self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))

View File

@@ -177,6 +177,8 @@ class TestImage(OESelftestTestCase):
distro = oe.lsb.distro_identifier()
if distro and distro.startswith('almalinux'):
self.skipTest('virgl isn\'t working with Alma Linux')
if distro and distro.startswith('rocky'):
self.skipTest('virgl isn\'t working with Rocky Linux')
if distro and distro == 'debian-8':
self.skipTest('virgl isn\'t working with Debian 8')
if distro and distro == 'centos-7':
@@ -189,10 +191,14 @@ class TestImage(OESelftestTestCase):
self.skipTest('virgl isn\'t working with Fedora 35')
if distro and distro == 'fedora-36':
self.skipTest('virgl isn\'t working with Fedora 36')
if distro and distro == 'fedora-37':
self.skipTest('virgl isn\'t working with Fedora 37')
if distro and distro == 'opensuseleap-15.0':
self.skipTest('virgl isn\'t working with Opensuse 15.0')
if distro and distro == 'ubuntu-22.04':
self.skipTest('virgl isn\'t working with Ubuntu 22.04')
if distro and distro == 'ubuntu-22.10':
self.skipTest('virgl isn\'t working with Ubuntu 22.10')
qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native')
sdl_packageconfig = get_bb_var('PACKAGECONFIG', 'libsdl2-native')

View File

@@ -27,9 +27,9 @@ def metadata_from_bb():
data_dict = get_bb_vars()
# Distro information
info_dict['distro'] = {'id': data_dict['DISTRO'],
'version_id': data_dict['DISTRO_VERSION'],
'pretty_name': '%s %s' % (data_dict['DISTRO'], data_dict['DISTRO_VERSION'])}
info_dict['distro'] = {'id': data_dict.get('DISTRO', 'NODISTRO'),
'version_id': data_dict.get('DISTRO_VERSION', 'NO_DISTRO_VERSION'),
'pretty_name': '%s %s' % (data_dict.get('DISTRO', 'NODISTRO'), data_dict.get('DISTRO_VERSION', 'NO_DISTRO_VERSION'))}
# Host distro information
os_release = get_os_release()

View File

@@ -0,0 +1,54 @@
From 99e2c16ea1cced34a5dc450d76287a1c3e762138 Mon Sep 17 00:00:00 2001
From: Daniel Wagner <wagi@monom.org>
Date: Tue, 11 Apr 2023 08:12:56 +0200
Subject: gdhcp: Verify and sanitize packet length first
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/patch/?id=99e2c16ea1cced34a5dc450d76287a1c3e762138]
CVE: CVE-2023-28488
Signed-off-by: Ashish Sharma <asharma@mvista.com>
gdhcp/client.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 7efa7e45..82017692 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1319,9 +1319,9 @@ static bool sanity_check(struct ip_udp_dhcp_packet *packet, int bytes)
static int dhcp_recv_l2_packet(struct dhcp_packet *dhcp_pkt, int fd,
struct sockaddr_in *dst_addr)
{
- int bytes;
struct ip_udp_dhcp_packet packet;
uint16_t check;
+ int bytes, tot_len;
memset(&packet, 0, sizeof(packet));
@@ -1329,15 +1329,17 @@ static int dhcp_recv_l2_packet(struct dhcp_packet *dhcp_pkt, int fd,
if (bytes < 0)
return -1;
- if (bytes < (int) (sizeof(packet.ip) + sizeof(packet.udp)))
- return -1;
-
- if (bytes < ntohs(packet.ip.tot_len))
+ tot_len = ntohs(packet.ip.tot_len);
+ if (bytes > tot_len) {
+ /* ignore any extra garbage bytes */
+ bytes = tot_len;
+ } else if (bytes < tot_len) {
/* packet is bigger than sizeof(packet), we did partial read */
return -1;
+ }
- /* ignore any extra garbage bytes */
- bytes = ntohs(packet.ip.tot_len);
+ if (bytes < (int) (sizeof(packet.ip) + sizeof(packet.udp)))
+ return -1;
if (!sanity_check(&packet, bytes))
return -1;
--
cgit

View File

@@ -14,6 +14,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
file://CVE-2022-23098.patch \
file://CVE-2022-32292.patch \
file://CVE-2022-32293.patch \
file://CVE-2023-28488.patch \
"
SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"

View File

@@ -1,5 +1,6 @@
[Unit]
Conflicts=sshd.service
Wants=sshdgenkeys.service
[Socket]
ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd

View File

@@ -1,13 +1,11 @@
[Unit]
Description=OpenSSH Per-Connection Daemon
Wants=sshdgenkeys.service
After=sshdgenkeys.service
[Service]
Environment="SSHD_OPTS="
EnvironmentFile=-/etc/default/ssh
ExecStart=-@SBINDIR@/sshd -i $SSHD_OPTS
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
StandardInput=socket
StandardError=syslog
KillMode=process

View File

@@ -0,0 +1,226 @@
From 879f7080d7e141f415c79eaa3a8ac4a3dad0348b Mon Sep 17 00:00:00 2001
From: Pauli <pauli@openssl.org>
Date: Wed, 8 Mar 2023 15:28:20 +1100
Subject: [PATCH] x509: excessive resource use verifying policy constraints
A security vulnerability has been identified in all supported versions
of OpenSSL related to the verification of X.509 certificate chains
that include policy constraints. Attackers may be able to exploit this
vulnerability by creating a malicious certificate chain that triggers
exponential use of computational resources, leading to a denial-of-service
(DoS) attack on affected systems.
Fixes CVE-2023-0464
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/20569)
CVE: CVE-2023-0464
Upstream-Status: Backport [https://git.openssl.org/gitweb/?p=openssl.git;a=patch;h=879f7080d7e141f415c79eaa3a8ac4a3dad0348b]
Signed-off-by: Nikhil R <nikhil.r@kpit.com>
---
crypto/x509v3/pcy_local.h | 8 +++++++-
crypto/x509v3/pcy_node.c | 12 +++++++++---
crypto/x509v3/pcy_tree.c | 37 +++++++++++++++++++++++++++----------
3 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/crypto/x509v3/pcy_local.h b/crypto/x509v3/pcy_local.h
index 5daf78de45..344aa06765 100644
--- a/crypto/x509v3/pcy_local.h
+++ b/crypto/x509v3/pcy_local.h
@@ -111,6 +111,11 @@ struct X509_POLICY_LEVEL_st {
};
struct X509_POLICY_TREE_st {
+ /* The number of nodes in the tree */
+ size_t node_count;
+ /* The maximum number of nodes in the tree */
+ size_t node_maximum;
+
/* This is the tree 'level' data */
X509_POLICY_LEVEL *levels;
int nlevel;
@@ -159,7 +164,8 @@ X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk,
X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
X509_POLICY_DATA *data,
X509_POLICY_NODE *parent,
- X509_POLICY_TREE *tree);
+ X509_POLICY_TREE *tree,
+ int extra_data);
void policy_node_free(X509_POLICY_NODE *node);
int policy_node_match(const X509_POLICY_LEVEL *lvl,
const X509_POLICY_NODE *node, const ASN1_OBJECT *oid);
diff --git a/crypto/x509v3/pcy_node.c b/crypto/x509v3/pcy_node.c
index e2d7b15322..d574fb9d66 100644
--- a/crypto/x509v3/pcy_node.c
+++ b/crypto/x509v3/pcy_node.c
@@ -59,10 +59,15 @@ X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
X509_POLICY_DATA *data,
X509_POLICY_NODE *parent,
- X509_POLICY_TREE *tree)
+ X509_POLICY_TREE *tree,
+ int extra_data)
{
X509_POLICY_NODE *node;
+ /* Verify that the tree isn't too large. This mitigates CVE-2023-0464 */
+ if (tree->node_maximum > 0 && tree->node_count >= tree->node_maximum)
+ return NULL;
+
node = OPENSSL_zalloc(sizeof(*node));
if (node == NULL) {
X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE);
@@ -70,7 +75,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
}
node->data = data;
node->parent = parent;
- if (level) {
+ if (level != NULL) {
if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) {
if (level->anyPolicy)
goto node_error;
@@ -90,7 +95,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
}
}
- if (tree) {
+ if (extra_data) {
if (tree->extra_data == NULL)
tree->extra_data = sk_X509_POLICY_DATA_new_null();
if (tree->extra_data == NULL){
@@ -103,6 +108,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
}
}
+ tree->node_count++;
if (parent)
parent->nchild++;
diff --git a/crypto/x509v3/pcy_tree.c b/crypto/x509v3/pcy_tree.c
index 6e8322cbc5..6c7fd35405 100644
--- a/crypto/x509v3/pcy_tree.c
+++ b/crypto/x509v3/pcy_tree.c
@@ -13,6 +13,18 @@
#include "pcy_local.h"
+/*
+ * If the maximum number of nodes in the policy tree isn't defined, set it to
+ * a generous default of 1000 nodes.
+ *
+ * Defining this to be zero means unlimited policy tree growth which opens the
+ * door on CVE-2023-0464.
+ */
+
+#ifndef OPENSSL_POLICY_TREE_NODES_MAX
+# define OPENSSL_POLICY_TREE_NODES_MAX 1000
+#endif
+
/*
* Enable this to print out the complete policy tree at various point during
* evaluation.
@@ -168,6 +180,9 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
return X509_PCY_TREE_INTERNAL;
}
+ /* Limit the growth of the tree to mitigate CVE-2023-0464 */
+ tree->node_maximum = OPENSSL_POLICY_TREE_NODES_MAX;
+
/*
* http://tools.ietf.org/html/rfc5280#section-6.1.2, figure 3.
*
@@ -184,7 +199,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
level = tree->levels;
if ((data = policy_data_new(NULL, OBJ_nid2obj(NID_any_policy), 0)) == NULL)
goto bad_tree;
- if (level_add_node(level, data, NULL, tree) == NULL) {
+ if (level_add_node(level, data, NULL, tree, 1) == NULL) {
policy_data_free(data);
goto bad_tree;
}
@@ -243,7 +258,8 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
* Return value: 1 on success, 0 otherwise
*/
static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr,
- X509_POLICY_DATA *data)
+ X509_POLICY_DATA *data,
+ X509_POLICY_TREE *tree)
{
X509_POLICY_LEVEL *last = curr - 1;
int i, matched = 0;
@@ -253,13 +269,13 @@ static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr,
X509_POLICY_NODE *node = sk_X509_POLICY_NODE_value(last->nodes, i);
if (policy_node_match(last, node, data->valid_policy)) {
- if (level_add_node(curr, data, node, NULL) == NULL)
+ if (level_add_node(curr, data, node, tree, 0) == NULL)
return 0;
matched = 1;
}
}
if (!matched && last->anyPolicy) {
- if (level_add_node(curr, data, last->anyPolicy, NULL) == NULL)
+ if (level_add_node(curr, data, last->anyPolicy, tree, 0) == NULL)
return 0;
}
return 1;
@@ -272,7 +288,8 @@ static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr,
* Return value: 1 on success, 0 otherwise.
*/
static int tree_link_nodes(X509_POLICY_LEVEL *curr,
- const X509_POLICY_CACHE *cache)
+ const X509_POLICY_CACHE *cache,
+ X509_POLICY_TREE *tree)
{
int i;
@@ -280,7 +297,7 @@ static int tree_link_nodes(X509_POLICY_LEVEL *curr,
X509_POLICY_DATA *data = sk_X509_POLICY_DATA_value(cache->data, i);
/* Look for matching nodes in previous level */
- if (!tree_link_matching_nodes(curr, data))
+ if (!tree_link_matching_nodes(curr, data, tree))
return 0;
}
return 1;
@@ -311,7 +328,7 @@ static int tree_add_unmatched(X509_POLICY_LEVEL *curr,
/* Curr may not have anyPolicy */
data->qualifier_set = cache->anyPolicy->qualifier_set;
data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
- if (level_add_node(curr, data, node, tree) == NULL) {
+ if (level_add_node(curr, data, node, tree, 1) == NULL) {
policy_data_free(data);
return 0;
}
@@ -373,7 +390,7 @@ static int tree_link_any(X509_POLICY_LEVEL *curr,
}
/* Finally add link to anyPolicy */
if (last->anyPolicy &&
- level_add_node(curr, cache->anyPolicy, last->anyPolicy, NULL) == NULL)
+ level_add_node(curr, cache->anyPolicy, last->anyPolicy, tree, 0) == NULL)
return 0;
return 1;
}
@@ -555,7 +572,7 @@ static int tree_calculate_user_set(X509_POLICY_TREE *tree,
extra->qualifier_set = anyPolicy->data->qualifier_set;
extra->flags = POLICY_DATA_FLAG_SHARED_QUALIFIERS
| POLICY_DATA_FLAG_EXTRA_NODE;
- node = level_add_node(NULL, extra, anyPolicy->parent, tree);
+ node = level_add_node(NULL, extra, anyPolicy->parent, tree, 1);
}
if (!tree->user_policies) {
tree->user_policies = sk_X509_POLICY_NODE_new_null();
@@ -582,7 +599,7 @@ static int tree_evaluate(X509_POLICY_TREE *tree)
for (i = 1; i < tree->nlevel; i++, curr++) {
cache = policy_cache_set(curr->cert);
- if (!tree_link_nodes(curr, cache))
+ if (!tree_link_nodes(curr, cache, tree))
return X509_PCY_TREE_INTERNAL;
if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY)
--
2.34.1

View File

@@ -0,0 +1,60 @@
From b013765abfa80036dc779dd0e50602c57bb3bf95 Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Tue, 7 Mar 2023 16:52:55 +0000
Subject: [PATCH] Ensure that EXFLAG_INVALID_POLICY is checked even in leaf
certs
Even though we check the leaf cert to confirm it is valid, we
later ignored the invalid flag and did not notice that the leaf
cert was bad.
Fixes: CVE-2023-0465
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20588)
CVE: CVE-2023-0465
Upstream-Status: Backport [https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=b013765abfa80036dc779dd0e50602c57bb3bf95]
Comment: Refreshed first hunk
Signed-off-by: Omkar Patil <omkar.patil@kpit.com>
---
crypto/x509/x509_vfy.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index 925fbb5412..1dfe4f9f31 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -1649,18 +1649,25 @@
}
/* Invalid or inconsistent extensions */
if (ret == X509_PCY_TREE_INVALID) {
- int i;
+ int i, cbcalled = 0;
/* Locate certificates with bad extensions and notify callback. */
- for (i = 1; i < sk_X509_num(ctx->chain); i++) {
+ for (i = 0; i < sk_X509_num(ctx->chain); i++) {
X509 *x = sk_X509_value(ctx->chain, i);
if (!(x->ex_flags & EXFLAG_INVALID_POLICY))
continue;
+ cbcalled = 1;
if (!verify_cb_cert(ctx, x, i,
X509_V_ERR_INVALID_POLICY_EXTENSION))
return 0;
}
+ if (!cbcalled) {
+ /* Should not be able to get here */
+ X509err(X509_F_CHECK_POLICY, ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
+ /* The callback ignored the error so we return success */
return 1;
}
if (ret == X509_PCY_TREE_FAILURE) {
--
2.34.1

View File

@@ -0,0 +1,82 @@
From 0d16b7e99aafc0b4a6d729eec65a411a7e025f0a Mon Sep 17 00:00:00 2001
From: Tomas Mraz <tomas@openssl.org>
Date: Tue, 21 Mar 2023 16:15:47 +0100
Subject: [PATCH] Fix documentation of X509_VERIFY_PARAM_add0_policy()
The function was incorrectly documented as enabling policy checking.
Fixes: CVE-2023-0466
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20564)
CVE: CVE-2023-0466
Upstream-Status: Backport [https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=0d16b7e99aafc0b4a6d729eec65a411a7e025f0a]
Comment: Refreshed first hunk from CHANGE and NEWS
Signed-off-by: Omkar Patil <omkar.patil@kpit.com>
---
CHANGES | 5 +++++
NEWS | 1 +
doc/man3/X509_VERIFY_PARAM_set_flags.pod | 9 +++++++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/CHANGES b/CHANGES
index efccf7838e..b19f1429bb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,11 @@
Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
+ *) Corrected documentation of X509_VERIFY_PARAM_add0_policy() to mention
+ that it does not enable policy checking. Thanks to
+ David Benjamin for discovering this issue. (CVE-2023-0466)
+ [Tomas Mraz]
+
*) Fixed X.400 address type confusion in X.509 GeneralName.
There is a type confusion vulnerability relating to X.400 address processing
diff --git a/NEWS b/NEWS
index 36a9bb6890..62615693fa 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@
Major changes between OpenSSL 1.1.1s and OpenSSL 1.1.1t [7 Feb 2023]
+ o Fixed documentation of X509_VERIFY_PARAM_add0_policy() (CVE-2023-0466)
o Fixed X.400 address type confusion in X.509 GeneralName (CVE-2023-0286)
o Fixed Use-after-free following BIO_new_NDEF (CVE-2023-0215)
o Fixed Double free after calling PEM_read_bio_ex (CVE-2022-4450)
diff --git a/doc/man3/X509_VERIFY_PARAM_set_flags.pod b/doc/man3/X509_VERIFY_PARAM_set_flags.pod
index f6f304bf7b..aa292f9336 100644
--- a/doc/man3/X509_VERIFY_PARAM_set_flags.pod
+++ b/doc/man3/X509_VERIFY_PARAM_set_flags.pod
@@ -92,8 +92,9 @@ B<trust>.
X509_VERIFY_PARAM_set_time() sets the verification time in B<param> to
B<t>. Normally the current time is used.
-X509_VERIFY_PARAM_add0_policy() enables policy checking (it is disabled
-by default) and adds B<policy> to the acceptable policy set.
+X509_VERIFY_PARAM_add0_policy() adds B<policy> to the acceptable policy set.
+Contrary to preexisting documentation of this function it does not enable
+policy checking.
X509_VERIFY_PARAM_set1_policies() enables policy checking (it is disabled
by default) and sets the acceptable policy set to B<policies>. Any existing
@@ -377,6 +378,10 @@ and has no effect.
The X509_VERIFY_PARAM_get_hostflags() function was added in OpenSSL 1.1.0i.
+The function X509_VERIFY_PARAM_add0_policy() was historically documented as
+enabling policy checking however the implementation has never done this.
+The documentation was changed to align with the implementation.
+
=head1 COPYRIGHT
Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
--
2.34.1

View File

@@ -18,6 +18,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
file://afalg.patch \
file://reproducible.patch \
file://reproducibility.patch \
file://CVE-2023-0464.patch \
file://CVE-2023-0465.patch \
file://CVE-2023-0466.patch \
"
SRC_URI_append_class-nativesdk = " \

View File

@@ -1,4 +1,4 @@
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback

View File

@@ -1,7 +1,9 @@
require glibc-common.inc
require glibc-ld.inc
DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}binutils${BUSUFFIX} libgcc-initial linux-libc-headers"
BUSUFFIX= ""
BUSUFFIX:class-nativesdk = "-crosssdk"
PROVIDES = "virtual/libc"
PROVIDES += "virtual/libintl virtual/libiconv"

View File

@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk"
inherit core-image setuptools3
SRCREV ?= "9fbfbf002e210dbdb2a4b9f3adf8012f245cf38f"
SRCREV ?= "d91c3c124231b6094cd797de5d11110f80153ebb"
SRC_URI = "git://git.yoctoproject.org/poky;branch=dunfell \
file://Yocto_Build_Appliance.vmx \
file://Yocto_Build_Appliance.vmxf \

View File

@@ -0,0 +1,79 @@
From e4f85f1bd2eb34d9b49da9154a4cc3a1bc284f68 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 7 Apr 2023 11:46:35 +0200
Subject: [PATCH] [CVE-2023-28484] Fix null deref in xmlSchemaFixupComplexType
Fix a null pointer dereference when parsing (invalid) XML schemas.
Thanks to Robby Simpson for the report!
Fixes #491.
CVE: CVE-2023-28484
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/e4f85f1bd2eb34d9b49da9154a4cc3a1bc284f68]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
result/schemas/issue491_0_0.err | 1 +
test/schemas/issue491_0.xml | 1 +
test/schemas/issue491_0.xsd | 18 ++++++++++++++++++
xmlschemas.c | 2 +-
4 files changed, 21 insertions(+), 1 deletion(-)
create mode 100644 result/schemas/issue491_0_0.err
create mode 100644 test/schemas/issue491_0.xml
create mode 100644 test/schemas/issue491_0.xsd
diff --git a/result/schemas/issue491_0_0.err b/result/schemas/issue491_0_0.err
new file mode 100644
index 00000000..9b2bb969
--- /dev/null
+++ b/result/schemas/issue491_0_0.err
@@ -0,0 +1 @@
+./test/schemas/issue491_0.xsd:8: element complexType: Schemas parser error : complex type 'ChildType': The content type of both, the type and its base type, must either 'mixed' or 'element-only'.
diff --git a/test/schemas/issue491_0.xml b/test/schemas/issue491_0.xml
new file mode 100644
index 00000000..e2b2fc2e
--- /dev/null
+++ b/test/schemas/issue491_0.xml
@@ -0,0 +1 @@
+<Child xmlns="http://www.test.com">5</Child>
diff --git a/test/schemas/issue491_0.xsd b/test/schemas/issue491_0.xsd
new file mode 100644
index 00000000..81702649
--- /dev/null
+++ b/test/schemas/issue491_0.xsd
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.test.com" targetNamespace="http://www.test.com" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:complexType name="BaseType">
+ <xs:simpleContent>
+ <xs:extension base="xs:int" />
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="ChildType">
+ <xs:complexContent>
+ <xs:extension base="BaseType">
+ <xs:sequence>
+ <xs:element name="bad" type="xs:int" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Child" type="ChildType" />
+</xs:schema>
diff --git a/xmlschemas.c b/xmlschemas.c
index 6a353858..a4eaf591 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -18632,7 +18632,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
"allowed to appear inside other model groups",
NULL, NULL);
- } else if (! dummySequence) {
+ } else if ((!dummySequence) && (baseType->subtypes != NULL)) {
xmlSchemaTreeItemPtr effectiveContent =
(xmlSchemaTreeItemPtr) type->subtypes;
/*
--
GitLab

View File

@@ -0,0 +1,42 @@
From 547edbf1cbdccd46b2e8ff322a456eaa5931c5df Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 7 Apr 2023 11:49:27 +0200
Subject: [PATCH] [CVE-2023-29469] Hashing of empty dict strings isn't
deterministic
When hashing empty strings which aren't null-terminated,
xmlDictComputeFastKey could produce inconsistent results. This could
lead to various logic or memory errors, including double frees.
For consistency the seed is also taken into account, but this shouldn't
have an impact on security.
Found by OSS-Fuzz.
Fixes #510.
CVE: CVE-2023-29469
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/547edbf1cbdccd46b2e8ff322a456eaa5931c5df]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
dict.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dict.c b/dict.c
index 86c3f6d7..d7fd1a06 100644
--- a/dict.c
+++ b/dict.c
@@ -451,7 +451,8 @@ static unsigned long
xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) {
unsigned long value = seed;
- if (name == NULL) return(0);
+ if ((name == NULL) || (namelen <= 0))
+ return(value);
value = *name;
value <<= 5;
if (namelen > 10) {
--
GitLab

View File

@@ -36,6 +36,8 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=te
file://CVE-2016-3709.patch \
file://CVE-2022-40303.patch \
file://CVE-2022-40304.patch \
file://CVE-2023-28484.patch \
file://CVE-2023-29469.patch \
"
SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813"

View File

@@ -66,7 +66,7 @@ create_sdk_files_append () {
# Generate new (mini) sdk-environment-setup file
script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
touch $script
echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${sbindir_nativesdk}:${SDKPATHNATIVE}${base_bindir_nativesdk}:${SDKPATHNATIVE}${base_sbindir_nativesdk}:$PATH' >> $script
echo 'export PATH="${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${sbindir_nativesdk}:${SDKPATHNATIVE}${base_bindir_nativesdk}:${SDKPATHNATIVE}${base_sbindir_nativesdk}:$PATH"' >> $script
echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
echo 'export SSL_CERT_FILE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script

View File

@@ -0,0 +1,115 @@
From 612ebf6c913dd0e4197c44909cb3157f5c51a2f0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 31 Aug 2020 19:37:13 +0200
Subject: [PATCH] pager: set $LESSSECURE whenver we invoke a pager
Some extra safety when invoked via "sudo". With this we address a
genuine design flaw of sudo, and we shouldn't need to deal with this.
But it's still a good idea to disable this surface given how exotic it
is.
Prompted by #5666
CVE: CVE-2023-26604
Upstream-Status: Backport [https://github.com/systemd/systemd/pull/17270/commits/612ebf6c913dd0e4197c44909cb3157f5c51a2f0]
Comments: Hunk not refreshed
Signed-off-by: rajmohan r <rajmohan.r@kpit.com>
---
man/less-variables.xml | 9 +++++++++
man/systemctl.xml | 1 +
man/systemd.xml | 1 +
src/shared/pager.c | 23 +++++++++++++++++++++--
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/man/less-variables.xml b/man/less-variables.xml
index 08e513c99f8e..c52511ca8e18 100644
--- a/man/less-variables.xml
+++ b/man/less-variables.xml
@@ -64,6 +64,15 @@
the invoking terminal is determined to be UTF-8 compatible).</para></listitem>
</varlistentry>
+ <varlistentry id='lesssecure'>
+ <term><varname>$SYSTEMD_LESSSECURE</varname></term>
+
+ <listitem><para>Takes a boolean argument. Overrides the <varname>$LESSSECURE</varname> environment
+ variable when invoking the pager, which controls the "secure" mode of less (which disables commands
+ such as <literal>|</literal> which allow to easily shell out to external command lines). By default
+ less secure mode is enabled, with this setting it may be disabled.</para></listitem>
+ </varlistentry>
+
<varlistentry id='colors'>
<term><varname>$SYSTEMD_COLORS</varname></term>
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 1c5502883700..a3f0c3041a57 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -2240,6 +2240,7 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
<xi:include href="less-variables.xml" xpointer="pager"/>
<xi:include href="less-variables.xml" xpointer="less"/>
<xi:include href="less-variables.xml" xpointer="lesscharset"/>
+ <xi:include href="less-variables.xml" xpointer="lesssecure"/>
<xi:include href="less-variables.xml" xpointer="colors"/>
<xi:include href="less-variables.xml" xpointer="urlify"/>
</refsect1>
diff --git a/man/systemd.xml b/man/systemd.xml
index a9040545c2ab..c92cfef77689 100644
--- a/man/systemd.xml
+++ b/man/systemd.xml
@@ -692,6 +692,7 @@
<xi:include href="less-variables.xml" xpointer="pager"/>
<xi:include href="less-variables.xml" xpointer="less"/>
<xi:include href="less-variables.xml" xpointer="lesscharset"/>
+ <xi:include href="less-variables.xml" xpointer="lesssecure"/>
<xi:include href="less-variables.xml" xpointer="colors"/>
<xi:include href="less-variables.xml" xpointer="urlify"/>
diff --git a/src/shared/pager.c b/src/shared/pager.c
index e03be6d23b2d..9c21881241f5 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -9,6 +9,7 @@
#include <unistd.h>
#include "copy.h"
+#include "env-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "io-util.h"
@@ -152,8 +153,7 @@ int pager_open(PagerFlags flags) {
_exit(EXIT_FAILURE);
}
- /* Initialize a good charset for less. This is
- * particularly important if we output UTF-8
+ /* Initialize a good charset for less. This is particularly important if we output UTF-8
* characters. */
less_charset = getenv("SYSTEMD_LESSCHARSET");
if (!less_charset && is_locale_utf8())
@@ -164,6 +164,25 @@ int pager_open(PagerFlags flags) {
_exit(EXIT_FAILURE);
}
+ /* People might invoke us from sudo, don't needlessly allow less to be a way to shell out
+ * privileged stuff. */
+ r = getenv_bool("SYSTEMD_LESSSECURE");
+ if (r == 0) { /* Remove env var if off */
+ if (unsetenv("LESSSECURE") < 0) {
+ log_error_errno(errno, "Failed to uset environment variable LESSSECURE: %m");
+ _exit(EXIT_FAILURE);
+ }
+ } else {
+ /* Set env var otherwise */
+ if (r < 0)
+ log_warning_errno(r, "Unable to parse $SYSTEMD_LESSSECURE, ignoring: %m");
+
+ if (setenv("LESSSECURE", "1", 1) < 0) {
+ log_error_errno(errno, "Failed to set environment variable LESSSECURE: %m");
+ _exit(EXIT_FAILURE);
+ }
+ }
+
if (pager_args) {
r = loop_write(exe_name_pipe[1], pager_args[0], strlen(pager_args[0]) + 1, false);
if (r < 0) {

View File

@@ -0,0 +1,264 @@
From 1b5b507cd2d1d7a2b053151abb548475ad9c5c3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 12 Oct 2020 18:57:32 +0200
Subject: [PATCH] test-login: always test sd_pid_get_owner_uid(), modernize
A long time some function only worked when in a session, and the test
didn't execute them when sd_pid_get_session() failed. Let's always call
them to increase coverage.
While at it, let's test for ==0 not >=0 where we don't expect the function
to return anything except 0 or error.
CVE: CVE-2023-26604
Upstream-Status: Backport [https://github.com/systemd/systemd/pull/17270/commits/1b5b507cd2d1d7a2b053151abb548475ad9c5c3b.patch]
Comments: Hunk not refreshed
Signed-off-by: rajmohan r <rajmohan.r@kpit.com>
---
src/libsystemd/sd-login/test-login.c | 131 ++++++++++++++-------------
1 file changed, 70 insertions(+), 61 deletions(-)
diff --git a/src/libsystemd/sd-login/test-login.c b/src/libsystemd/sd-login/test-login.c
index c0c77e04714b..0494fc77ba18 100644
--- a/src/libsystemd/sd-login/test-login.c
+++ b/src/libsystemd/sd-login/test-login.c
@@ -5,21 +5,22 @@
#include "sd-login.h"
#include "alloc-util.h"
+#include "errno-list.h"
#include "fd-util.h"
#include "format-util.h"
#include "log.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
-#include "util.h"
+#include "user-util.h"
static char* format_uids(char **buf, uid_t* uids, int count) {
- int pos = 0, k, inc;
+ int pos = 0, inc;
size_t size = (DECIMAL_STR_MAX(uid_t) + 1) * count + 1;
assert_se(*buf = malloc(size));
- for (k = 0; k < count; k++) {
+ for (int k = 0; k < count; k++) {
sprintf(*buf + pos, "%s"UID_FMT"%n", k > 0 ? " " : "", uids[k], &inc);
pos += inc;
}
@@ -30,6 +31,10 @@ static char* format_uids(char **buf, uid_t* uids, int count) {
return *buf;
}
+static const char *e(int r) {
+ return r == 0 ? "OK" : errno_to_name(r);
+}
+
static void test_login(void) {
_cleanup_close_pair_ int pair[2] = { -1, -1 };
_cleanup_free_ char *pp = NULL, *qq = NULL,
@@ -39,65 +44,71 @@ static void test_login(void) {
*seat = NULL, *session = NULL,
*unit = NULL, *user_unit = NULL, *slice = NULL;
int r;
- uid_t u, u2;
- char *t, **seats, **sessions;
+ uid_t u, u2 = UID_INVALID;
+ char *t, **seats = NULL, **sessions = NULL;
r = sd_pid_get_unit(0, &unit);
- assert_se(r >= 0 || r == -ENODATA);
- log_info("sd_pid_get_unit(0, …) → \"%s\"", strna(unit));
+ log_info("sd_pid_get_unit(0, …) → %s / \"%s\"", e(r), strnull(unit));
+ assert_se(IN_SET(r, 0, -ENODATA));
r = sd_pid_get_user_unit(0, &user_unit);
- assert_se(r >= 0 || r == -ENODATA);
- log_info("sd_pid_get_user_unit(0, …) → \"%s\"", strna(user_unit));
+ log_info("sd_pid_get_user_unit(0, …) → %s / \"%s\"", e(r), strnull(user_unit));
+ assert_se(IN_SET(r, 0, -ENODATA));
r = sd_pid_get_slice(0, &slice);
- assert_se(r >= 0 || r == -ENODATA);
- log_info("sd_pid_get_slice(0, …) → \"%s\"", strna(slice));
+ log_info("sd_pid_get_slice(0, …) → %s / \"%s\"", e(r), strnull(slice));
+ assert_se(IN_SET(r, 0, -ENODATA));
+
+ r = sd_pid_get_owner_uid(0, &u2);
+ log_info("sd_pid_get_owner_uid(0, …) → %s / "UID_FMT, e(r), u2);
+ assert_se(IN_SET(r, 0, -ENODATA));
r = sd_pid_get_session(0, &session);
- if (r < 0) {
- log_warning_errno(r, "sd_pid_get_session(0, …): %m");
- if (r == -ENODATA)
- log_info("Seems we are not running in a session, skipping some tests.");
- } else {
- log_info("sd_pid_get_session(0, …) → \"%s\"", session);
-
- assert_se(sd_pid_get_owner_uid(0, &u2) == 0);
- log_info("sd_pid_get_owner_uid(0, …) → "UID_FMT, u2);
-
- assert_se(sd_pid_get_cgroup(0, &cgroup) == 0);
- log_info("sd_pid_get_cgroup(0, …) → \"%s\"", cgroup);
-
- r = sd_uid_get_display(u2, &display_session);
- assert_se(r >= 0 || r == -ENODATA);
- log_info("sd_uid_get_display("UID_FMT", …) → \"%s\"",
- u2, strnull(display_session));
-
- assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == 0);
- sd_peer_get_session(pair[0], &pp);
- sd_peer_get_session(pair[1], &qq);
- assert_se(streq_ptr(pp, qq));
-
- r = sd_uid_get_sessions(u2, false, &sessions);
+ log_info("sd_pid_get_session(0, …) → %s / \"%s\"", e(r), strnull(session));
+
+ r = sd_pid_get_cgroup(0, &cgroup);
+ log_info("sd_pid_get_cgroup(0, …) → %s / \"%s\"", e(r), strnull(cgroup));
+ assert_se(r == 0);
+
+ r = sd_uid_get_display(u2, &display_session);
+ log_info("sd_uid_get_display("UID_FMT", …) → %s / \"%s\"", u2, e(r), strnull(display_session));
+ if (u2 == UID_INVALID)
+ assert_se(r == -EINVAL);
+ else
+ assert_se(IN_SET(r, 0, -ENODATA));
+
+ assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == 0);
+ sd_peer_get_session(pair[0], &pp);
+ sd_peer_get_session(pair[1], &qq);
+ assert_se(streq_ptr(pp, qq));
+
+ r = sd_uid_get_sessions(u2, false, &sessions);
+ assert_se(t = strv_join(sessions, " "));
+ log_info("sd_uid_get_sessions("UID_FMT", …) → %s \"%s\"", u2, e(r), t);
+ if (u2 == UID_INVALID)
+ assert_se(r == -EINVAL);
+ else {
assert_se(r >= 0);
assert_se(r == (int) strv_length(sessions));
- assert_se(t = strv_join(sessions, " "));
- strv_free(sessions);
- log_info("sd_uid_get_sessions("UID_FMT", …) → [%i] \"%s\"", u2, r, t);
- free(t);
+ }
+ sessions = strv_free(sessions);
+ free(t);
- assert_se(r == sd_uid_get_sessions(u2, false, NULL));
+ assert_se(r == sd_uid_get_sessions(u2, false, NULL));
- r = sd_uid_get_seats(u2, false, &seats);
+ r = sd_uid_get_seats(u2, false, &seats);
+ assert_se(t = strv_join(seats, " "));
+ log_info("sd_uid_get_seats("UID_FMT", …) → %s \"%s\"", u2, e(r), t);
+ if (u2 == UID_INVALID)
+ assert_se(r == -EINVAL);
+ else {
assert_se(r >= 0);
assert_se(r == (int) strv_length(seats));
- assert_se(t = strv_join(seats, " "));
- strv_free(seats);
- log_info("sd_uid_get_seats("UID_FMT", …) → [%i] \"%s\"", u2, r, t);
- free(t);
-
- assert_se(r == sd_uid_get_seats(u2, false, NULL));
}
+ seats = strv_free(seats);
+ free(t);
+
+ assert_se(r == sd_uid_get_seats(u2, false, NULL));
if (session) {
r = sd_session_is_active(session);
@@ -109,7 +120,7 @@ static void test_login(void) {
log_info("sd_session_is_remote(\"%s\") → %s", session, yes_no(r));
r = sd_session_get_state(session, &state);
- assert_se(r >= 0);
+ assert_se(r == 0);
log_info("sd_session_get_state(\"%s\") → \"%s\"", session, state);
assert_se(sd_session_get_uid(session, &u) >= 0);
@@ -123,16 +134,16 @@ static void test_login(void) {
log_info("sd_session_get_class(\"%s\") → \"%s\"", session, class);
r = sd_session_get_display(session, &display);
- assert_se(r >= 0 || r == -ENODATA);
+ assert_se(IN_SET(r, 0, -ENODATA));
log_info("sd_session_get_display(\"%s\") → \"%s\"", session, strna(display));
r = sd_session_get_remote_user(session, &remote_user);
- assert_se(r >= 0 || r == -ENODATA);
+ assert_se(IN_SET(r, 0, -ENODATA));
log_info("sd_session_get_remote_user(\"%s\") → \"%s\"",
session, strna(remote_user));
r = sd_session_get_remote_host(session, &remote_host);
- assert_se(r >= 0 || r == -ENODATA);
+ assert_se(IN_SET(r, 0, -ENODATA));
log_info("sd_session_get_remote_host(\"%s\") → \"%s\"",
session, strna(remote_host));
@@ -161,7 +172,7 @@ static void test_login(void) {
assert_se(r == -ENODATA);
}
- assert_se(sd_uid_get_state(u, &state2) >= 0);
+ assert_se(sd_uid_get_state(u, &state2) == 0);
log_info("sd_uid_get_state("UID_FMT", …) → %s", u, state2);
}
@@ -173,11 +184,11 @@ static void test_login(void) {
assert_se(sd_uid_is_on_seat(u, 0, seat) > 0);
r = sd_seat_get_active(seat, &session2, &u2);
- assert_se(r >= 0);
+ assert_se(r == 0);
log_info("sd_seat_get_active(\"%s\", …) → \"%s\", "UID_FMT, seat, session2, u2);
r = sd_uid_is_on_seat(u, 1, seat);
- assert_se(r >= 0);
+ assert_se(IN_SET(r, 0, 1));
assert_se(!!r == streq(session, session2));
r = sd_seat_get_sessions(seat, &sessions, &uids, &n);
@@ -185,8 +196,8 @@ static void test_login(void) {
assert_se(r == (int) strv_length(sessions));
assert_se(t = strv_join(sessions, " "));
strv_free(sessions);
- log_info("sd_seat_get_sessions(\"%s\", …) → %i, \"%s\", [%i] {%s}",
- seat, r, t, n, format_uids(&buf, uids, n));
+ log_info("sd_seat_get_sessions(\"%s\", …) → %s, \"%s\", [%u] {%s}",
+ seat, e(r), t, n, format_uids(&buf, uids, n));
free(t);
assert_se(sd_seat_get_sessions(seat, NULL, NULL, NULL) == r);
@@ -204,7 +215,7 @@ static void test_login(void) {
r = sd_seat_get_active(NULL, &t, NULL);
assert_se(IN_SET(r, 0, -ENODATA));
- log_info("sd_seat_get_active(NULL, …) (active session on current seat) → %s", strnull(t));
+ log_info("sd_seat_get_active(NULL, …) (active session on current seat) → %s / \"%s\"", e(r), strnull(t));
free(t);
r = sd_get_sessions(&sessions);
@@ -244,13 +255,11 @@ static void test_login(void) {
static void test_monitor(void) {
sd_login_monitor *m = NULL;
- unsigned n;
int r;
- r = sd_login_monitor_new("session", &m);
- assert_se(r >= 0);
+ assert_se(sd_login_monitor_new("session", &m) == 0);
- for (n = 0; n < 5; n++) {
+ for (unsigned n = 0; n < 5; n++) {
struct pollfd pollfd = {};
usec_t timeout, nw;

View File

@@ -0,0 +1,182 @@
From 0a42426d797406b4b01a0d9c13bb759c2629d108 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 7 Oct 2020 11:15:05 +0200
Subject: [PATCH] pager: make pager secure when under euid is changed or
explicitly requested
The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
less now), and we automatically enable secure mode in certain cases, but not
otherwise.
This approach is more nuanced, but should provide a better experience for
users:
- Previusly we would set LESSSECURE=1 and trust the pager to make use of
it. But this has an effect only on less. We need to not start pagers which
are insecure when in secure mode. In particular more is like that and is a
very popular pager.
- We don't enable secure mode always, which means that those other pagers can
reasonably used.
- We do the right thing by default, but the user has ultimate control by
setting SYSTEMD_PAGERSECURE.
Fixes #5666.
v2:
- also check $PKEXEC_UID
v3:
- use 'sd_pid_get_owner_uid() != geteuid()' as the condition
CVE: CVE-2023-26604
Upstream-Status: Backport [https://github.com/systemd/systemd/pull/17270/commits/0a42426d797406b4b01a0d9c13bb759c2629d108]
Comments: Hunk refreshed
Signed-off-by: rajmohan r <rajmohan.r@kpit.com>
---
man/less-variables.xml | 30 +++++++++++++++----
src/shared/pager.c | 63 ++++++++++++++++++++++++++-------------
2 files changed, 66 insertions(+), 27 deletions(-)
diff --git a/man/less-variables.xml b/man/less-variables.xml
index c52511c..049e9f7 100644
--- a/man/less-variables.xml
+++ b/man/less-variables.xml
@@ -65,12 +65,30 @@
</varlistentry>
<varlistentry id='lesssecure'>
- <term><varname>$SYSTEMD_LESSSECURE</varname></term>
-
- <listitem><para>Takes a boolean argument. Overrides the <varname>$LESSSECURE</varname> environment
- variable when invoking the pager, which controls the "secure" mode of less (which disables commands
- such as <literal>|</literal> which allow to easily shell out to external command lines). By default
- less secure mode is enabled, with this setting it may be disabled.</para></listitem>
+ <term><varname>$SYSTEMD_PAGERSECURE</varname></term>
+
+ <listitem><para>Takes a boolean argument. When true, the "secure" mode of the pager is enabled; if
+ false, disabled. If <varname>$SYSTEMD_PAGERSECURE</varname> is not set at all, secure mode is enabled
+ if the effective UID is not the same as the owner of the login session, see <citerefentry
+ project='man-pages'><refentrytitle>geteuid</refentrytitle><manvolnum>2</manvolnum></citerefentry> and
+ <citerefentry><refentrytitle>sd_pid_get_owner_uid</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ In secure mode, <option>LESSSECURE=1</option> will be set when invoking the pager, and the pager shall
+ disable commands that open or create new files or start new subprocesses. When
+ <varname>$SYSTEMD_PAGERSECURE</varname> is not set at all, pagers which are not known to implement
+ secure mode will not be used. (Currently only
+ <citerefentry><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry> implements
+ secure mode.)</para>
+
+ <para>Note: when commands are invoked with elevated privileges, for example under <citerefentry
+ project='man-pages'><refentrytitle>sudo</refentrytitle><manvolnum>8</manvolnum></citerefentry> or
+ <citerefentry
+ project='die-net'><refentrytitle>pkexec</refentrytitle><manvolnum>1</manvolnum></citerefentry>, care
+ must be taken to ensure that unintended interactive features are not enabled. "Secure" mode for the
+ pager may be enabled automatically as describe above. Setting <varname>SYSTEMD_PAGERSECURE=0</varname>
+ or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note
+ that if the <varname>$SYSTEMD_PAGER</varname> or <varname>$PAGER</varname> variables are to be
+ honoured, <varname>$SYSTEMD_PAGERSECURE</varname> must be set too. It might be reasonable to completly
+ disable the pager using <option>--no-pager</option> instead.</para></listitem>
</varlistentry>
<varlistentry id='colors'>
diff --git a/src/shared/pager.c b/src/shared/pager.c
index a3b6576..a72d9ea 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -8,6 +8,8 @@
#include <sys/prctl.h>
#include <unistd.h>
+#include "sd-login.h"
+
#include "copy.h"
#include "env-util.h"
#include "fd-util.h"
@@ -164,25 +166,42 @@ int pager_open(PagerFlags flags) {
}
/* People might invoke us from sudo, don't needlessly allow less to be a way to shell out
- * privileged stuff. */
- r = getenv_bool("SYSTEMD_LESSSECURE");
- if (r == 0) { /* Remove env var if off */
- if (unsetenv("LESSSECURE") < 0) {
- log_error_errno(errno, "Failed to uset environment variable LESSSECURE: %m");
- _exit(EXIT_FAILURE);
- }
- } else {
- /* Set env var otherwise */
+ * privileged stuff. If the user set $SYSTEMD_PAGERSECURE, trust their configuration of the
+ * pager. If they didn't, use secure mode when under euid is changed. If $SYSTEMD_PAGERSECURE
+ * wasn't explicitly set, and we autodetect the need for secure mode, only use the pager we
+ * know to be good. */
+ int use_secure_mode = getenv_bool("SYSTEMD_PAGERSECURE");
+ bool trust_pager = use_secure_mode >= 0;
+ if (use_secure_mode == -ENXIO) {
+ uid_t uid;
+
+ r = sd_pid_get_owner_uid(0, &uid);
if (r < 0)
- log_warning_errno(r, "Unable to parse $SYSTEMD_LESSSECURE, ignoring: %m");
+ log_debug_errno(r, "sd_pid_get_owner_uid() failed, enabling pager secure mode: %m");
- if (setenv("LESSSECURE", "1", 1) < 0) {
- log_error_errno(errno, "Failed to set environment variable LESSSECURE: %m");
- _exit(EXIT_FAILURE);
- }
+ use_secure_mode = r < 0 || uid != geteuid();
+
+ } else if (use_secure_mode < 0) {
+ log_warning_errno(use_secure_mode, "Unable to parse $SYSTEMD_PAGERSECURE, assuming true: %m");
+ use_secure_mode = true;
}
- if (pager_args) {
+ /* We generally always set variables used by less, even if we end up using a different pager.
+ * They shouldn't hurt in any case, and ideally other pagers would look at them too. */
+ if (use_secure_mode)
+ r = setenv("LESSSECURE", "1", 1);
+ else
+ r = unsetenv("LESSSECURE");
+ if (r < 0) {
+ log_error_errno(errno, "Failed to adjust environment variable LESSSECURE: %m");
+ _exit(EXIT_FAILURE);
+ }
+
+ if (trust_pager && pager_args) { /* The pager config might be set globally, and we cannot
+ * know if the user adjusted it to be appropriate for the
+ * secure mode. Thus, start the pager specified through
+ * envvars only when $SYSTEMD_PAGERSECURE was explicitly set
+ * as well. */
r = loop_write(exe_name_pipe[1], pager_args[0], strlen(pager_args[0]) + 1, false);
if (r < 0) {
log_error_errno(r, "Failed to write pager name to socket: %m");
@@ -194,13 +213,14 @@ int pager_open(PagerFlags flags) {
"Failed to execute '%s', using fallback pagers: %m", pager_args[0]);
}
- /* Debian's alternatives command for pagers is
- * called 'pager'. Note that we do not call
- * sensible-pagers here, since that is just a
- * shell script that implements a logic that
- * is similar to this one anyway, but is
- * Debian-specific. */
+ /* Debian's alternatives command for pagers is called 'pager'. Note that we do not call
+ * sensible-pagers here, since that is just a shell script that implements a logic that is
+ * similar to this one anyway, but is Debian-specific. */
FOREACH_STRING(exe, "pager", "less", "more") {
+ /* Only less implements secure mode right now. */
+ if (use_secure_mode && !streq(exe, "less"))
+ continue;
+
r = loop_write(exe_name_pipe[1], exe, strlen(exe) + 1, false);
if (r < 0) {
log_error_errno(r, "Failed to write pager name to socket: %m");
@@ -211,6 +231,7 @@ int pager_open(PagerFlags flags) {
"Failed to execute '%s', using next fallback pager: %m", exe);
}
+ /* Our builtin is also very secure. */
r = loop_write(exe_name_pipe[1], "(built-in)", strlen("(built-in)") + 1, false);
if (r < 0) {
log_error_errno(r, "Failed to write pager name to socket: %m");

View File

@@ -0,0 +1,32 @@
From b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 15 Oct 2020 10:54:48 +0200
Subject: [PATCH] pager: lets check SYSTEMD_PAGERSECURE with secure_getenv()
I can't think of any real vulnerability about this, but it still feels
better to check a variable with "secure" in its name with
secure_getenv() rather than plain getenv().
Paranoia FTW!
CVE: CVE-2023-26604
Upstream-Status: Backport [https://github.com/systemd/systemd/pull/17359/commits/b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c]
Comments: Hunk refreshed
Signed-off-by: rajmohan r <rajmohan.r@kpit.com>
---
src/shared/pager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/pager.c b/src/shared/pager.c
index a72d9ea..250519c 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -170,7 +170,7 @@ int pager_open(PagerFlags flags) {
* pager. If they didn't, use secure mode when under euid is changed. If $SYSTEMD_PAGERSECURE
* wasn't explicitly set, and we autodetect the need for secure mode, only use the pager we
* know to be good. */
- int use_secure_mode = getenv_bool("SYSTEMD_PAGERSECURE");
+ int use_secure_mode = getenv_bool_secure("SYSTEMD_PAGERSECURE");
bool trust_pager = use_secure_mode >= 0;
if (use_secure_mode == -ENXIO) {
uid_t uid;

View File

@@ -0,0 +1,7 @@
# Systemd expect a color capable pager, however the less provided
# by busybox is not. This make many interaction with systemd pretty
# annoying. As a workaround we disable the systemd pager if less
# is not the GNU version.
if ! less -V > /dev/null 2>&1 ; then
export SYSTEMD_PAGER=
fi

View File

@@ -18,6 +18,7 @@ SRC_URI += "file://touchscreen.rules \
file://00-create-volatile.conf \
file://init \
file://99-default.preset \
file://systemd-pager.sh \
file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
file://0003-implment-systemd-sysv-install-for-OE.patch \
file://CVE-2021-33910.patch \
@@ -34,6 +35,10 @@ SRC_URI += "file://touchscreen.rules \
file://CVE-2021-3997-2.patch \
file://CVE-2021-3997-3.patch \
file://CVE-2022-3821.patch \
file://CVE-2023-26604-1.patch \
file://CVE-2023-26604-2.patch \
file://CVE-2023-26604-3.patch \
file://CVE-2023-26604-4.patch \
"
# patches needed by musl
@@ -214,7 +219,7 @@ rootlibexecdir = "${rootprefix}/lib"
EXTRA_OEMESON += "-Dlink-udev-shared=false"
EXTRA_OEMESON += "-Dnobody-user=nobody \
-Dnobody-group=nobody \
-Dnobody-group=nogroup \
-Drootlibdir=${rootlibdir} \
-Drootprefix=${rootprefix} \
-Ddefault-locale=C \
@@ -317,6 +322,9 @@ do_install() {
# install default policy for presets
# https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
# add a profile fragment to disable systemd pager with busybox less
install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh
}
python populate_packages_prepend (){
@@ -539,6 +547,7 @@ FILES_${PN} = " ${base_bindir}/* \
${sysconfdir}/dbus-1/ \
${sysconfdir}/modules-load.d/ \
${sysconfdir}/pam.d/ \
${sysconfdir}/profile.d/ \
${sysconfdir}/sysctl.d/ \
${sysconfdir}/systemd/ \
${sysconfdir}/tmpfiles.d/ \

View File

@@ -8,3 +8,4 @@ rm -f *.tmp
rm -f *.ok
rm -f *.failed
rm -f *.log
cp ../data/test_data.tmp ./

View File

@@ -144,4 +144,7 @@ do_install_ptest() {
install -d ${D}${PTEST_PATH}/lib
install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/
install -d ${D}${PTEST_PATH}/data
install -m 0644 ${B}/tests/test_data.tmp ${D}${PTEST_PATH}/data/
}

View File

@@ -0,0 +1,179 @@
From 58325b93c5b6212697b088371809e9948fee8052 Mon Sep 17 00:00:00 2001
From: Taylor Blau <me@ttaylorr.com>
Date: Tue, 24 Jan 2023 19:43:45 -0500
Subject: [PATCH 1/3] t5619: demonstrate clone_local() with ambiguous transport
When cloning a repository, Git must determine (a) what transport
mechanism to use, and (b) whether or not the clone is local.
Since f38aa83 (use local cloning if insteadOf makes a local URL,
2014-07-17), the latter check happens after the remote has been
initialized, and references the remote's URL instead of the local path.
This is done to make it possible for a `url.<base>.insteadOf` rule to
convert a remote URL into a local one, in which case the `clone_local()`
mechanism should be used.
However, with a specially crafted repository, Git can be tricked into
using a non-local transport while still setting `is_local` to "1" and
using the `clone_local()` optimization. The below test case
demonstrates such an instance, and shows that it can be used to include
arbitrary (known) paths in the working copy of a cloned repository on a
victim's machine[^1], even if local file clones are forbidden by
`protocol.file.allow`.
This happens in a few parts:
1. We first call `get_repo_path()` to see if the remote is a local
path. If it is, we replace the repo name with its absolute path.
2. We then call `transport_get()` on the repo name and decide how to
access it. If it was turned into an absolute path in the previous
step, then we should always treat it like a file.
3. We use `get_repo_path()` again, and set `is_local` as appropriate.
But it's already too late to rewrite the repo name as an absolute
path, since we've already fed it to the transport code.
The attack works by including a submodule whose URL corresponds to a
path on disk. In the below example, the repository "sub" is reachable
via the dumb HTTP protocol at (something like):
http://127.0.0.1:NNNN/dumb/sub.git
However, the path "http:/127.0.0.1:NNNN/dumb" (that is, a top-level
directory called "http:", then nested directories "127.0.0.1:NNNN", and
"dumb") exists within the repository, too.
To determine this, it first picks the appropriate transport, which is
dumb HTTP. It then uses the remote's URL in order to determine whether
the repository exists locally on disk. However, the malicious repository
also contains an embedded stub repository which is the target of a
symbolic link at the local path corresponding to the "sub" repository on
disk (i.e., there is a symbolic link at "http:/127.0.0.1/dumb/sub.git",
pointing to the stub repository via ".git/modules/sub/../../../repo").
This stub repository fools Git into thinking that a local repository
exists at that URL and thus can be cloned locally. The affected call is
in `get_repo_path()`, which in turn calls `get_repo_path_1()`, which
locates a valid repository at that target.
This then causes Git to set the `is_local` variable to "1", and in turn
instructs Git to clone the repository using its local clone optimization
via the `clone_local()` function.
The exploit comes into play because the stub repository's top-level
"$GIT_DIR/objects" directory is a symbolic link which can point to an
arbitrary path on the victim's machine. `clone_local()` resolves the
top-level "objects" directory through a `stat(2)` call, meaning that we
read through the symbolic link and copy or hardlink the directory
contents at the destination of the link.
In other words, we can get steps (1) and (3) to disagree by leveraging
the dangling symlink to pick a non-local transport in the first step,
and then set is_local to "1" in the third step when cloning with
`--separate-git-dir`, which makes the symlink non-dangling.
This can result in data-exfiltration on the victim's machine when
sensitive data is at a known path (e.g., "/home/$USER/.ssh").
The appropriate fix is two-fold:
- Resolve the transport later on (to avoid using the local
clone optimization with a non-local transport).
- Avoid reading through the top-level "objects" directory when
(correctly) using the clone_local() optimization.
This patch merely demonstrates the issue. The following two patches will
implement each part of the above fix, respectively.
[^1]: Provided that any target directory does not contain symbolic
links, in which case the changes from 6f054f9 (builtin/clone.c:
disallow `--local` clones with symlinks, 2022-07-28) will abort the
clone.
Reported-by: yvvdwf <yvvdwf@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Upstream-Status: Backport
[https://github.com/git/git/commit/58325b93c5b6212697b088371809e9948fee8052]
CVE: CVE-2023-22490
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
t/t5619-clone-local-ambiguous-transport.sh | 63 ++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 t/t5619-clone-local-ambiguous-transport.sh
diff --git a/t/t5619-clone-local-ambiguous-transport.sh b/t/t5619-clone-local-ambiguous-transport.sh
new file mode 100644
index 0000000..7ebd31a
--- /dev/null
+++ b/t/t5619-clone-local-ambiguous-transport.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+test_description='test local clone with ambiguous transport'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY/lib-httpd.sh"
+
+if ! test_have_prereq SYMLINKS
+then
+ skip_all='skipping test, symlink support unavailable'
+ test_done
+fi
+
+start_httpd
+
+REPO="$HTTPD_DOCUMENT_ROOT_PATH/sub.git"
+URI="$HTTPD_URL/dumb/sub.git"
+
+test_expect_success 'setup' '
+ mkdir -p sensitive &&
+ echo "secret" >sensitive/secret &&
+
+ git init --bare "$REPO" &&
+ test_commit_bulk -C "$REPO" --ref=main 1 &&
+
+ git -C "$REPO" update-ref HEAD main &&
+ git -C "$REPO" update-server-info &&
+
+ git init malicious &&
+ (
+ cd malicious &&
+
+ git submodule add "$URI" &&
+
+ mkdir -p repo/refs &&
+ touch repo/refs/.gitkeep &&
+ printf "ref: refs/heads/a" >repo/HEAD &&
+ ln -s "$(cd .. && pwd)/sensitive" repo/objects &&
+
+ mkdir -p "$HTTPD_URL/dumb" &&
+ ln -s "../../../.git/modules/sub/../../../repo/" "$URI" &&
+
+ git add . &&
+ git commit -m "initial commit"
+ ) &&
+
+ # Delete all of the references in our malicious submodule to
+ # avoid the client attempting to checkout any objects (which
+ # will be missing, and thus will cause the clone to fail before
+ # we can trigger the exploit).
+ git -C "$REPO" for-each-ref --format="delete %(refname)" >in &&
+ git -C "$REPO" update-ref --stdin <in &&
+ git -C "$REPO" update-server-info
+'
+
+test_expect_failure 'ambiguous transport does not lead to arbitrary file-inclusion' '
+ git clone malicious clone &&
+ git -C clone submodule update --init &&
+
+ test_path_is_missing clone/.git/modules/sub/objects/secret
+'
+
+test_done
--
2.25.1

View File

@@ -0,0 +1,122 @@
From cf8f6ce02a13f4d1979a53241afbee15a293fce9 Mon Sep 17 00:00:00 2001
From: Taylor Blau <me@ttaylorr.com>
Date: Tue, 24 Jan 2023 19:43:48 -0500
Subject: [PATCH 2/3] clone: delay picking a transport until after get_repo_path()
In the previous commit, t5619 demonstrates an issue where two calls to
`get_repo_path()` could trick Git into using its local clone mechanism
in conjunction with a non-local transport.
That sequence is:
- the starting state is that the local path https:/example.com/foo is a
symlink that points to ../../../.git/modules/foo. So it's dangling.
- get_repo_path() sees that no such path exists (because it's
dangling), and thus we do not canonicalize it into an absolute path
- because we're using --separate-git-dir, we create .git/modules/foo.
Now our symlink is no longer dangling!
- we pass the url to transport_get(), which sees it as an https URL.
- we call get_repo_path() again, on the url. This second call was
introduced by f38aa83 (use local cloning if insteadOf makes a
local URL, 2014-07-17). The idea is that we want to pull the url
fresh from the remote.c API, because it will apply any aliases.
And of course now it sees that there is a local file, which is a
mismatch with the transport we already selected.
The issue in the above sequence is calling `transport_get()` before
deciding whether or not the repository is indeed local, and not passing
in an absolute path if it is local.
This is reminiscent of a similar bug report in [1], where it was
suggested to perform the `insteadOf` lookup earlier. Taking that
approach may not be as straightforward, since the intent is to store the
original URL in the config, but to actually fetch from the insteadOf
one, so conflating the two early on is a non-starter.
Note: we pass the path returned by `get_repo_path(remote->url[0])`,
which should be the same as `repo_name` (aside from any `insteadOf`
rewrites).
We *could* pass `absolute_pathdup()` of the same argument, which
86521ac (Bring local clone's origin URL in line with that of a remote
clone, 2008-09-01) indicates may differ depending on the presence of
".git/" for a non-bare repo. That matters for forming relative submodule
paths, but doesn't matter for the second call, since we're just feeding
it to the transport code, which is fine either way.
[1]: https://lore.kernel.org/git/CAMoD=Bi41mB3QRn3JdZL-FGHs4w3C2jGpnJB-CqSndO7FMtfzA@mail.gmail.com/
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Upstream-Status: Backport
[https://github.com/git/git/commit/cf8f6ce02a13f4d1979a53241afbee15a293fce9]
CVE: CVE-2023-22490
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
builtin/clone.c | 8 ++++----
t/t5619-clone-local-ambiguous-transport.sh | 15 +++++++++++----
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 53e04b1..b57e703 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1112,10 +1112,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
branch_top.buf);
refspec_append(&remote->fetch, default_refspec.buf);
- transport = transport_get(remote, remote->url[0]);
- transport_set_verbosity(transport, option_verbosity, option_progress);
- transport->family = family;
-
path = get_repo_path(remote->url[0], &is_bundle);
is_local = option_local != 0 && path && !is_bundle;
if (is_local) {
@@ -1135,6 +1131,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
}
if (option_local > 0 && !is_local)
warning(_("--local is ignored"));
+
+ transport = transport_get(remote, path ? path : remote->url[0]);
+ transport_set_verbosity(transport, option_verbosity, option_progress);
+ transport->family = family;
transport->cloning = 1;
transport_set_option(transport, TRANS_OPT_KEEP, "yes");
diff --git a/t/t5619-clone-local-ambiguous-transport.sh b/t/t5619-clone-local-ambiguous-transport.sh
index 7ebd31a..cce62bf 100644
--- a/t/t5619-clone-local-ambiguous-transport.sh
+++ b/t/t5619-clone-local-ambiguous-transport.sh
@@ -53,11 +53,18 @@ test_expect_success 'setup' '
git -C "$REPO" update-server-info
'
-test_expect_failure 'ambiguous transport does not lead to arbitrary file-inclusion' '
+test_expect_success 'ambiguous transport does not lead to arbitrary file-inclusion' '
git clone malicious clone &&
- git -C clone submodule update --init &&
-
- test_path_is_missing clone/.git/modules/sub/objects/secret
+ test_must_fail git -C clone submodule update --init 2>err &&
+
+ test_path_is_missing clone/.git/modules/sub/objects/secret &&
+ # We would actually expect "transport .file. not allowed" here,
+ # but due to quirks of the URL detection in Git, we mis-parse
+ # the absolute path as a bogus URL and die before that step.
+ #
+ # This works for now, and if we ever fix the URL detection, it
+ # is OK to change this to detect the transport error.
+ grep "protocol .* is not supported" err
'
test_done
--
2.25.1

View File

@@ -0,0 +1,154 @@
From bffc762f87ae8d18c6001bf0044a76004245754c Mon Sep 17 00:00:00 2001
From: Taylor Blau <me@ttaylorr.com>
Date: Tue, 24 Jan 2023 19:43:51 -0500
Subject: [PATCH 3/3] dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
When using the dir_iterator API, we first stat(2) the base path, and
then use that as a starting point to enumerate the directory's contents.
If the directory contains symbolic links, we will immediately die() upon
encountering them without the `FOLLOW_SYMLINKS` flag. The same is not
true when resolving the top-level directory, though.
As explained in a previous commit, this oversight in 6f054f9
(builtin/clone.c: disallow `--local` clones with symlinks, 2022-07-28)
can be used as an attack vector to include arbitrary files on a victim's
filesystem from outside of the repository.
Prevent resolving top-level symlinks unless the FOLLOW_SYMLINKS flag is
given, which will cause clones of a repository with a symlink'd
"$GIT_DIR/objects" directory to fail.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Upstream-Status: Backport
[https://github.com/git/git/commit/bffc762f87ae8d18c6001bf0044a76004245754c]
CVE: CVE-2023-22490
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
dir-iterator.c | 13 +++++++++----
dir-iterator.h | 5 +++++
t/t0066-dir-iterator.sh | 27 ++++++++++++++++++++++++++-
t/t5604-clone-reference.sh | 16 ++++++++++++++++
4 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/dir-iterator.c b/dir-iterator.c
index b17e9f9..3764dd8 100644
--- a/dir-iterator.c
+++ b/dir-iterator.c
@@ -203,7 +203,7 @@ struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags)
{
struct dir_iterator_int *iter = xcalloc(1, sizeof(*iter));
struct dir_iterator *dir_iterator = &iter->base;
- int saved_errno;
+ int saved_errno, err;
strbuf_init(&iter->base.path, PATH_MAX);
strbuf_addstr(&iter->base.path, path);
@@ -213,10 +213,15 @@ struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags)
iter->flags = flags;
/*
- * Note: stat already checks for NULL or empty strings and
- * inexistent paths.
+ * Note: stat/lstat already checks for NULL or empty strings and
+ * nonexistent paths.
*/
- if (stat(iter->base.path.buf, &iter->base.st) < 0) {
+ if (iter->flags & DIR_ITERATOR_FOLLOW_SYMLINKS)
+ err = stat(iter->base.path.buf, &iter->base.st);
+ else
+ err = lstat(iter->base.path.buf, &iter->base.st);
+
+ if (err < 0) {
saved_errno = errno;
goto error_out;
}
diff --git a/dir-iterator.h b/dir-iterator.h
index 0822915..e3b6ff2 100644
--- a/dir-iterator.h
+++ b/dir-iterator.h
@@ -61,6 +61,11 @@
* not the symlinks themselves, which is the default behavior. Broken
* symlinks are ignored.
*
+ * Note: setting DIR_ITERATOR_FOLLOW_SYMLINKS affects resolving the
+ * starting path as well (e.g., attempting to iterate starting at a
+ * symbolic link pointing to a directory without FOLLOW_SYMLINKS will
+ * result in an error).
+ *
* Warning: circular symlinks are also followed when
* DIR_ITERATOR_FOLLOW_SYMLINKS is set. The iteration may end up with
* an ELOOP if they happen and DIR_ITERATOR_PEDANTIC is set.
diff --git a/t/t0066-dir-iterator.sh b/t/t0066-dir-iterator.sh
index 92910e4..c826f60 100755
--- a/t/t0066-dir-iterator.sh
+++ b/t/t0066-dir-iterator.sh
@@ -109,7 +109,9 @@ test_expect_success SYMLINKS 'setup dirs with symlinks' '
mkdir -p dir5/a/c &&
ln -s ../c dir5/a/b/d &&
ln -s ../ dir5/a/b/e &&
- ln -s ../../ dir5/a/b/f
+ ln -s ../../ dir5/a/b/f &&
+
+ ln -s dir4 dir6
'
test_expect_success SYMLINKS 'dir-iterator should not follow symlinks by default' '
@@ -145,4 +147,27 @@ test_expect_success SYMLINKS 'dir-iterator should follow symlinks w/ follow flag
test_cmp expected-follow-sorted-output actual-follow-sorted-output
'
+test_expect_success SYMLINKS 'dir-iterator does not resolve top-level symlinks' '
+ test_must_fail test-tool dir-iterator ./dir6 >out &&
+
+ grep "ENOTDIR" out
+'
+
+test_expect_success SYMLINKS 'dir-iterator resolves top-level symlinks w/ follow flag' '
+ cat >expected-follow-sorted-output <<-EOF &&
+ [d] (a) [a] ./dir6/a
+ [d] (a/f) [f] ./dir6/a/f
+ [d] (a/f/c) [c] ./dir6/a/f/c
+ [d] (b) [b] ./dir6/b
+ [d] (b/c) [c] ./dir6/b/c
+ [f] (a/d) [d] ./dir6/a/d
+ [f] (a/e) [e] ./dir6/a/e
+ EOF
+
+ test-tool dir-iterator --follow-symlinks ./dir6 >out &&
+ sort out >actual-follow-sorted-output &&
+
+ test_cmp expected-follow-sorted-output actual-follow-sorted-output
+'
+
test_done
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index 4894237..615b981 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -354,4 +354,20 @@ test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at obje
test_must_be_empty T--shared.objects-symlinks.raw
'
+test_expect_success SYMLINKS 'clone repo with symlinked objects directory' '
+ test_when_finished "rm -fr sensitive malicious" &&
+
+ mkdir -p sensitive &&
+ echo "secret" >sensitive/file &&
+
+ git init malicious &&
+ rm -fr malicious/.git/objects &&
+ ln -s "$(pwd)/sensitive" ./malicious/.git/objects &&
+
+ test_must_fail git clone --local malicious clone 2>err &&
+
+ test_path_is_missing clone &&
+ grep "failed to start iterator over" err
+'
+
test_done
--
2.25.1

View File

@@ -0,0 +1,184 @@
From fade728df1221598f42d391cf377e9e84a32053f Mon Sep 17 00:00:00 2001
From: Patrick Steinhardt <ps@pks.im>
Date: Thu, 2 Feb 2023 11:54:34 +0100
Subject: [PATCH] apply: fix writing behind newly created symbolic links
When writing files git-apply(1) initially makes sure that none of the
files it is about to create are behind a symlink:
```
$ git init repo
Initialized empty Git repository in /tmp/repo/.git/
$ cd repo/
$ ln -s dir symlink
$ git apply - <<EOF
diff --git a/symlink/file b/symlink/file
new file mode 100644
index 0000000..e69de29
EOF
error: affected file 'symlink/file' is beyond a symbolic link
```
This safety mechanism is crucial to ensure that we don't write outside
of the repository's working directory. It can be fooled though when the
patch that is being applied creates the symbolic link in the first
place, which can lead to writing files in arbitrary locations.
Fix this by checking whether the path we're about to create is
beyond a symlink or not. Tightening these checks like this should be
fine as we already have these precautions in Git as explained
above. Ideally, we should update the check we do up-front before
starting to reflect the computed changes to the working tree so that
we catch this case as well, but as part of embargoed security work,
adding an equivalent check just before we try to write out a file
should serve us well as a reasonable first step.
Digging back into history shows that this vulnerability has existed
since at least Git v2.9.0. As Git v2.8.0 and older don't build on my
system anymore I cannot tell whether older versions are affected, as
well.
Reported-by: Joern Schneeweisz <jschneeweisz@gitlab.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Upstream-Status: Backport
[https://github.com/git/git/commit/fade728df1221598f42d391cf377e9e84a32053f]
CVE: CVE-2023-23946
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
apply.c | 27 ++++++++++++++
t/t4115-apply-symlink.sh | 81 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 108 insertions(+)
diff --git a/apply.c b/apply.c
index f8a046a..4f303bf 100644
--- a/apply.c
+++ b/apply.c
@@ -4373,6 +4373,33 @@ static int create_one_file(struct apply_state *state,
if (state->cached)
return 0;
+ /*
+ * We already try to detect whether files are beyond a symlink in our
+ * up-front checks. But in the case where symlinks are created by any
+ * of the intermediate hunks it can happen that our up-front checks
+ * didn't yet see the symlink, but at the point of arriving here there
+ * in fact is one. We thus repeat the check for symlinks here.
+ *
+ * Note that this does not make the up-front check obsolete as the
+ * failure mode is different:
+ *
+ * - The up-front checks cause us to abort before we have written
+ * anything into the working directory. So when we exit this way the
+ * working directory remains clean.
+ *
+ * - The checks here happen in the middle of the action where we have
+ * already started to apply the patch. The end result will be a dirty
+ * working directory.
+ *
+ * Ideally, we should update the up-front checks to catch what would
+ * happen when we apply the patch before we damage the working tree.
+ * We have all the information necessary to do so. But for now, as a
+ * part of embargoed security work, having this check would serve as a
+ * reasonable first step.
+ */
+ if (path_is_beyond_symlink(state, path))
+ return error(_("affected file '%s' is beyond a symbolic link"), path);
+
res = try_create_file(state, path, mode, buf, size);
if (res < 0)
return -1;
diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh
index 872fcda..1acb7b2 100755
--- a/t/t4115-apply-symlink.sh
+++ b/t/t4115-apply-symlink.sh
@@ -44,4 +44,85 @@ test_expect_success 'apply --index symlink patch' '
'
+test_expect_success 'symlink setup' '
+ ln -s .git symlink &&
+ git add symlink &&
+ git commit -m "add symlink"
+'
+
+test_expect_success SYMLINKS 'symlink escape when creating new files' '
+ test_when_finished "git reset --hard && git clean -dfx" &&
+
+ cat >patch <<-EOF &&
+ diff --git a/symlink b/renamed-symlink
+ similarity index 100%
+ rename from symlink
+ rename to renamed-symlink
+ --
+ diff --git /dev/null b/renamed-symlink/create-me
+ new file mode 100644
+ index 0000000..039727e
+ --- /dev/null
+ +++ b/renamed-symlink/create-me
+ @@ -0,0 +1,1 @@
+ +busted
+ EOF
+
+ test_must_fail git apply patch 2>stderr &&
+ cat >expected_stderr <<-EOF &&
+ error: affected file ${SQ}renamed-symlink/create-me${SQ} is beyond a symbolic link
+ EOF
+ test_cmp expected_stderr stderr &&
+ ! test_path_exists .git/create-me
+'
+
+test_expect_success SYMLINKS 'symlink escape when modifying file' '
+ test_when_finished "git reset --hard && git clean -dfx" &&
+ touch .git/modify-me &&
+
+ cat >patch <<-EOF &&
+ diff --git a/symlink b/renamed-symlink
+ similarity index 100%
+ rename from symlink
+ rename to renamed-symlink
+ --
+ diff --git a/renamed-symlink/modify-me b/renamed-symlink/modify-me
+ index 1111111..2222222 100644
+ --- a/renamed-symlink/modify-me
+ +++ b/renamed-symlink/modify-me
+ @@ -0,0 +1,1 @@
+ +busted
+ EOF
+
+ test_must_fail git apply patch 2>stderr &&
+ cat >expected_stderr <<-EOF &&
+ error: renamed-symlink/modify-me: No such file or directory
+ EOF
+ test_cmp expected_stderr stderr &&
+ test_must_be_empty .git/modify-me
+'
+
+test_expect_success SYMLINKS 'symlink escape when deleting file' '
+ test_when_finished "git reset --hard && git clean -dfx && rm .git/delete-me" &&
+ touch .git/delete-me &&
+
+ cat >patch <<-EOF &&
+ diff --git a/symlink b/renamed-symlink
+ similarity index 100%
+ rename from symlink
+ rename to renamed-symlink
+ --
+ diff --git a/renamed-symlink/delete-me b/renamed-symlink/delete-me
+ deleted file mode 100644
+ index 1111111..0000000 100644
+ EOF
+
+ test_must_fail git apply patch 2>stderr &&
+ cat >expected_stderr <<-EOF &&
+ error: renamed-symlink/delete-me: No such file or directory
+ EOF
+ test_cmp expected_stderr stderr &&
+ test_path_is_file .git/delete-me
+'
+
test_done
--
2.25.1

View File

@@ -0,0 +1,94 @@
From 9db05711c98efc14f414d4c87135a34c13586e0b Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Thu, 9 Mar 2023 16:02:54 +0100
Subject: [PATCH] apply --reject: overwrite existing `.rej` symlink if it
exists
The `git apply --reject` is expected to write out `.rej` files in case
one or more hunks fail to apply cleanly. Historically, the command
overwrites any existing `.rej` files. The idea being that
apply/reject/edit cycles are relatively common, and the generated `.rej`
files are not considered precious.
But the command does not overwrite existing `.rej` symbolic links, and
instead follows them. This is unsafe because the same patch could
potentially create such a symbolic link and point at arbitrary paths
outside the current worktree, and `git apply` would write the contents
of the `.rej` file into that location.
Therefore, let's make sure that any existing `.rej` file or symbolic
link is removed before writing it.
Reported-by: RyotaK <ryotak.mail@gmail.com>
Helped-by: Taylor Blau <me@ttaylorr.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Upstream-Status: Backport [https://github.com/git/git/commit/9db05711c98efc14f414d4c87135a34c13586e0b]
CVE: CVE-2023-25652
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
apply.c | 14 ++++++++++++--
t/t4115-apply-symlink.sh | 15 +++++++++++++++
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/apply.c b/apply.c
index 4f303bf..aa7111d 100644
--- a/apply.c
+++ b/apply.c
@@ -4531,7 +4531,7 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
FILE *rej;
char namebuf[PATH_MAX];
struct fragment *frag;
- int cnt = 0;
+ int fd, cnt = 0;
struct strbuf sb = STRBUF_INIT;
for (cnt = 0, frag = patch->fragments; frag; frag = frag->next) {
@@ -4571,7 +4571,17 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
memcpy(namebuf, patch->new_name, cnt);
memcpy(namebuf + cnt, ".rej", 5);
- rej = fopen(namebuf, "w");
+ fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ if (fd < 0) {
+ if (errno != EEXIST)
+ return error_errno(_("cannot open %s"), namebuf);
+ if (unlink(namebuf))
+ return error_errno(_("cannot unlink '%s'"), namebuf);
+ fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ if (fd < 0)
+ return error_errno(_("cannot open %s"), namebuf);
+ }
+ rej = fdopen(fd, "w");
if (!rej)
return error_errno(_("cannot open %s"), namebuf);
diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh
index 1acb7b2..2b034ff 100755
--- a/t/t4115-apply-symlink.sh
+++ b/t/t4115-apply-symlink.sh
@@ -125,4 +125,19 @@ test_expect_success SYMLINKS 'symlink escape when deleting file' '
test_path_is_file .git/delete-me
'
+test_expect_success SYMLINKS '--reject removes .rej symlink if it exists' '
+ test_when_finished "git reset --hard && git clean -dfx" &&
+
+ test_commit file &&
+ echo modified >file.t &&
+ git diff -- file.t >patch &&
+ echo modified-again >file.t &&
+
+ ln -s foo file.t.rej &&
+ test_must_fail git apply patch --reject 2>err &&
+ test_i18ngrep "Rejected hunk" err &&
+ test_path_is_missing foo &&
+ test_path_is_file file.t.rej
+'
+
test_done
--
2.25.1

View File

@@ -0,0 +1,159 @@
From 057c07a7b1fae22fdeef26c243f4cfbe3afc90ce Mon Sep 17 00:00:00 2001
From: Taylor Blau <me@ttaylorr.com>
Date: Fri, 14 Apr 2023 11:46:59 -0400
Subject: [PATCH] Merge branch 'tb/config-copy-or-rename-in-file-injection'
Avoids issues with renaming or deleting sections with long lines, where
configuration values may be interpreted as sections, leading to
configuration injection. Addresses CVE-2023-29007.
* tb/config-copy-or-rename-in-file-injection:
config.c: disallow overly-long lines in `copy_or_rename_section_in_file()`
config.c: avoid integer truncation in `copy_or_rename_section_in_file()`
config: avoid fixed-sized buffer when renaming/deleting a section
t1300: demonstrate failure when renaming sections with long lines
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Upstream-Status: Backport [https://github.com/git/git/commit/528290f8c61222433a8cf02fb7cfffa8438432b4]
CVE: CVE-2023-29007
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
config.c | 36 +++++++++++++++++++++++++-----------
t/t1300-config.sh | 30 ++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 11 deletions(-)
diff --git a/config.c b/config.c
index e7052b3..676b687 100644
--- a/config.c
+++ b/config.c
@@ -2987,9 +2987,10 @@ void git_config_set_multivar(const char *key, const char *value,
multi_replace);
}
-static int section_name_match (const char *buf, const char *name)
+static size_t section_name_match (const char *buf, const char *name)
{
- int i = 0, j = 0, dot = 0;
+ size_t i = 0, j = 0;
+ int dot = 0;
if (buf[i] != '[')
return 0;
for (i = 1; buf[i] && buf[i] != ']'; i++) {
@@ -3042,6 +3043,8 @@ static int section_name_is_ok(const char *name)
return 1;
}
+#define GIT_CONFIG_MAX_LINE_LEN (512 * 1024)
+
/* if new_name == NULL, the section is removed instead */
static int git_config_copy_or_rename_section_in_file(const char *config_filename,
const char *old_name,
@@ -3051,11 +3054,12 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
char *filename_buf = NULL;
struct lock_file lock = LOCK_INIT;
int out_fd;
- char buf[1024];
+ struct strbuf buf = STRBUF_INIT;
FILE *config_file = NULL;
struct stat st;
struct strbuf copystr = STRBUF_INIT;
struct config_store_data store;
+ uint32_t line_nr = 0;
memset(&store, 0, sizeof(store));
@@ -3092,16 +3096,25 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
goto out;
}
- while (fgets(buf, sizeof(buf), config_file)) {
- int i;
- int length;
+ while (!strbuf_getwholeline(&buf, config_file, '\n')) {
+ size_t i, length;
int is_section = 0;
- char *output = buf;
- for (i = 0; buf[i] && isspace(buf[i]); i++)
+ char *output = buf.buf;
+
+ line_nr++;
+
+ if (buf.len >= GIT_CONFIG_MAX_LINE_LEN) {
+ ret = error(_("refusing to work with overly long line "
+ "in '%s' on line %"PRIuMAX),
+ config_filename, (uintmax_t)line_nr);
+ goto out;
+ }
+
+ for (i = 0; buf.buf[i] && isspace(buf.buf[i]); i++)
; /* do nothing */
- if (buf[i] == '[') {
+ if (buf.buf[i] == '[') {
/* it's a section */
- int offset;
+ size_t offset;
is_section = 1;
/*
@@ -3118,7 +3131,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
strbuf_reset(&copystr);
}
- offset = section_name_match(&buf[i], old_name);
+ offset = section_name_match(&buf.buf[i], old_name);
if (offset > 0) {
ret++;
if (new_name == NULL) {
@@ -3193,6 +3206,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
out_no_rollback:
free(filename_buf);
config_store_data_clear(&store);
+ strbuf_release(&buf);
return ret;
}
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 983a0a1..9b67f6b 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -616,6 +616,36 @@ test_expect_success 'renaming to bogus section is rejected' '
test_must_fail git config --rename-section branch.zwei "bogus name"
'
+test_expect_success 'renaming a section with a long line' '
+ {
+ printf "[b]\\n" &&
+ printf " c = d %1024s [a] e = f\\n" " " &&
+ printf "[a] g = h\\n"
+ } >y &&
+ git config -f y --rename-section a xyz &&
+ test_must_fail git config -f y b.e
+'
+
+test_expect_success 'renaming an embedded section with a long line' '
+ {
+ printf "[b]\\n" &&
+ printf " c = d %1024s [a] [foo] e = f\\n" " " &&
+ printf "[a] g = h\\n"
+ } >y &&
+ git config -f y --rename-section a xyz &&
+ test_must_fail git config -f y foo.e
+'
+
+test_expect_success 'renaming a section with an overly-long line' '
+ {
+ printf "[b]\\n" &&
+ printf " c = d %525000s e" " " &&
+ printf "[a] g = h\\n"
+ } >y &&
+ test_must_fail git config -f y --rename-section a xyz 2>err &&
+ test_i18ngrep "refusing to work with overly long line in .y. on line 2" err
+'
+
cat >> .git/config << EOF
[branch "zwei"] a = 1 [branch "vier"]
EOF
--
2.25.1

View File

@@ -24,6 +24,12 @@ SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
file://CVE-2022-41903-10.patch \
file://CVE-2022-41903-11.patch \
file://CVE-2022-41903-12.patch \
file://CVE-2023-22490-1.patch \
file://CVE-2023-22490-2.patch \
file://CVE-2023-22490-3.patch \
file://CVE-2023-23946.patch \
file://CVE-2023-29007.patch \
file://CVE-2023-25652.patch \
"
S = "${WORKDIR}/git-${PV}"
@@ -37,6 +43,8 @@ CVE_PRODUCT = "git-scm:git"
CVE_CHECK_WHITELIST += "CVE-2022-24975"
# This is specific to Git-for-Windows
CVE_CHECK_WHITELIST += "CVE-2022-41953"
# specific to Git for Windows
CVE_CHECK_WHITELIST += "CVE-2023-22743"
PACKAGECONFIG ??= ""
PACKAGECONFIG[cvsserver] = ""

View File

@@ -52,6 +52,17 @@ SRC_URI += "\
file://CVE-2022-41715.patch \
file://CVE-2022-41717.patch \
file://CVE-2022-1962.patch \
file://CVE-2022-41723.patch \
file://CVE-2022-41722-1.patch \
file://CVE-2022-41722-2.patch \
file://CVE-2020-29510.patch \
file://CVE-2023-24537.patch \
file://CVE-2023-24534.patch \
file://CVE-2023-24538-1.patch \
file://CVE-2023-24538-2.patch \
file://CVE-2023-24538-3.patch \
file://CVE-2023-24539.patch \
file://CVE-2023-24540.patch \
"
SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
@@ -79,3 +90,9 @@ CVE_CHECK_WHITELIST += "CVE-2021-41772"
# Fixes code that was added in go1.16, does not exist in 1.14
CVE_CHECK_WHITELIST += "CVE-2022-30630"
# This is specific to Microsoft Windows
CVE_CHECK_WHITELIST += "CVE-2022-41716"
# Issue introduced in go1.15beta1, does not exist in 1.14
CVE_CHECK_WHITELIST += "CVE-2022-1705"

View File

@@ -0,0 +1,65 @@
From a0bf4d38dc2057d28396594264bbdd43d412de22 Mon Sep 17 00:00:00 2001
From: Filippo Valsorda <filippo@golang.org>
Date: Tue, 27 Oct 2020 00:21:30 +0100
Subject: [PATCH] encoding/xml: replace comments inside directives with a space
A Directive (like <!ENTITY xxx []>) can't have other nodes nested inside
it (in our data structure representation), so there is no way to
preserve comments. The previous behavior was to just elide them, which
however might change the semantic meaning of the surrounding markup.
Instead, replace them with a space which hopefully has the same semantic
effect of the comment.
Directives are not actually a node type in the XML spec, which instead
specifies each of them separately (<!ENTITY, <!DOCTYPE, etc.), each with
its own grammar. The rules for where and when the comments are allowed
are not straightforward, and can't be implemented without implementing
custom logic for each of the directives.
Simply preserving the comments in the body of the directive would be
problematic, as there can be unmatched quotes inside the comment.
Whether those quotes are considered meaningful semantically or not,
other parsers might disagree and interpret the output differently.
This issue was reported by Juho Nurminen of Mattermost as it leads to
round-trip mismatches. See #43168. It's not being fixed in a security
release because round-trip stability is not a currently supported
security property of encoding/xml, and we don't believe these fixes
would be sufficient to reliably guarantee it in the future.
Fixes CVE-2020-29510
Updates #43168
Change-Id: Icd86c75beff3e1e0689543efebdad10ed5178ce3
Reviewed-on: https://go-review.googlesource.com/c/go/+/277893
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Upstream-Status: Backport from https://github.com/golang/go/commit/a9cfd55e2b09735a25976d1b008a0a3c767494f8
CVE: CVE-2020-29510
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/encoding/xml/xml.go | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/encoding/xml/xml.go b/src/encoding/xml/xml.go
index 01a1460..98647b2 100644
--- a/src/encoding/xml/xml.go
+++ b/src/encoding/xml/xml.go
@@ -768,6 +768,12 @@ func (d *Decoder) rawToken() (Token, error) {
}
b0, b1 = b1, b
}
+
+ // Replace the comment with a space in the returned Directive
+ // body, so that markup parts that were separated by the comment
+ // (like a "<" and a "!") don't get joined when re-encoding the
+ // Directive, taking new semantic meaning.
+ d.buf.WriteByte(' ')
}
}
return Directive(d.buf.Bytes()), nil
--
2.7.4

View File

@@ -0,0 +1,53 @@
From 94e0c36694fb044e81381d112fef3692de7cdf52 Mon Sep 17 00:00:00 2001
From: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Fri, 22 Apr 2022 10:07:51 +0900
Subject: [PATCH 1/2] path/filepath: do not remove prefix "." when following
path contains ":".
Fixes #52476
Change-Id: I9eb72ac7dbccd6322d060291f31831dc389eb9bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/401595
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Upstream-Status: Backport from https://github.com/golang/go/commit/9cd1818a7d019c02fa4898b3e45a323e35033290
CVE: CVE-2022-41722
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/path/filepath/path.go | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go
index 26f1833..92dc090 100644
--- a/src/path/filepath/path.go
+++ b/src/path/filepath/path.go
@@ -116,9 +116,21 @@ func Clean(path string) string {
case os.IsPathSeparator(path[r]):
// empty path element
r++
- case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])):
+ case path[r] == '.' && r+1 == n:
// . element
r++
+ case path[r] == '.' && os.IsPathSeparator(path[r+1]):
+ // ./ element
+ r++
+
+ for r < len(path) && os.IsPathSeparator(path[r]) {
+ r++
+ }
+ if out.w == 0 && volumeNameLen(path[r:]) > 0 {
+ // When joining prefix "." and an absolute path on Windows,
+ // the prefix should not be removed.
+ out.append('.')
+ }
case path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])):
// .. element: remove to last separator
r += 2
--
2.7.4

View File

@@ -0,0 +1,104 @@
From b8803cb711ae163b8e67897deb6cf8c49702227c Mon Sep 17 00:00:00 2001
From: Damien Neil <dneil@google.com>
Date: Mon, 12 Dec 2022 16:43:37 -0800
Subject: [PATCH 2/2] path/filepath: do not Clean("a/../c:/b") into c:\b on
Windows
Do not permit Clean to convert a relative path into one starting
with a drive reference. This change causes Clean to insert a .
path element at the start of a path when the original path does not
start with a volume name, and the first path element would contain
a colon.
This may introduce a spurious but harmless . path element under
some circumstances. For example, Clean("a/../b:/../c") becomes `.\c`.
This reverts CL 401595, since the change here supersedes the one
in that CL.
Thanks to RyotaK (https://twitter.com/ryotkak) for reporting this issue.
Updates #57274
Fixes #57276
Fixes CVE-2022-41722
Change-Id: I837446285a03aa74c79d7642720e01f354c2ca17
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1675249
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com>
(cherry picked from commit 8ca37f4813ef2f64600c92b83f17c9f3ca6c03a5)
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1728944
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/468119
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
Upstream-Status: Backport from https://github.com/golang/go/commit/bdf07c2e168baf736e4c057279ca12a4d674f18c
CVE: CVE-2022-41722
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/path/filepath/path.go | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go
index 92dc090..f0f095e 100644
--- a/src/path/filepath/path.go
+++ b/src/path/filepath/path.go
@@ -14,6 +14,7 @@ package filepath
import (
"errors"
"os"
+ "runtime"
"sort"
"strings"
)
@@ -116,21 +117,9 @@ func Clean(path string) string {
case os.IsPathSeparator(path[r]):
// empty path element
r++
- case path[r] == '.' && r+1 == n:
+ case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])):
// . element
r++
- case path[r] == '.' && os.IsPathSeparator(path[r+1]):
- // ./ element
- r++
-
- for r < len(path) && os.IsPathSeparator(path[r]) {
- r++
- }
- if out.w == 0 && volumeNameLen(path[r:]) > 0 {
- // When joining prefix "." and an absolute path on Windows,
- // the prefix should not be removed.
- out.append('.')
- }
case path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])):
// .. element: remove to last separator
r += 2
@@ -156,6 +145,18 @@ func Clean(path string) string {
if rooted && out.w != 1 || !rooted && out.w != 0 {
out.append(Separator)
}
+ // If a ':' appears in the path element at the start of a Windows path,
+ // insert a .\ at the beginning to avoid converting relative paths
+ // like a/../c: into c:.
+ if runtime.GOOS == "windows" && out.w == 0 && out.volLen == 0 && r != 0 {
+ for i := r; i < n && !os.IsPathSeparator(path[i]); i++ {
+ if path[i] == ':' {
+ out.append('.')
+ out.append(Separator)
+ break
+ }
+ }
+ }
// copy element
for ; r < n && !os.IsPathSeparator(path[r]); r++ {
out.append(path[r])
--
2.7.4

View File

@@ -0,0 +1,156 @@
From 451766789f646617157c725e20c955d4a9a70d4e Mon Sep 17 00:00:00 2001
From: Roland Shoemaker <bracewell@google.com>
Date: Mon, 6 Feb 2023 10:03:44 -0800
Subject: [PATCH] net/http: update bundled golang.org/x/net/http2
Disable cmd/internal/moddeps test, since this update includes PRIVATE
track fixes.
Fixes CVE-2022-41723
Fixes #58355
Updates #57855
Change-Id: Ie870562a6f6e44e4e8f57db6a0dde1a41a2b090c
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1728939
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/468118
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Upstream-Status: Backport [https://github.com/golang/go/commit/5c3e11bd0b5c0a86e5beffcd4339b86a902b21c3]
CVE: CVE-2022-41723
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/vendor/golang.org/x/net/http2/hpack/hpack.go | 79 +++++++++++++++---------
1 file changed, 49 insertions(+), 30 deletions(-)
diff --git a/src/vendor/golang.org/x/net/http2/hpack/hpack.go b/src/vendor/golang.org/x/net/http2/hpack/hpack.go
index 85f18a2..02e80e3 100644
--- a/src/vendor/golang.org/x/net/http2/hpack/hpack.go
+++ b/src/vendor/golang.org/x/net/http2/hpack/hpack.go
@@ -359,6 +359,7 @@ func (d *Decoder) parseFieldLiteral(n uint8, it indexType) error {
var hf HeaderField
wantStr := d.emitEnabled || it.indexed()
+ var undecodedName undecodedString
if nameIdx > 0 {
ihf, ok := d.at(nameIdx)
if !ok {
@@ -366,15 +367,27 @@ func (d *Decoder) parseFieldLiteral(n uint8, it indexType) error {
}
hf.Name = ihf.Name
} else {
- hf.Name, buf, err = d.readString(buf, wantStr)
+ undecodedName, buf, err = d.readString(buf)
if err != nil {
return err
}
}
- hf.Value, buf, err = d.readString(buf, wantStr)
+ undecodedValue, buf, err := d.readString(buf)
if err != nil {
return err
}
+ if wantStr {
+ if nameIdx <= 0 {
+ hf.Name, err = d.decodeString(undecodedName)
+ if err != nil {
+ return err
+ }
+ }
+ hf.Value, err = d.decodeString(undecodedValue)
+ if err != nil {
+ return err
+ }
+ }
d.buf = buf
if it.indexed() {
d.dynTab.add(hf)
@@ -459,46 +472,52 @@ func readVarInt(n byte, p []byte) (i uint64, remain []byte, err error) {
return 0, origP, errNeedMore
}
-// readString decodes an hpack string from p.
+// readString reads an hpack string from p.
//
-// wantStr is whether s will be used. If false, decompression and
-// []byte->string garbage are skipped if s will be ignored
-// anyway. This does mean that huffman decoding errors for non-indexed
-// strings past the MAX_HEADER_LIST_SIZE are ignored, but the server
-// is returning an error anyway, and because they're not indexed, the error
-// won't affect the decoding state.
-func (d *Decoder) readString(p []byte, wantStr bool) (s string, remain []byte, err error) {
+// It returns a reference to the encoded string data to permit deferring decode costs
+// until after the caller verifies all data is present.
+func (d *Decoder) readString(p []byte) (u undecodedString, remain []byte, err error) {
if len(p) == 0 {
- return "", p, errNeedMore
+ return u, p, errNeedMore
}
isHuff := p[0]&128 != 0
strLen, p, err := readVarInt(7, p)
if err != nil {
- return "", p, err
+ return u, p, err
}
if d.maxStrLen != 0 && strLen > uint64(d.maxStrLen) {
- return "", nil, ErrStringLength
+ // Returning an error here means Huffman decoding errors
+ // for non-indexed strings past the maximum string length
+ // are ignored, but the server is returning an error anyway
+ // and because the string is not indexed the error will not
+ // affect the decoding state.
+ return u, nil, ErrStringLength
}
if uint64(len(p)) < strLen {
- return "", p, errNeedMore
- }
- if !isHuff {
- if wantStr {
- s = string(p[:strLen])
- }
- return s, p[strLen:], nil
+ return u, p, errNeedMore
}
+ u.isHuff = isHuff
+ u.b = p[:strLen]
+ return u, p[strLen:], nil
+}
- if wantStr {
- buf := bufPool.Get().(*bytes.Buffer)
- buf.Reset() // don't trust others
- defer bufPool.Put(buf)
- if err := huffmanDecode(buf, d.maxStrLen, p[:strLen]); err != nil {
- buf.Reset()
- return "", nil, err
- }
+type undecodedString struct {
+ isHuff bool
+ b []byte
+}
+
+func (d *Decoder) decodeString(u undecodedString) (string, error) {
+ if !u.isHuff {
+ return string(u.b), nil
+ }
+ buf := bufPool.Get().(*bytes.Buffer)
+ buf.Reset() // don't trust others
+ var s string
+ err := huffmanDecode(buf, d.maxStrLen, u.b)
+ if err == nil {
s = buf.String()
- buf.Reset() // be nice to GC
}
- return s, p[strLen:], nil
+ buf.Reset() // be nice to GC
+ bufPool.Put(buf)
+ return s, err
}
--
2.7.4

View File

@@ -0,0 +1,200 @@
From d6759e7a059f4208f07aa781402841d7ddaaef96 Mon Sep 17 00:00:00 2001
From: Damien Neil <dneil@google.com>
Date: Fri, 10 Mar 2023 14:21:05 -0800
Subject: [PATCH] [release-branch.go1.19] net/textproto: avoid overpredicting
the number of MIME header keys
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1802452
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
(cherry picked from commit f739f080a72fd5b06d35c8e244165159645e2ed6)
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1802393
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Change-Id: I675451438d619a9130360c56daf529559004903f
Reviewed-on: https://go-review.googlesource.com/c/go/+/481982
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Upstream-Status: Backport [https://github.com/golang/go/commit/d6759e7a059f4208f07aa781402841d7ddaaef96]
CVE: CVE-2023-24534
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
---
src/bytes/bytes.go | 13 +++++++
src/net/textproto/reader.go | 31 +++++++++++------
src/net/textproto/reader_test.go | 59 ++++++++++++++++++++++++++++++++
3 files changed, 92 insertions(+), 11 deletions(-)
diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go
index e872cc2..1f0d760 100644
--- a/src/bytes/bytes.go
+++ b/src/bytes/bytes.go
@@ -1078,6 +1078,19 @@ func Index(s, sep []byte) int {
return -1
}
+// Cut slices s around the first instance of sep,
+// returning the text before and after sep.
+// The found result reports whether sep appears in s.
+// If sep does not appear in s, cut returns s, nil, false.
+//
+// Cut returns slices of the original slice s, not copies.
+func Cut(s, sep []byte) (before, after []byte, found bool) {
+ if i := Index(s, sep); i >= 0 {
+ return s[:i], s[i+len(sep):], true
+ }
+ return s, nil, false
+}
+
func indexRabinKarp(s, sep []byte) int {
// Rabin-Karp search
hashsep, pow := hashStr(sep)
diff --git a/src/net/textproto/reader.go b/src/net/textproto/reader.go
index a505da9..8d547fe 100644
--- a/src/net/textproto/reader.go
+++ b/src/net/textproto/reader.go
@@ -486,8 +487,11 @@ func (r *Reader) ReadMIMEHeader() (MIMEHeader, error) {
// large one ahead of time which we'll cut up into smaller
// slices. If this isn't big enough later, we allocate small ones.
var strs []string
- hint := r.upcomingHeaderNewlines()
+ hint := r.upcomingHeaderKeys()
if hint > 0 {
+ if hint > 1000 {
+ hint = 1000 // set a cap to avoid overallocation
+ }
strs = make([]string, hint)
}
@@ -562,9 +566,11 @@ func mustHaveFieldNameColon(line []byte) error {
return nil
}
-// upcomingHeaderNewlines returns an approximation of the number of newlines
+var nl = []byte("\n")
+
+// upcomingHeaderKeys returns an approximation of the number of keys
// that will be in this header. If it gets confused, it returns 0.
-func (r *Reader) upcomingHeaderNewlines() (n int) {
+func (r *Reader) upcomingHeaderKeys() (n int) {
// Try to determine the 'hint' size.
r.R.Peek(1) // force a buffer load if empty
s := r.R.Buffered()
@@ -572,17 +578,20 @@ func (r *Reader) upcomingHeaderNewlines() (n int) {
return
}
peek, _ := r.R.Peek(s)
- for len(peek) > 0 {
- i := bytes.IndexByte(peek, '\n')
- if i < 3 {
- // Not present (-1) or found within the next few bytes,
- // implying we're at the end ("\r\n\r\n" or "\n\n")
- return
+ for len(peek) > 0 && n < 1000 {
+ var line []byte
+ line, peek, _ = bytes.Cut(peek, nl)
+ if len(line) == 0 || (len(line) == 1 && line[0] == '\r') {
+ // Blank line separating headers from the body.
+ break
+ }
+ if line[0] == ' ' || line[0] == '\t' {
+ // Folded continuation of the previous line.
+ continue
}
n++
- peek = peek[i+1:]
}
- return
+ return n
}
// CanonicalMIMEHeaderKey returns the canonical format of the
diff --git a/src/net/textproto/reader_test.go b/src/net/textproto/reader_test.go
index 3124d43..3ae0de1 100644
--- a/src/net/textproto/reader_test.go
+++ b/src/net/textproto/reader_test.go
@@ -9,6 +9,7 @@ import (
"bytes"
"io"
"reflect"
+ "runtime"
"strings"
"testing"
)
@@ -127,6 +128,42 @@ func TestReadMIMEHeaderSingle(t *testing.T) {
}
}
+// TestReaderUpcomingHeaderKeys is testing an internal function, but it's very
+// difficult to test well via the external API.
+func TestReaderUpcomingHeaderKeys(t *testing.T) {
+ for _, test := range []struct {
+ input string
+ want int
+ }{{
+ input: "",
+ want: 0,
+ }, {
+ input: "A: v",
+ want: 1,
+ }, {
+ input: "A: v\r\nB: v\r\n",
+ want: 2,
+ }, {
+ input: "A: v\nB: v\n",
+ want: 2,
+ }, {
+ input: "A: v\r\n continued\r\n still continued\r\nB: v\r\n\r\n",
+ want: 2,
+ }, {
+ input: "A: v\r\n\r\nB: v\r\nC: v\r\n",
+ want: 1,
+ }, {
+ input: "A: v" + strings.Repeat("\n", 1000),
+ want: 1,
+ }} {
+ r := reader(test.input)
+ got := r.upcomingHeaderKeys()
+ if test.want != got {
+ t.Fatalf("upcomingHeaderKeys(%q): %v; want %v", test.input, got, test.want)
+ }
+ }
+}
+
func TestReadMIMEHeaderNoKey(t *testing.T) {
r := reader(": bar\ntest-1: 1\n\n")
m, err := r.ReadMIMEHeader()
@@ -223,6 +260,28 @@ func TestReadMIMEHeaderTrimContinued(t *testing.T) {
}
}
+// Test that reading a header doesn't overallocate. Issue 58975.
+func TestReadMIMEHeaderAllocations(t *testing.T) {
+ var totalAlloc uint64
+ const count = 200
+ for i := 0; i < count; i++ {
+ r := reader("A: b\r\n\r\n" + strings.Repeat("\n", 4096))
+ var m1, m2 runtime.MemStats
+ runtime.ReadMemStats(&m1)
+ _, err := r.ReadMIMEHeader()
+ if err != nil {
+ t.Fatalf("ReadMIMEHeader: %v", err)
+ }
+ runtime.ReadMemStats(&m2)
+ totalAlloc += m2.TotalAlloc - m1.TotalAlloc
+ }
+ // 32k is large and we actually allocate substantially less,
+ // but prior to the fix for #58975 we allocated ~400k in this case.
+ if got, want := totalAlloc/count, uint64(32768); got > want {
+ t.Fatalf("ReadMIMEHeader allocated %v bytes, want < %v", got, want)
+ }
+}
+
type readResponseTest struct {
in string
inCode int
--
2.25.1

View File

@@ -0,0 +1,76 @@
From bf8c7c575c8a552d9d79deb29e80854dc88528d0 Mon Sep 17 00:00:00 2001
From: Damien Neil <dneil@google.com>
Date: Mon, 20 Mar 2023 10:43:19 -0700
Subject: [PATCH] [release-branch.go1.20] mime/multipart: limit parsed mime
message sizes
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1802456
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1802611
Reviewed-by: Damien Neil <dneil@google.com>
Change-Id: Ifdfa192d54f722d781a4d8c5f35b5fb72d122168
Reviewed-on: https://go-review.googlesource.com/c/go/+/481986
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Upstream-Status: Backport [https://github.com/golang/go/commit/126a1d02da82f93ede7ce0bd8d3c51ef627f2104]
CVE: CVE-2023-24537
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
---
src/go/parser/parser_test.go | 16 ++++++++++++++++
src/go/scanner/scanner.go | 5 ++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/go/parser/parser_test.go b/src/go/parser/parser_test.go
index 37a6a2b..714557c 100644
--- a/src/go/parser/parser_test.go
+++ b/src/go/parser/parser_test.go
@@ -738,3 +738,19 @@ func TestScopeDepthLimit(t *testing.T) {
}
}
}
+
+// TestIssue59180 tests that line number overflow doesn't cause an infinite loop.
+func TestIssue59180(t *testing.T) {
+ testcases := []string{
+ "package p\n//line :9223372036854775806\n\n//",
+ "package p\n//line :1:9223372036854775806\n\n//",
+ "package p\n//line file:9223372036854775806\n\n//",
+ }
+
+ for _, src := range testcases {
+ _, err := ParseFile(token.NewFileSet(), "", src, ParseComments)
+ if err == nil {
+ t.Errorf("ParseFile(%s) succeeded unexpectedly", src)
+ }
+ }
+}
diff --git a/src/go/scanner/scanner.go b/src/go/scanner/scanner.go
index 00fe2dc..3159d25 100644
--- a/src/go/scanner/scanner.go
+++ b/src/go/scanner/scanner.go
@@ -246,13 +246,16 @@ func (s *Scanner) updateLineInfo(next, offs int, text []byte) {
return
}
+ // Put a cap on the maximum size of line and column numbers.
+ // 30 bits allows for some additional space before wrapping an int32.
+ const maxLineCol = 1<<30 - 1
var line, col int
i2, n2, ok2 := trailingDigits(text[:i-1])
if ok2 {
//line filename:line:col
i, i2 = i2, i
line, col = n2, n
- if col == 0 {
+ if col == 0 || col > maxLineCol {
s.error(offs+i2, "invalid column number: "+string(text[i2:]))
return
}
--
2.25.1

View File

@@ -0,0 +1,125 @@
From 8acd01094d9ee17f6e763a61e49a8a808b3a9ddb Mon Sep 17 00:00:00 2001
From: Brad Fitzpatrick <bradfitz@golang.org>
Date: Mon, 2 Aug 2021 14:55:51 -0700
Subject: [PATCH 1/3] net/netip: add new IP address package
Co-authored-by: Alex Willmer <alex@moreati.org.uk> (GitHub @moreati)
Co-authored-by: Alexander Yastrebov <yastrebov.alex@gmail.com>
Co-authored-by: David Anderson <dave@natulte.net> (Tailscale CLA)
Co-authored-by: David Crawshaw <crawshaw@tailscale.com> (Tailscale CLA)
Co-authored-by: Dmytro Shynkevych <dmytro@tailscale.com> (Tailscale CLA)
Co-authored-by: Elias Naur <mail@eliasnaur.com>
Co-authored-by: Joe Tsai <joetsai@digital-static.net> (Tailscale CLA)
Co-authored-by: Jonathan Yu <jawnsy@cpan.org> (GitHub @jawnsy)
Co-authored-by: Josh Bleecher Snyder <josharian@gmail.com> (Tailscale CLA)
Co-authored-by: Maisem Ali <maisem@tailscale.com> (Tailscale CLA)
Co-authored-by: Manuel Mendez (Go AUTHORS mmendez534@...)
Co-authored-by: Matt Layher <mdlayher@gmail.com>
Co-authored-by: Noah Treuhaft <noah.treuhaft@gmail.com> (GitHub @nwt)
Co-authored-by: Stefan Majer <stefan.majer@gmail.com>
Co-authored-by: Terin Stock <terinjokes@gmail.com> (Cloudflare CLA)
Co-authored-by: Tobias Klauser <tklauser@distanz.ch>
Fixes #46518
Change-Id: I0041f9e1115d61fa6e95fcf32b01d9faee708712
Reviewed-on: https://go-review.googlesource.com/c/go/+/339309
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Dependency Patch #1
Upstream-Status: Backport [https://github.com/golang/go/commit/a59e33224e42d60a97fa720a45e1b74eb6aaa3d0]
CVE: CVE-2023-24538
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/internal/godebug/godebug.go | 34 ++++++++++++++++++++++++++++++++++
src/internal/godebug/godebug_test.go | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+)
create mode 100644 src/internal/godebug/godebug.go
create mode 100644 src/internal/godebug/godebug_test.go
diff --git a/src/internal/godebug/godebug.go b/src/internal/godebug/godebug.go
new file mode 100644
index 0000000..ac434e5
--- /dev/null
+++ b/src/internal/godebug/godebug.go
@@ -0,0 +1,34 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package godebug parses the GODEBUG environment variable.
+package godebug
+
+import "os"
+
+// Get returns the value for the provided GODEBUG key.
+func Get(key string) string {
+ return get(os.Getenv("GODEBUG"), key)
+}
+
+// get returns the value part of key=value in s (a GODEBUG value).
+func get(s, key string) string {
+ for i := 0; i < len(s)-len(key)-1; i++ {
+ if i > 0 && s[i-1] != ',' {
+ continue
+ }
+ afterKey := s[i+len(key):]
+ if afterKey[0] != '=' || s[i:i+len(key)] != key {
+ continue
+ }
+ val := afterKey[1:]
+ for i, b := range val {
+ if b == ',' {
+ return val[:i]
+ }
+ }
+ return val
+ }
+ return ""
+}
diff --git a/src/internal/godebug/godebug_test.go b/src/internal/godebug/godebug_test.go
new file mode 100644
index 0000000..41b9117
--- /dev/null
+++ b/src/internal/godebug/godebug_test.go
@@ -0,0 +1,34 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package godebug
+
+import "testing"
+
+func TestGet(t *testing.T) {
+ tests := []struct {
+ godebug string
+ key string
+ want string
+ }{
+ {"", "", ""},
+ {"", "foo", ""},
+ {"foo=bar", "foo", "bar"},
+ {"foo=bar,after=x", "foo", "bar"},
+ {"before=x,foo=bar,after=x", "foo", "bar"},
+ {"before=x,foo=bar", "foo", "bar"},
+ {",,,foo=bar,,,", "foo", "bar"},
+ {"foodecoy=wrong,foo=bar", "foo", "bar"},
+ {"foo=", "foo", ""},
+ {"foo", "foo", ""},
+ {",foo", "foo", ""},
+ {"foo=bar,baz", "loooooooong", ""},
+ }
+ for _, tt := range tests {
+ got := get(tt.godebug, tt.key)
+ if got != tt.want {
+ t.Errorf("get(%q, %q) = %q; want %q", tt.godebug, tt.key, got, tt.want)
+ }
+ }
+}
--
2.7.4

View File

@@ -0,0 +1,196 @@
From 6fc21505614f36178df0dad7034b6b8e3f7588d5 Mon Sep 17 00:00:00 2001
From: empijei <robclap8@gmail.com>
Date: Fri, 27 Mar 2020 19:27:55 +0100
Subject: [PATCH 2/3] html/template,text/template: switch to Unicode escapes
for JSON compatibility
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The existing implementation is not compatible with JSON
escape as it uses hex escaping.
Unicode escape, instead, is valid for both JSON and JS.
This fix avoids creating a separate escaping context for
scripts of type "application/ld+json" and it is more
future-proof in case more JSON+JS contexts get added
to the platform (e.g. import maps).
Fixes #33671
Fixes #37634
Change-Id: Id6f6524b4abc52e81d9d744d46bbe5bf2e081543
Reviewed-on: https://go-review.googlesource.com/c/go/+/226097
Reviewed-by: Carl Johnson <me@carlmjohnson.net>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Dependency Patch #2
Upstream-Status: Backport from https://github.com/golang/go/commit/d4d298040d072ddacea0e0d6b55fb148fff18070
CVE: CVE-2023-24538
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/html/template/js.go | 70 +++++++++++++++++++++++++++-------------------
src/text/template/funcs.go | 8 +++---
2 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/src/html/template/js.go b/src/html/template/js.go
index 0e91458..ea9c183 100644
--- a/src/html/template/js.go
+++ b/src/html/template/js.go
@@ -163,7 +163,6 @@ func jsValEscaper(args ...interface{}) string {
}
// TODO: detect cycles before calling Marshal which loops infinitely on
// cyclic data. This may be an unacceptable DoS risk.
-
b, err := json.Marshal(a)
if err != nil {
// Put a space before comment so that if it is flush against
@@ -178,8 +177,8 @@ func jsValEscaper(args ...interface{}) string {
// TODO: maybe post-process output to prevent it from containing
// "<!--", "-->", "<![CDATA[", "]]>", or "</script"
// in case custom marshalers produce output containing those.
-
- // TODO: Maybe abbreviate \u00ab to \xab to produce more compact output.
+ // Note: Do not use \x escaping to save bytes because it is not JSON compatible and this escaper
+ // supports ld+json content-type.
if len(b) == 0 {
// In, `x=y/{{.}}*z` a json.Marshaler that produces "" should
// not cause the output `x=y/*z`.
@@ -260,6 +259,8 @@ func replace(s string, replacementTable []string) string {
r, w = utf8.DecodeRuneInString(s[i:])
var repl string
switch {
+ case int(r) < len(lowUnicodeReplacementTable):
+ repl = lowUnicodeReplacementTable[r]
case int(r) < len(replacementTable) && replacementTable[r] != "":
repl = replacementTable[r]
case r == '\u2028':
@@ -283,67 +284,80 @@ func replace(s string, replacementTable []string) string {
return b.String()
}
+var lowUnicodeReplacementTable = []string{
+ 0: `\u0000`, 1: `\u0001`, 2: `\u0002`, 3: `\u0003`, 4: `\u0004`, 5: `\u0005`, 6: `\u0006`,
+ '\a': `\u0007`,
+ '\b': `\u0008`,
+ '\t': `\t`,
+ '\n': `\n`,
+ '\v': `\u000b`, // "\v" == "v" on IE 6.
+ '\f': `\f`,
+ '\r': `\r`,
+ 0xe: `\u000e`, 0xf: `\u000f`, 0x10: `\u0010`, 0x11: `\u0011`, 0x12: `\u0012`, 0x13: `\u0013`,
+ 0x14: `\u0014`, 0x15: `\u0015`, 0x16: `\u0016`, 0x17: `\u0017`, 0x18: `\u0018`, 0x19: `\u0019`,
+ 0x1a: `\u001a`, 0x1b: `\u001b`, 0x1c: `\u001c`, 0x1d: `\u001d`, 0x1e: `\u001e`, 0x1f: `\u001f`,
+}
+
var jsStrReplacementTable = []string{
- 0: `\0`,
+ 0: `\u0000`,
'\t': `\t`,
'\n': `\n`,
- '\v': `\x0b`, // "\v" == "v" on IE 6.
+ '\v': `\u000b`, // "\v" == "v" on IE 6.
'\f': `\f`,
'\r': `\r`,
// Encode HTML specials as hex so the output can be embedded
// in HTML attributes without further encoding.
- '"': `\x22`,
- '&': `\x26`,
- '\'': `\x27`,
- '+': `\x2b`,
+ '"': `\u0022`,
+ '&': `\u0026`,
+ '\'': `\u0027`,
+ '+': `\u002b`,
'/': `\/`,
- '<': `\x3c`,
- '>': `\x3e`,
+ '<': `\u003c`,
+ '>': `\u003e`,
'\\': `\\`,
}
// jsStrNormReplacementTable is like jsStrReplacementTable but does not
// overencode existing escapes since this table has no entry for `\`.
var jsStrNormReplacementTable = []string{
- 0: `\0`,
+ 0: `\u0000`,
'\t': `\t`,
'\n': `\n`,
- '\v': `\x0b`, // "\v" == "v" on IE 6.
+ '\v': `\u000b`, // "\v" == "v" on IE 6.
'\f': `\f`,
'\r': `\r`,
// Encode HTML specials as hex so the output can be embedded
// in HTML attributes without further encoding.
- '"': `\x22`,
- '&': `\x26`,
- '\'': `\x27`,
- '+': `\x2b`,
+ '"': `\u0022`,
+ '&': `\u0026`,
+ '\'': `\u0027`,
+ '+': `\u002b`,
'/': `\/`,
- '<': `\x3c`,
- '>': `\x3e`,
+ '<': `\u003c`,
+ '>': `\u003e`,
}
-
var jsRegexpReplacementTable = []string{
- 0: `\0`,
+ 0: `\u0000`,
'\t': `\t`,
'\n': `\n`,
- '\v': `\x0b`, // "\v" == "v" on IE 6.
+ '\v': `\u000b`, // "\v" == "v" on IE 6.
'\f': `\f`,
'\r': `\r`,
// Encode HTML specials as hex so the output can be embedded
// in HTML attributes without further encoding.
- '"': `\x22`,
+ '"': `\u0022`,
'$': `\$`,
- '&': `\x26`,
- '\'': `\x27`,
+ '&': `\u0026`,
+ '\'': `\u0027`,
'(': `\(`,
')': `\)`,
'*': `\*`,
- '+': `\x2b`,
+ '+': `\u002b`,
'-': `\-`,
'.': `\.`,
'/': `\/`,
- '<': `\x3c`,
- '>': `\x3e`,
+ '<': `\u003c`,
+ '>': `\u003e`,
'?': `\?`,
'[': `\[`,
'\\': `\\`,
diff --git a/src/text/template/funcs.go b/src/text/template/funcs.go
index 46125bc..f3de9fb 100644
--- a/src/text/template/funcs.go
+++ b/src/text/template/funcs.go
@@ -640,10 +640,10 @@ var (
jsBackslash = []byte(`\\`)
jsApos = []byte(`\'`)
jsQuot = []byte(`\"`)
- jsLt = []byte(`\x3C`)
- jsGt = []byte(`\x3E`)
- jsAmp = []byte(`\x26`)
- jsEq = []byte(`\x3D`)
+ jsLt = []byte(`\u003C`)
+ jsGt = []byte(`\u003E`)
+ jsAmp = []byte(`\u0026`)
+ jsEq = []byte(`\u003D`)
)
// JSEscape writes to w the escaped JavaScript equivalent of the plain text data b.
--
2.7.4

View File

@@ -0,0 +1,208 @@
From 16f4882984569f179d73967c9eee679bb9b098c5 Mon Sep 17 00:00:00 2001
From: Roland Shoemaker <bracewell@google.com>
Date: Mon, 20 Mar 2023 11:01:13 -0700
Subject: [PATCH 3/3] html/template: disallow actions in JS template literals
ECMAScript 6 introduced template literals[0][1] which are delimited with
backticks. These need to be escaped in a similar fashion to the
delimiters for other string literals. Additionally template literals can
contain special syntax for string interpolation.
There is no clear way to allow safe insertion of actions within JS
template literals, as handling (JS) string interpolation inside of these
literals is rather complex. As such we've chosen to simply disallow
template actions within these template literals.
A new error code is added for this parsing failure case, errJsTmplLit,
but it is unexported as it is not backwards compatible with other minor
release versions to introduce an API change in a minor release. We will
export this code in the next major release.
The previous behavior (with the cavet that backticks are now escaped
properly) can be re-enabled with GODEBUG=jstmpllitinterp=1.
This change subsumes CL471455.
Thanks to Sohom Datta, Manipal Institute of Technology, for reporting
this issue.
Fixes CVE-2023-24538
For #59234
Fixes #59271
[0] https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-template-literals
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1802457
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1802612
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Change-Id: Ic7f10595615f2b2740d9c85ad7ef40dc0e78c04c
Reviewed-on: https://go-review.googlesource.com/c/go/+/481987
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Upstream-Status: Backport from https://github.com/golang/go/commit/b1e3ecfa06b67014429a197ec5e134ce4303ad9b
CVE: CVE-2023-24538
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
---
src/html/template/context.go | 2 ++
src/html/template/error.go | 13 +++++++++++++
src/html/template/escape.go | 11 +++++++++++
src/html/template/js.go | 2 ++
src/html/template/jsctx_string.go | 9 +++++++++
src/html/template/transition.go | 7 ++++++-
6 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/src/html/template/context.go b/src/html/template/context.go
index f7d4849..0b65313 100644
--- a/src/html/template/context.go
+++ b/src/html/template/context.go
@@ -116,6 +116,8 @@ const (
stateJSDqStr
// stateJSSqStr occurs inside a JavaScript single quoted string.
stateJSSqStr
+ // stateJSBqStr occurs inside a JavaScript back quoted string.
+ stateJSBqStr
// stateJSRegexp occurs inside a JavaScript regexp literal.
stateJSRegexp
// stateJSBlockCmt occurs inside a JavaScript /* block comment */.
diff --git a/src/html/template/error.go b/src/html/template/error.go
index 0e52706..fd26b64 100644
--- a/src/html/template/error.go
+++ b/src/html/template/error.go
@@ -211,6 +211,19 @@ const (
// pipeline occurs in an unquoted attribute value context, "html" is
// disallowed. Avoid using "html" and "urlquery" entirely in new templates.
ErrPredefinedEscaper
+
+ // errJSTmplLit: "... appears in a JS template literal"
+ // Example:
+ // <script>var tmpl = `{{.Interp}`</script>
+ // Discussion:
+ // Package html/template does not support actions inside of JS template
+ // literals.
+ //
+ // TODO(rolandshoemaker): we cannot add this as an exported error in a minor
+ // release, since it is backwards incompatible with the other minor
+ // releases. As such we need to leave it unexported, and then we'll add it
+ // in the next major release.
+ errJSTmplLit
)
func (e *Error) Error() string {
diff --git a/src/html/template/escape.go b/src/html/template/escape.go
index f12dafa..29ca5b3 100644
--- a/src/html/template/escape.go
+++ b/src/html/template/escape.go
@@ -8,6 +8,7 @@ import (
"bytes"
"fmt"
"html"
+ "internal/godebug"
"io"
"text/template"
"text/template/parse"
@@ -203,6 +204,16 @@ func (e *escaper) escapeAction(c context, n *parse.ActionNode) context {
c.jsCtx = jsCtxDivOp
case stateJSDqStr, stateJSSqStr:
s = append(s, "_html_template_jsstrescaper")
+ case stateJSBqStr:
+ debugAllowActionJSTmpl := godebug.Get("jstmpllitinterp")
+ if debugAllowActionJSTmpl == "1" {
+ s = append(s, "_html_template_jsstrescaper")
+ } else {
+ return context{
+ state: stateError,
+ err: errorf(errJSTmplLit, n, n.Line, "%s appears in a JS template literal", n),
+ }
+ }
case stateJSRegexp:
s = append(s, "_html_template_jsregexpescaper")
case stateCSS:
diff --git a/src/html/template/js.go b/src/html/template/js.go
index ea9c183..b888eaf 100644
--- a/src/html/template/js.go
+++ b/src/html/template/js.go
@@ -308,6 +308,7 @@ var jsStrReplacementTable = []string{
// Encode HTML specials as hex so the output can be embedded
// in HTML attributes without further encoding.
'"': `\u0022`,
+ '`': `\u0060`,
'&': `\u0026`,
'\'': `\u0027`,
'+': `\u002b`,
@@ -331,6 +332,7 @@ var jsStrNormReplacementTable = []string{
'"': `\u0022`,
'&': `\u0026`,
'\'': `\u0027`,
+ '`': `\u0060`,
'+': `\u002b`,
'/': `\/`,
'<': `\u003c`,
diff --git a/src/html/template/jsctx_string.go b/src/html/template/jsctx_string.go
index dd1d87e..2394893 100644
--- a/src/html/template/jsctx_string.go
+++ b/src/html/template/jsctx_string.go
@@ -4,6 +4,15 @@ package template
import "strconv"
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[jsCtxRegexp-0]
+ _ = x[jsCtxDivOp-1]
+ _ = x[jsCtxUnknown-2]
+}
+
const _jsCtx_name = "jsCtxRegexpjsCtxDivOpjsCtxUnknown"
var _jsCtx_index = [...]uint8{0, 11, 21, 33}
diff --git a/src/html/template/transition.go b/src/html/template/transition.go
index 06df679..92eb351 100644
--- a/src/html/template/transition.go
+++ b/src/html/template/transition.go
@@ -27,6 +27,7 @@ var transitionFunc = [...]func(context, []byte) (context, int){
stateJS: tJS,
stateJSDqStr: tJSDelimited,
stateJSSqStr: tJSDelimited,
+ stateJSBqStr: tJSDelimited,
stateJSRegexp: tJSDelimited,
stateJSBlockCmt: tBlockCmt,
stateJSLineCmt: tLineCmt,
@@ -262,7 +263,7 @@ func tURL(c context, s []byte) (context, int) {
// tJS is the context transition function for the JS state.
func tJS(c context, s []byte) (context, int) {
- i := bytes.IndexAny(s, `"'/`)
+ i := bytes.IndexAny(s, "\"`'/")
if i == -1 {
// Entire input is non string, comment, regexp tokens.
c.jsCtx = nextJSCtx(s, c.jsCtx)
@@ -274,6 +275,8 @@ func tJS(c context, s []byte) (context, int) {
c.state, c.jsCtx = stateJSDqStr, jsCtxRegexp
case '\'':
c.state, c.jsCtx = stateJSSqStr, jsCtxRegexp
+ case '`':
+ c.state, c.jsCtx = stateJSBqStr, jsCtxRegexp
case '/':
switch {
case i+1 < len(s) && s[i+1] == '/':
@@ -303,6 +306,8 @@ func tJSDelimited(c context, s []byte) (context, int) {
switch c.state {
case stateJSSqStr:
specials = `\'`
+ case stateJSBqStr:
+ specials = "`\\"
case stateJSRegexp:
specials = `\/[]`
}
--
2.7.4

View File

@@ -0,0 +1,60 @@
From 8673ca81e5340b87709db2d9749c92a3bf925df1 Mon Sep 17 00:00:00 2001
From: Roland Shoemaker <bracewell@google.com>
Date: Thu, 13 Apr 2023 15:40:44 -0700
Subject: [PATCH] html/template: disallow angle brackets in CSS values
Angle brackets should not appear in CSS contexts, as they may affect
token boundaries (such as closing a <style> tag, resulting in
injection). Instead emit filterFailsafe, matching the behavior for other
dangerous characters.
Thanks to Juho Nurminen of Mattermost for reporting this issue.
Fixes #59720
Fixes CVE-2023-24539
Change-Id: Iccc659c9a18415992b0c05c178792228e3a7bae4
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1826636
Reviewed-by: Julie Qiu <julieqiu@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/491615
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Upstream-Status: Backport from [https://github.com/golang/go/commit/8673ca81e5340b87709db2d9749c92a3bf925df1]
CVE: CVE-2023-24539
Signed-off-by: Ashish Sharma <asharma@mvista.com>
---
src/html/template/css.go | 2 +-
src/html/template/css_test.go | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/html/template/css.go b/src/html/template/css.go
index 890a0c6b227fe..f650d8b3e843a 100644
--- a/src/html/template/css.go
+++ b/src/html/template/css.go
@@ -238,7 +238,7 @@ func cssValueFilter(args ...any) string {
// inside a string that might embed JavaScript source.
for i, c := range b {
switch c {
- case 0, '"', '\'', '(', ')', '/', ';', '@', '[', '\\', ']', '`', '{', '}':
+ case 0, '"', '\'', '(', ')', '/', ';', '@', '[', '\\', ']', '`', '{', '}', '<', '>':
return filterFailsafe
case '-':
// Disallow <!-- or -->.
diff --git a/src/html/template/css_test.go b/src/html/template/css_test.go
index a735638b0314f..2b76256a766e9 100644
--- a/src/html/template/css_test.go
+++ b/src/html/template/css_test.go
@@ -231,6 +231,8 @@ func TestCSSValueFilter(t *testing.T) {
{`-exp\000052 ession(alert(1337))`, "ZgotmplZ"},
{`-expre\0000073sion`, "-expre\x073sion"},
{`@import url evil.css`, "ZgotmplZ"},
+ {"<", "ZgotmplZ"},
+ {">", "ZgotmplZ"},
}
for _, test := range tests {
got := cssValueFilter(test.css)

View File

@@ -0,0 +1,90 @@
From ce7bd33345416e6d8cac901792060591cafc2797 Mon Sep 17 00:00:00 2001
From: Roland Shoemaker <bracewell@google.com>
Date: Tue, 11 Apr 2023 16:27:43 +0100
Subject: [PATCH] [release-branch.go1.19] html/template: handle all JS
whitespace characters
Rather than just a small set. Character class as defined by \s [0].
Thanks to Juho Nurminen of Mattermost for reporting this.
For #59721
Fixes #59813
Fixes CVE-2023-24540
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes
Change-Id: I56d4fa1ef08125b417106ee7dbfb5b0923b901ba
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1821459
Reviewed-by: Julie Qiu <julieqiu@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1851497
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/491355
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Bypass: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Upstream-Status: Backport [https://github.com/golang/go/commit/ce7bd33345416e6d8cac901792060591cafc2797]
CVE: CVE-2023-24540
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
src/html/template/js.go | 8 +++++++-
src/html/template/js_test.go | 11 +++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/html/template/js.go b/src/html/template/js.go
index fe7054efe5cd8..4e05c1455723f 100644
--- a/src/html/template/js.go
+++ b/src/html/template/js.go
@@ -13,6 +13,11 @@ import (
"unicode/utf8"
)
+// jsWhitespace contains all of the JS whitespace characters, as defined
+// by the \s character class.
+// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Character_classes.
+const jsWhitespace = "\f\n\r\t\v\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff"
+
// nextJSCtx returns the context that determines whether a slash after the
// given run of tokens starts a regular expression instead of a division
// operator: / or /=.
@@ -26,7 +31,8 @@ import (
// JavaScript 2.0 lexical grammar and requires one token of lookbehind:
// https://www.mozilla.org/js/language/js20-2000-07/rationale/syntax.html
func nextJSCtx(s []byte, preceding jsCtx) jsCtx {
- s = bytes.TrimRight(s, "\t\n\f\r \u2028\u2029")
+ // Trim all JS whitespace characters
+ s = bytes.TrimRight(s, jsWhitespace)
if len(s) == 0 {
return preceding
}
diff --git a/src/html/template/js_test.go b/src/html/template/js_test.go
index e07c695f7a77d..e52180cc113b5 100644
--- a/src/html/template/js_test.go
+++ b/src/html/template/js_test.go
@@ -81,14 +81,17 @@ func TestNextJsCtx(t *testing.T) {
{jsCtxDivOp, "0"},
// Dots that are part of a number are div preceders.
{jsCtxDivOp, "0."},
+ // Some JS interpreters treat NBSP as a normal space, so
+ // we must too in order to properly escape things.
+ {jsCtxRegexp, "=\u00A0"},
}
for _, test := range tests {
- if nextJSCtx([]byte(test.s), jsCtxRegexp) != test.jsCtx {
- t.Errorf("want %s got %q", test.jsCtx, test.s)
+ if ctx := nextJSCtx([]byte(test.s), jsCtxRegexp); ctx != test.jsCtx {
+ t.Errorf("%q: want %s got %s", test.s, test.jsCtx, ctx)
}
- if nextJSCtx([]byte(test.s), jsCtxDivOp) != test.jsCtx {
- t.Errorf("want %s got %q", test.jsCtx, test.s)
+ if ctx := nextJSCtx([]byte(test.s), jsCtxDivOp); ctx != test.jsCtx {
+ t.Errorf("%q: want %s got %s", test.s, test.jsCtx, ctx)
}
}

View File

@@ -112,10 +112,31 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://CVE-2022-0216-1.patch \
file://CVE-2022-0216-2.patch \
file://CVE-2021-3750.patch \
file://CVE-2021-3638.patch \
file://CVE-2021-20196.patch \
file://CVE-2021-3507.patch \
file://CVE-2021-3929.patch \
file://CVE-2021-3638.patch \
file://CVE-2021-20196.patch \
file://CVE-2021-3507.patch \
file://hw-block-nvme-refactor-nvme_addr_read.patch \
file://hw-block-nvme-handle-dma-errors.patch \
file://CVE-2021-3929.patch \
file://CVE-2022-4144.patch \
file://CVE-2020-15859.patch \
file://CVE-2020-15469-1.patch \
file://CVE-2020-15469-2.patch \
file://CVE-2020-15469-3.patch \
file://CVE-2020-15469-4.patch \
file://CVE-2020-15469-5.patch \
file://CVE-2020-15469-6.patch \
file://CVE-2020-15469-7.patch \
file://CVE-2020-15469-8.patch \
file://CVE-2020-35504.patch \
file://CVE-2020-35505.patch \
file://CVE-2022-26354.patch \
file://CVE-2021-3409-1.patch \
file://CVE-2021-3409-2.patch \
file://CVE-2021-3409-3.patch \
file://CVE-2021-3409-4.patch \
file://CVE-2021-3409-5.patch \
file://hw-display-qxl-Pass-requested-buffer-size-to-qxl_phy.patch \
"
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
@@ -136,6 +157,11 @@ CVE_CHECK_WHITELIST += "CVE-2018-18438"
# the issue introduced in v5.1.0-rc0
CVE_CHECK_WHITELIST += "CVE-2020-27661"
# As per https://nvd.nist.gov/vuln/detail/CVE-2023-0664
# https://bugzilla.redhat.com/show_bug.cgi?id=2167423
# this bug related to windows specific.
CVE_CHECK_WHITELIST += "CVE-2023-0664"
COMPATIBLE_HOST_mipsarchn32 = "null"
COMPATIBLE_HOST_mipsarchn64 = "null"

View File

@@ -0,0 +1,50 @@
From 520f26fc6d17b71a43eaf620e834b3bdf316f3d3 Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:25 +0530
Subject: [PATCH] hw/pci-host: add pci-intack write method
Add pci-intack mmio write method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20200811114133.672647-2-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu
https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-1.patch?h=ubuntu/focal-security
Upstream commit https://github.com/qemu/qemu/commit/520f26fc6d17b71a43eaf620e834b3bdf316f3d3 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/pci-host/prep.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -26,6 +26,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/units.h"
+#include "qemu/log.h"
#include "qapi/error.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
@@ -119,8 +120,15 @@ static uint64_t raven_intack_read(void *
return pic_read_irq(isa_pic);
}
+static void raven_intack_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+}
+
static const MemoryRegionOps raven_intack_ops = {
.read = raven_intack_read,
+ .write = raven_intack_write,
.valid = {
.max_access_size = 1,
},

View File

@@ -0,0 +1,69 @@
From 4f2a5202a05fc1612954804a2482f07bff105ea2 Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:26 +0530
Subject: [PATCH] pci-host: designware: add pcie-msi read method
Add pcie-msi mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20200811114133.672647-3-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-2.patch?h=ubuntu/focal-security Upstream Commit https://github.com/qemu/qemu/commit/4f2a5202a05fc1612954804a2482f07bff105ea2]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/pci-host/designware.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index f9fb97a..bde3a34 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/module.h"
+#include "qemu/log.h"
#include "hw/pci/msi.h"
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pci_host.h"
@@ -63,6 +64,23 @@ designware_pcie_root_to_host(DesignwarePCIERoot *root)
return DESIGNWARE_PCIE_HOST(bus->parent);
}
+static uint64_t designware_pcie_root_msi_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ /*
+ * Attempts to read from the MSI address are undefined in
+ * the PCI specifications. For this hardware, the datasheet
+ * specifies that a read from the magic address is simply not
+ * intercepted by the MSI controller, and will go out to the
+ * AHB/AXI bus like any other PCI-device-initiated DMA read.
+ * This is not trivial to implement in QEMU, so since
+ * well-behaved guests won't ever ask a PCI device to DMA from
+ * this address we just log the missing functionality.
+ */
+ qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+ return 0;
+}
+
static void designware_pcie_root_msi_write(void *opaque, hwaddr addr,
uint64_t val, unsigned len)
{
@@ -77,6 +95,7 @@ static void designware_pcie_root_msi_write(void *opaque, hwaddr addr,
}
static const MemoryRegionOps designware_pci_host_msi_ops = {
+ .read = designware_pcie_root_msi_read,
.write = designware_pcie_root_msi_write,
.endianness = DEVICE_LITTLE_ENDIAN,
.valid = {
--
1.8.3.1

View File

@@ -0,0 +1,49 @@
From 24202d2b561c3b4c48bd28383c8c34b4ac66c2bf Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:27 +0530
Subject: [PATCH] vfio: add quirk device write method
Add vfio quirk device mmio write method to avoid NULL pointer
dereference issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20200811114133.672647-4-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-3.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/24202d2b561c3b4c48bd28383c8c34b4ac66c2bf]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/vfio/pci-quirks.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -13,6 +13,7 @@
#include "qemu/osdep.h"
#include "exec/memop.h"
#include "qemu/units.h"
+#include "qemu/log.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
@@ -278,8 +279,15 @@ static uint64_t vfio_ati_3c3_quirk_read(
return data;
}
+static void vfio_ati_3c3_quirk_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
+}
+
static const MemoryRegionOps vfio_ati_3c3_quirk = {
.read = vfio_ati_3c3_quirk_read,
+ .write = vfio_ati_3c3_quirk_write,
.endianness = DEVICE_LITTLE_ENDIAN,
};

View File

@@ -0,0 +1,53 @@
From f867cebaedbc9c43189f102e4cdfdff05e88df7f Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:28 +0530
Subject: [PATCH] prep: add ppc-parity write method
Add ppc-parity mmio write method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200811114133.672647-5-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-4.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/f867cebaedbc9c43189f102e4cdfdff05e88df7f]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/ppc/prep_systemio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c
index 4e48ef2..b2bd783 100644
--- a/hw/ppc/prep_systemio.c
+++ b/hw/ppc/prep_systemio.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/log.h"
#include "hw/irq.h"
#include "hw/isa/isa.h"
#include "hw/qdev-properties.h"
@@ -235,8 +236,15 @@ static uint64_t ppc_parity_error_readl(void *opaque, hwaddr addr,
return val;
}
+static void ppc_parity_error_writel(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
+}
+
static const MemoryRegionOps ppc_parity_error_ops = {
.read = ppc_parity_error_readl,
+ .write = ppc_parity_error_writel,
.valid = {
.min_access_size = 4,
.max_access_size = 4,
--
1.8.3.1

View File

@@ -0,0 +1,53 @@
From b5bf601f364e1a14ca4c3276f88dfec024acf613 Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:29 +0530
Subject: [PATCH] nvram: add nrf51_soc flash read method
Add nrf51_soc mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200811114133.672647-6-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-5.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/b5bf601f364e1a14ca4c3276f88dfec024acf613 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/nvram/nrf51_nvm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c
index f2283c1..7b3460d 100644
--- a/hw/nvram/nrf51_nvm.c
+++ b/hw/nvram/nrf51_nvm.c
@@ -273,6 +273,15 @@ static const MemoryRegionOps io_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
+static uint64_t flash_read(void *opaque, hwaddr offset, unsigned size)
+{
+ /*
+ * This is a rom_device MemoryRegion which is always in
+ * romd_mode (we never put it in MMIO mode), so reads always
+ * go directly to RAM and never come here.
+ */
+ g_assert_not_reached();
+}
static void flash_write(void *opaque, hwaddr offset, uint64_t value,
unsigned int size)
@@ -300,6 +309,7 @@ static void flash_write(void *opaque, hwaddr offset, uint64_t value,
static const MemoryRegionOps flash_ops = {
+ .read = flash_read,
.write = flash_write,
.valid.min_access_size = 4,
.valid.max_access_size = 4,
--
1.8.3.1

View File

@@ -0,0 +1,61 @@
Backport of:
From 921604e175b8ec06c39503310e7b3ec1e3eafe9e Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:30 +0530
Subject: [PATCH] spapr_pci: add spapr msi read method
Add spapr msi mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20200811114133.672647-7-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-6.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/921604e175b8ec06c39503310e7b3ec1e3eafe9e]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/ppc/spapr_pci.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -52,6 +52,7 @@
#include "sysemu/kvm.h"
#include "sysemu/hostmem.h"
#include "sysemu/numa.h"
+#include "qemu/log.h"
/* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */
#define RTAS_QUERY_FN 0
@@ -738,6 +739,12 @@ static PCIINTxRoute spapr_route_intx_pin
return route;
}
+static uint64_t spapr_msi_read(void *opaque, hwaddr addr, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
+ return 0;
+}
+
/*
* MSI/MSIX memory region implementation.
* The handler handles both MSI and MSIX.
@@ -755,8 +762,11 @@ static void spapr_msi_write(void *opaque
}
static const MemoryRegionOps spapr_msi_ops = {
- /* There is no .read as the read result is undefined by PCI spec */
- .read = NULL,
+ /*
+ * .read result is undefined by PCI spec.
+ * define .read method to avoid assert failure in memory_region_init_io
+ */
+ .read = spapr_msi_read,
.write = spapr_msi_write,
.endianness = DEVICE_LITTLE_ENDIAN
};

View File

@@ -0,0 +1,50 @@
From 2c9fb3b784000c1df32231e1c2464bb2e3fc4620 Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:31 +0530
Subject: [PATCH] tz-ppc: add dummy read/write methods
Add tz-ppc-dummy mmio read/write methods to avoid assert failure
during initialisation.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200811114133.672647-8-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-7.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/2c9fb3b784000c1df32231e1c2464bb2e3fc4620 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/misc/tz-ppc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
index 6431257..36495c6 100644
--- a/hw/misc/tz-ppc.c
+++ b/hw/misc/tz-ppc.c
@@ -196,7 +196,21 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr,
g_assert_not_reached();
}
+static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
+{
+ g_assert_not_reached();
+}
+
+static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ g_assert_not_reached();
+}
+
static const MemoryRegionOps tz_ppc_dummy_ops = {
+ /* define r/w methods to avoid assert failure in memory_region_init_io */
+ .read = tz_ppc_dummy_read,
+ .write = tz_ppc_dummy_write,
.valid.accepts = tz_ppc_dummy_accepts,
};
--
1.8.3.1

View File

@@ -0,0 +1,44 @@
From 735754aaa15a6ed46db51fd731e88331c446ea54 Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Tue, 11 Aug 2020 17:11:32 +0530
Subject: [PATCH] imx7-ccm: add digprog mmio write method
Add digprog mmio write method to avoid assert failure during
initialisation.
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20200811114133.672647-9-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
CVE: CVE-2020-15469
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-15469-8.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/735754aaa15a6ed46db51fd731e88331c446ea54]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/misc/imx7_ccm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/misc/imx7_ccm.c b/hw/misc/imx7_ccm.c
index 02fc1ae..075159e 100644
--- a/hw/misc/imx7_ccm.c
+++ b/hw/misc/imx7_ccm.c
@@ -131,8 +131,16 @@ static const struct MemoryRegionOps imx7_set_clr_tog_ops = {
},
};
+static void imx7_digprog_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "Guest write to read-only ANALOG_DIGPROG register\n");
+}
+
static const struct MemoryRegionOps imx7_digprog_ops = {
.read = imx7_set_clr_tog_read,
+ .write = imx7_digprog_write,
.endianness = DEVICE_NATIVE_ENDIAN,
.impl = {
.min_access_size = 4,
--
1.8.3.1

View File

@@ -0,0 +1,39 @@
From 22dc8663d9fc7baa22100544c600b6285a63c7a3 Mon Sep 17 00:00:00 2001
From: Jason Wang <jasowang@redhat.com>
Date: Wed, 22 Jul 2020 16:57:46 +0800
Subject: [PATCH] net: forbid the reentrant RX
The memory API allows DMA into NIC's MMIO area. This means the NIC's
RX routine must be reentrant. Instead of auditing all the NIC, we can
simply detect the reentrancy and return early. The queue->delivering
is set and cleared by qemu_net_queue_deliver() for other queue helpers
to know whether the delivering in on going (NIC's receive is being
called). We can check it and return early in qemu_net_queue_flush() to
forbid reentrant RX.
Signed-off-by: Jason Wang <jasowang@redhat.com>
CVE: CVE-2020-15859
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/ubuntu/CVE-2020-15859.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/22dc8663d9fc7baa22100544c600b6285a63c7a3 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
net/queue.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/queue.c b/net/queue.c
index 0164727..19e32c8 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -250,6 +250,9 @@ void qemu_net_queue_purge(NetQueue *queue, NetClientState *from)
bool qemu_net_queue_flush(NetQueue *queue)
{
+ if (queue->delivering)
+ return false;
+
while (!QTAILQ_EMPTY(&queue->packets)) {
NetPacket *packet;
int ret;
--
1.8.3.1

View File

@@ -0,0 +1,51 @@
Backport of:
From 0db895361b8a82e1114372ff9f4857abea605701 Mon Sep 17 00:00:00 2001
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Date: Wed, 7 Apr 2021 20:57:50 +0100
Subject: [PATCH] esp: always check current_req is not NULL before use in DMA
callbacks
After issuing a SCSI command the SCSI layer can call the SCSIBusInfo .cancel
callback which resets both current_req and current_dev to NULL. If any data
is left in the transfer buffer (async_len != 0) then the next TI (Transfer
Information) command will attempt to reference the NULL pointer causing a
segfault.
Buglink: https://bugs.launchpad.net/qemu/+bug/1910723
Buglink: https://bugs.launchpad.net/qemu/+bug/1909247
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20210407195801.685-2-mark.cave-ayland@ilande.co.uk>
CVE: CVE-2020-35504
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-35504.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/0db895361b8a82e1114372ff9f4857abea605701 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/scsi/esp.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -362,6 +362,11 @@ static void do_dma_pdma_cb(ESPState *s)
do_cmd(s, s->cmdbuf);
return;
}
+
+ if (!s->current_req) {
+ return;
+ }
+
s->dma_left -= len;
s->async_buf += len;
s->async_len -= len;
@@ -415,6 +420,9 @@ static void esp_do_dma(ESPState *s)
do_cmd(s, s->cmdbuf);
return;
}
+ if (!s->current_req) {
+ return;
+ }
if (s->async_len == 0) {
/* Defer until data is available. */
return;

View File

@@ -0,0 +1,42 @@
Backport of:
From 99545751734035b76bd372c4e7215bb337428d89 Mon Sep 17 00:00:00 2001
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Date: Wed, 7 Apr 2021 20:57:55 +0100
Subject: [PATCH] esp: ensure cmdfifo is not empty and current_dev is non-NULL
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
When about to execute a SCSI command, ensure that cmdfifo is not empty and
current_dev is non-NULL. This can happen if the guest tries to execute a TI
(Transfer Information) command without issuing one of the select commands
first.
Buglink: https://bugs.launchpad.net/qemu/+bug/1910723
Buglink: https://bugs.launchpad.net/qemu/+bug/1909247
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20210407195801.685-7-mark.cave-ayland@ilande.co.uk>
CVE: CVE-2020-35504
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2020-35505.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/99545751734035b76bd372c4e7215bb337428d89 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/scsi/esp.c | 3 +++
1 file changed, 3 insertions(+)
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -193,6 +193,10 @@ static void do_busid_cmd(ESPState *s, ui
trace_esp_do_busid_cmd(busid);
lun = busid & 7;
+
+ if (!s->current_dev) {
+ return;
+ }
current_lun = scsi_device_find(&s->bus, 0, s->current_dev->id, lun);
s->current_req = scsi_req_new(current_lun, 0, lun, buf, s);
datalen = scsi_req_enqueue(s->current_req);

View File

@@ -0,0 +1,85 @@
From b263d8f928001b5cfa2a993ea43b7a5b3a1811e8 Mon Sep 17 00:00:00 2001
From: Bin Meng <bmeng.cn@gmail.com>
Date: Wed, 3 Mar 2021 20:26:35 +0800
Subject: [PATCH] hw/sd: sdhci: Don't transfer any data when command time out
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
At the end of sdhci_send_command(), it starts a data transfer if the
command register indicates data is associated. But the data transfer
should only be initiated when the command execution has succeeded.
With this fix, the following reproducer:
outl 0xcf8 0x80001810
outl 0xcfc 0xe1068000
outl 0xcf8 0x80001804
outw 0xcfc 0x7
write 0xe106802c 0x1 0x0f
write 0xe1068004 0xc 0x2801d10101fffffbff28a384
write 0xe106800c 0x1f 0x9dacbbcad9e8f7061524334251606f7e8d9cabbac9d8e7f60514233241505f
write 0xe1068003 0x28 0x80d000251480d000252280d000253080d000253e80d000254c80d000255a80d000256880d0002576
write 0xe1068003 0x1 0xfe
cannot be reproduced with the following QEMU command line:
$ qemu-system-x86_64 -nographic -M pc-q35-5.0 \
-device sdhci-pci,sd-spec-version=3 \
-drive if=sd,index=0,file=null-co://,format=raw,id=mydrive \
-device sd-card,drive=mydrive \
-monitor none -serial none -qtest stdio
Cc: qemu-stable@nongnu.org
Fixes: CVE-2020-17380
Fixes: CVE-2020-25085
Fixes: CVE-2021-3409
Fixes: d7dfca0807a0 ("hw/sdhci: introduce standard SD host controller")
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Reported-by: Cornelius Aschermann (Ruhr-Universität Bochum)
Reported-by: Sergej Schumilo (Ruhr-Universität Bochum)
Reported-by: Simon Wörner (Ruhr-Universität Bochum)
Buglink: https://bugs.launchpad.net/qemu/+bug/1892960
Buglink: https://bugs.launchpad.net/qemu/+bug/1909418
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1928146
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210303122639.20004-2-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
CVE: CVE-2021-3409 CVE-2020-17380
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2021-3409-1.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/b263d8f928001b5cfa2a993ea43b7a5b3a1811e8 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/sd/sdhci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -316,6 +316,7 @@ static void sdhci_send_command(SDHCIStat
SDRequest request;
uint8_t response[16];
int rlen;
+ bool timeout = false;
s->errintsts = 0;
s->acmd12errsts = 0;
@@ -339,6 +340,7 @@ static void sdhci_send_command(SDHCIStat
trace_sdhci_response16(s->rspreg[3], s->rspreg[2],
s->rspreg[1], s->rspreg[0]);
} else {
+ timeout = true;
trace_sdhci_error("timeout waiting for command response");
if (s->errintstsen & SDHC_EISEN_CMDTIMEOUT) {
s->errintsts |= SDHC_EIS_CMDTIMEOUT;
@@ -359,7 +361,7 @@ static void sdhci_send_command(SDHCIStat
sdhci_update_irq(s);
- if (s->blksize && (s->cmdreg & SDHC_CMD_DATA_PRESENT)) {
+ if (!timeout && s->blksize && (s->cmdreg & SDHC_CMD_DATA_PRESENT)) {
s->data_count = 0;
sdhci_data_transfer(s);
}

View File

@@ -0,0 +1,103 @@
From 8be45cc947832b3c02144c9d52921f499f2d77fe Mon Sep 17 00:00:00 2001
From: Bin Meng <bmeng.cn@gmail.com>
Date: Wed, 3 Mar 2021 20:26:36 +0800
Subject: [PATCH] hw/sd: sdhci: Don't write to SDHC_SYSAD register when
transfer is in progress
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Per "SD Host Controller Standard Specification Version 7.00"
chapter 2.2.1 SDMA System Address Register:
This register can be accessed only if no transaction is executing
(i.e., after a transaction has stopped).
With this fix, the following reproducer:
outl 0xcf8 0x80001010
outl 0xcfc 0xfbefff00
outl 0xcf8 0x80001001
outl 0xcfc 0x06000000
write 0xfbefff2c 0x1 0x05
write 0xfbefff0f 0x1 0x37
write 0xfbefff0a 0x1 0x01
write 0xfbefff0f 0x1 0x29
write 0xfbefff0f 0x1 0x02
write 0xfbefff0f 0x1 0x03
write 0xfbefff04 0x1 0x01
write 0xfbefff05 0x1 0x01
write 0xfbefff07 0x1 0x02
write 0xfbefff0c 0x1 0x33
write 0xfbefff0e 0x1 0x20
write 0xfbefff0f 0x1 0x00
write 0xfbefff2a 0x1 0x01
write 0xfbefff0c 0x1 0x00
write 0xfbefff03 0x1 0x00
write 0xfbefff05 0x1 0x00
write 0xfbefff2a 0x1 0x02
write 0xfbefff0c 0x1 0x32
write 0xfbefff01 0x1 0x01
write 0xfbefff02 0x1 0x01
write 0xfbefff03 0x1 0x01
cannot be reproduced with the following QEMU command line:
$ qemu-system-x86_64 -nographic -machine accel=qtest -m 512M \
-nodefaults -device sdhci-pci,sd-spec-version=3 \
-drive if=sd,index=0,file=null-co://,format=raw,id=mydrive \
-device sd-card,drive=mydrive -qtest stdio
Cc: qemu-stable@nongnu.org
Fixes: CVE-2020-17380
Fixes: CVE-2020-25085
Fixes: CVE-2021-3409
Fixes: d7dfca0807a0 ("hw/sdhci: introduce standard SD host controller")
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Reported-by: Cornelius Aschermann (Ruhr-Universität Bochum)
Reported-by: Sergej Schumilo (Ruhr-Universität Bochum)
Reported-by: Simon Wörner (Ruhr-Universität Bochum)
Buglink: https://bugs.launchpad.net/qemu/+bug/1892960
Buglink: https://bugs.launchpad.net/qemu/+bug/1909418
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1928146
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210303122639.20004-3-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
CVE: CVE-2021-3409 CVE-2020-17380
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2021-3409-2.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/8be45cc947832b3c02144c9d52921f499f2d77fe ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/sd/sdhci.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1117,15 +1117,17 @@ sdhci_write(void *opaque, hwaddr offset,
switch (offset & ~0x3) {
case SDHC_SYSAD:
- s->sdmasysad = (s->sdmasysad & mask) | value;
- MASKED_WRITE(s->sdmasysad, mask, value);
- /* Writing to last byte of sdmasysad might trigger transfer */
- if (!(mask & 0xFF000000) && TRANSFERRING_DATA(s->prnsts) && s->blkcnt &&
- s->blksize && SDHC_DMA_TYPE(s->hostctl1) == SDHC_CTRL_SDMA) {
- if (s->trnmod & SDHC_TRNS_MULTI) {
- sdhci_sdma_transfer_multi_blocks(s);
- } else {
- sdhci_sdma_transfer_single_block(s);
+ if (!TRANSFERRING_DATA(s->prnsts)) {
+ s->sdmasysad = (s->sdmasysad & mask) | value;
+ MASKED_WRITE(s->sdmasysad, mask, value);
+ /* Writing to last byte of sdmasysad might trigger transfer */
+ if (!(mask & 0xFF000000) && s->blkcnt && s->blksize &&
+ SDHC_DMA_TYPE(s->hostctl1) == SDHC_CTRL_SDMA) {
+ if (s->trnmod & SDHC_TRNS_MULTI) {
+ sdhci_sdma_transfer_multi_blocks(s);
+ } else {
+ sdhci_sdma_transfer_single_block(s);
+ }
}
}
break;

View File

@@ -0,0 +1,71 @@
Backport of:
From bc6f28995ff88f5d82c38afcfd65406f0ae375aa Mon Sep 17 00:00:00 2001
From: Bin Meng <bmeng.cn@gmail.com>
Date: Wed, 3 Mar 2021 20:26:37 +0800
Subject: [PATCH] hw/sd: sdhci: Correctly set the controller status for ADMA
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
When an ADMA transfer is started, the codes forget to set the
controller status to indicate a transfer is in progress.
With this fix, the following 2 reproducers:
https://paste.debian.net/plain/1185136
https://paste.debian.net/plain/1185141
cannot be reproduced with the following QEMU command line:
$ qemu-system-x86_64 -nographic -machine accel=qtest -m 512M \
-nodefaults -device sdhci-pci,sd-spec-version=3 \
-drive if=sd,index=0,file=null-co://,format=raw,id=mydrive \
-device sd-card,drive=mydrive -qtest stdio
Cc: qemu-stable@nongnu.org
Fixes: CVE-2020-17380
Fixes: CVE-2020-25085
Fixes: CVE-2021-3409
Fixes: d7dfca0807a0 ("hw/sdhci: introduce standard SD host controller")
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Reported-by: Cornelius Aschermann (Ruhr-Universität Bochum)
Reported-by: Sergej Schumilo (Ruhr-Universität Bochum)
Reported-by: Simon Wörner (Ruhr-Universität Bochum)
Buglink: https://bugs.launchpad.net/qemu/+bug/1892960
Buglink: https://bugs.launchpad.net/qemu/+bug/1909418
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1928146
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210303122639.20004-4-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
CVE: CVE-2021-3409 CVE-2020-17380
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2021-3409-3.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/bc6f28995ff88f5d82c38afcfd65406f0ae375aa ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/sd/sdhci.c | 3 +++
1 file changed, 3 insertions(+)
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -776,8 +776,9 @@ static void sdhci_do_adma(SDHCIState *s)
switch (dscr.attr & SDHC_ADMA_ATTR_ACT_MASK) {
case SDHC_ADMA_ATTR_ACT_TRAN: /* data transfer */
-
+ s->prnsts |= SDHC_DATA_INHIBIT | SDHC_DAT_LINE_ACTIVE;
if (s->trnmod & SDHC_TRNS_READ) {
+ s->prnsts |= SDHC_DOING_READ;
while (length) {
if (s->data_count == 0) {
for (n = 0; n < block_size; n++) {
@@ -807,6 +808,7 @@ static void sdhci_do_adma(SDHCIState *s)
}
}
} else {
+ s->prnsts |= SDHC_DOING_WRITE;
while (length) {
begin = s->data_count;
if ((length + begin) < block_size) {

View File

@@ -0,0 +1,52 @@
Backport of:
From 5cd7aa3451b76bb19c0f6adc2b931f091e5d7fcd Mon Sep 17 00:00:00 2001
From: Bin Meng <bmeng.cn@gmail.com>
Date: Wed, 3 Mar 2021 20:26:38 +0800
Subject: [PATCH] hw/sd: sdhci: Limit block size only when SDHC_BLKSIZE
register is writable
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
The codes to limit the maximum block size is only necessary when
SDHC_BLKSIZE register is writable.
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210303122639.20004-5-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
CVE: CVE-2021-3409 CVE-2020-17380
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2021-3409-4.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/5cd7aa3451b76bb19c0f6adc2b931f091e5d7fcd ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/sd/sdhci.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1137,15 +1137,15 @@ sdhci_write(void *opaque, hwaddr offset,
if (!TRANSFERRING_DATA(s->prnsts)) {
MASKED_WRITE(s->blksize, mask, extract32(value, 0, 12));
MASKED_WRITE(s->blkcnt, mask >> 16, value >> 16);
- }
- /* Limit block size to the maximum buffer size */
- if (extract32(s->blksize, 0, 12) > s->buf_maxsz) {
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than " \
- "the maximum buffer 0x%x", __func__, s->blksize,
- s->buf_maxsz);
+ /* Limit block size to the maximum buffer size */
+ if (extract32(s->blksize, 0, 12) > s->buf_maxsz) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than "
+ "the maximum buffer 0x%x\n", __func__, s->blksize,
+ s->buf_maxsz);
- s->blksize = deposit32(s->blksize, 0, 12, s->buf_maxsz);
+ s->blksize = deposit32(s->blksize, 0, 12, s->buf_maxsz);
+ }
}
break;

View File

@@ -0,0 +1,93 @@
From cffb446e8fd19a14e1634c7a3a8b07be3f01d5c9 Mon Sep 17 00:00:00 2001
From: Bin Meng <bmeng.cn@gmail.com>
Date: Wed, 3 Mar 2021 20:26:39 +0800
Subject: [PATCH] hw/sd: sdhci: Reset the data pointer of s->fifo_buffer[] when
a different block size is programmed
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
If the block size is programmed to a different value from the
previous one, reset the data pointer of s->fifo_buffer[] so that
s->fifo_buffer[] can be filled in using the new block size in
the next transfer.
With this fix, the following reproducer:
outl 0xcf8 0x80001010
outl 0xcfc 0xe0000000
outl 0xcf8 0x80001001
outl 0xcfc 0x06000000
write 0xe000002c 0x1 0x05
write 0xe0000005 0x1 0x02
write 0xe0000007 0x1 0x01
write 0xe0000028 0x1 0x10
write 0x0 0x1 0x23
write 0x2 0x1 0x08
write 0xe000000c 0x1 0x01
write 0xe000000e 0x1 0x20
write 0xe000000f 0x1 0x00
write 0xe000000c 0x1 0x32
write 0xe0000004 0x2 0x0200
write 0xe0000028 0x1 0x00
write 0xe0000003 0x1 0x40
cannot be reproduced with the following QEMU command line:
$ qemu-system-x86_64 -nographic -machine accel=qtest -m 512M \
-nodefaults -device sdhci-pci,sd-spec-version=3 \
-drive if=sd,index=0,file=null-co://,format=raw,id=mydrive \
-device sd-card,drive=mydrive -qtest stdio
Cc: qemu-stable@nongnu.org
Fixes: CVE-2020-17380
Fixes: CVE-2020-25085
Fixes: CVE-2021-3409
Fixes: d7dfca0807a0 ("hw/sdhci: introduce standard SD host controller")
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Reported-by: Cornelius Aschermann (Ruhr-Universität Bochum)
Reported-by: Sergej Schumilo (Ruhr-Universität Bochum)
Reported-by: Simon Wörner (Ruhr-Universität Bochum)
Buglink: https://bugs.launchpad.net/qemu/+bug/1892960
Buglink: https://bugs.launchpad.net/qemu/+bug/1909418
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1928146
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210303122639.20004-6-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
CVE: CVE-2021-3409 CVE-2020-17380
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2021-3409-5.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/cffb446e8fd19a14e1634c7a3a8b07be3f01d5c9 ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/sd/sdhci.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1135,6 +1135,8 @@ sdhci_write(void *opaque, hwaddr offset,
break;
case SDHC_BLKSIZE:
if (!TRANSFERRING_DATA(s->prnsts)) {
+ uint16_t blksize = s->blksize;
+
MASKED_WRITE(s->blksize, mask, extract32(value, 0, 12));
MASKED_WRITE(s->blkcnt, mask >> 16, value >> 16);
@@ -1146,6 +1148,16 @@ sdhci_write(void *opaque, hwaddr offset,
s->blksize = deposit32(s->blksize, 0, 12, s->buf_maxsz);
}
+
+ /*
+ * If the block size is programmed to a different value from
+ * the previous one, reset the data pointer of s->fifo_buffer[]
+ * so that s->fifo_buffer[] can be filled in using the new block
+ * size in the next transfer.
+ */
+ if (blksize != s->blksize) {
+ s->data_count = 0;
+ }
}
break;

View File

@@ -1,7 +1,8 @@
From 736b01642d85be832385063f278fe7cd4ffb5221 Mon Sep 17 00:00:00 2001
From: Klaus Jensen <k.jensen@samsung.com>
Date: Fri, 17 Dec 2021 10:44:01 +0100
Subject: [PATCH] hw/nvme: fix CVE-2021-3929
From 2c682b5975b41495f98cc34b8243042c446eec44 Mon Sep 17 00:00:00 2001
From: Gaurav Gupta <gauragup@cisco.com>
Date: Wed, 29 Mar 2023 14:36:16 -0700
Subject: [PATCH] hw/nvme: fix CVE-2021-3929 MIME-Version: 1.0 Content-Type:
text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -17,21 +18,23 @@ Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/736b01642d85be832385]
Upstream-Status: Backport
[https://gitlab.com/qemu-project/qemu/-/commit/736b01642d85be832385]
CVE: CVE-2021-3929
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
---
hw/block/nvme.c | 23 +++++++++++++++++++++++
hw/block/nvme.h | 1 +
2 files changed, 24 insertions(+)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 12d82542..e7d0750c 100644
index bda446d..ae9b19f 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -52,8 +52,31 @@
static void nvme_process_sq(void *opaque);
@@ -60,8 +60,31 @@ static bool nvme_addr_is_cmb(NvmeCtrl *n, hwaddr addr)
return addr >= low && addr < hi;
}
+static inline bool nvme_addr_is_iomem(NvmeCtrl *n, hwaddr addr)
+{
@@ -51,18 +54,18 @@ index 12d82542..e7d0750c 100644
+ return addr >= lo && addr < hi;
+}
+
static void nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
static int nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
{
+
+ if (nvme_addr_is_iomem(n, addr)) {
+ return NVME_DATA_TRAS_ERROR;
+ return NVME_DATA_TRAS_ERROR;
+ }
+
if (n->cmbsz && addr >= n->ctrl_mem.addr &&
addr < (n->ctrl_mem.addr + int128_get64(n->ctrl_mem.size))) {
if (n->cmbsz && nvme_addr_is_cmb(n, addr)) {
memcpy(buf, (void *)&n->cmbuf[addr - n->ctrl_mem.addr], size);
return 0;
diff --git a/hw/block/nvme.h b/hw/block/nvme.h
index 557194ee..5a2b119c 100644
index 557194e..5a2b119 100644
--- a/hw/block/nvme.h
+++ b/hw/block/nvme.h
@@ -59,6 +59,7 @@ typedef struct NvmeNamespace {
@@ -74,5 +77,5 @@ index 557194ee..5a2b119c 100644
MemoryRegion ctrl_mem;
NvmeBar bar;
--
2.30.2
1.8.3.1

View File

@@ -0,0 +1,57 @@
Backport of:
From 8d1b247f3748ac4078524130c6d7ae42b6140aaf Mon Sep 17 00:00:00 2001
From: Stefano Garzarella <sgarzare@redhat.com>
Date: Mon, 28 Feb 2022 10:50:58 +0100
Subject: [PATCH] vhost-vsock: detach the virqueue element in case of error
In vhost_vsock_common_send_transport_reset(), if an element popped from
the virtqueue is invalid, we should call virtqueue_detach_element() to
detach it from the virtqueue before freeing its memory.
Fixes: fc0b9b0e1c ("vhost-vsock: add virtio sockets device")
Fixes: CVE-2022-26354
Cc: qemu-stable@nongnu.org
Reported-by: VictorV <vv474172261@gmail.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220228095058.27899-1-sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
CVE: CVE-2022-26354
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2022-26354.patch?h=ubuntu/focal-security Upstream commit https://github.com/qemu/qemu/commit/8d1b247f3748ac4078524130c6d7ae42b6140aaf ]
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
hw/virtio/vhost-vsock-common.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -221,19 +221,23 @@ static void vhost_vsock_send_transport_r
if (elem->out_num) {
error_report("invalid vhost-vsock event virtqueue element with "
"out buffers");
- goto out;
+ goto err;
}
if (iov_from_buf(elem->in_sg, elem->in_num, 0,
&event, sizeof(event)) != sizeof(event)) {
error_report("vhost-vsock event virtqueue element is too short");
- goto out;
+ goto err;
}
virtqueue_push(vq, elem, sizeof(event));
virtio_notify(VIRTIO_DEVICE(vsock), vq);
-out:
+ g_free(elem);
+ return;
+
+err:
+ virtqueue_detach_element(vq, elem, 0);
g_free(elem);
}

View File

@@ -0,0 +1,103 @@
From 6dbbf055148c6f1b7d8a3251a65bd6f3d1e1f622 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>
Date: Mon, 28 Nov 2022 21:27:40 +0100
Subject: [PATCH] hw/display/qxl: Avoid buffer overrun in qxl_phys2virt
(CVE-2022-4144)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Have qxl_get_check_slot_offset() return false if the requested
buffer size does not fit within the slot memory region.
Similarly qxl_phys2virt() now returns NULL in such case, and
qxl_dirty_one_surface() aborts.
This avoids buffer overrun in the host pointer returned by
memory_region_get_ram_ptr().
Fixes: CVE-2022-4144 (out-of-bounds read)
Reported-by: Wenxu Yin (@awxylitol)
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1336
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20221128202741.4945-5-philmd@linaro.org>
Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/6dbbf055148c6f1b7d8a3251a65bd6f3d1e1f622]
CVE: CVE-2022-4144
Comments: Deleted patch hunk in qxl.h,as it contains change
in comments which is not present in current version of qemu.
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
hw/display/qxl.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index cd7eb39d..6bc8385b 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1440,11 +1440,13 @@ static void qxl_reset_surfaces(PCIQXLDevice *d)
/* can be also called from spice server thread context */
static bool qxl_get_check_slot_offset(PCIQXLDevice *qxl, QXLPHYSICAL pqxl,
- uint32_t *s, uint64_t *o)
+ uint32_t *s, uint64_t *o,
+ size_t size_requested)
{
uint64_t phys = le64_to_cpu(pqxl);
uint32_t slot = (phys >> (64 - 8)) & 0xff;
uint64_t offset = phys & 0xffffffffffff;
+ uint64_t size_available;
if (slot >= NUM_MEMSLOTS) {
qxl_set_guest_bug(qxl, "slot too large %d >= %d", slot,
@@ -1468,6 +1470,23 @@ static bool qxl_get_check_slot_offset(PCIQXLDevice *qxl, QXLPHYSICAL pqxl,
slot, offset, qxl->guest_slots[slot].size);
return false;
}
+ size_available = memory_region_size(qxl->guest_slots[slot].mr);
+ if (qxl->guest_slots[slot].offset + offset >= size_available) {
+ qxl_set_guest_bug(qxl,
+ "slot %d offset %"PRIu64" > region size %"PRIu64"\n",
+ slot, qxl->guest_slots[slot].offset + offset,
+ size_available);
+ return false;
+ }
+ size_available -= qxl->guest_slots[slot].offset + offset;
+ if (size_requested > size_available) {
+ qxl_set_guest_bug(qxl,
+ "slot %d offset %"PRIu64" size %zu: "
+ "overrun by %"PRIu64" bytes\n",
+ slot, offset, size_requested,
+ size_requested - size_available);
+ return false;
+ }
*s = slot;
*o = offset;
@@ -1486,7 +1505,7 @@ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
offset = le64_to_cpu(pqxl) & 0xffffffffffff;
return (void *)(intptr_t)offset;
case MEMSLOT_GROUP_GUEST:
- if (!qxl_get_check_slot_offset(qxl, pqxl, &slot, &offset)) {
+ if (!qxl_get_check_slot_offset(qxl, pqxl, &slot, &offset, size)) {
return NULL;
}
ptr = memory_region_get_ram_ptr(qxl->guest_slots[slot].mr);
@@ -1944,9 +1963,9 @@ static void qxl_dirty_one_surface(PCIQXLDevice *qxl, QXLPHYSICAL pqxl,
uint32_t slot;
bool rc;
- rc = qxl_get_check_slot_offset(qxl, pqxl, &slot, &offset);
- assert(rc == true);
size = (uint64_t)height * abs(stride);
+ rc = qxl_get_check_slot_offset(qxl, pqxl, &slot, &offset, size);
+ assert(rc == true);
trace_qxl_surfaces_dirty(qxl->id, offset, size);
qxl_set_dirty(qxl->guest_slots[slot].mr,
qxl->guest_slots[slot].offset + offset,
--
2.25.1

View File

@@ -0,0 +1,146 @@
From ea2a7c7676d8eb9d1458eaa4b717df46782dcb3a Mon Sep 17 00:00:00 2001
From: Gaurav Gupta <gauragup@cisco.com>
Date: Wed, 29 Mar 2023 14:07:17 -0700
Subject: [PATCH 2/2] hw/block/nvme: handle dma errors
Handling DMA errors gracefully is required for the device to pass the
block/011 test ("disable PCI device while doing I/O") in the blktests
suite.
With this patch the device sets the Controller Fatal Status bit in the
CSTS register when failing to read from a submission queue or writing to
a completion queue; expecting the host to reset the controller.
If DMA errors occur at any other point in the execution of the command
(say, while mapping the PRPs), the command is aborted with a Data
Transfer Error status code.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
---
hw/block/nvme.c | 41 +++++++++++++++++++++++++++++++----------
hw/block/trace-events | 3 +++
2 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index e6f24a6..bda446d 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -60,14 +60,14 @@ static bool nvme_addr_is_cmb(NvmeCtrl *n, hwaddr addr)
return addr >= low && addr < hi;
}
-static void nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
+static int nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
{
if (n->cmbsz && nvme_addr_is_cmb(n, addr)) {
memcpy(buf, (void *)&n->cmbuf[addr - n->ctrl_mem.addr], size);
- return;
+ return 0;
}
- pci_dma_read(&n->parent_obj, addr, buf, size);
+ return pci_dma_read(&n->parent_obj, addr, buf, size);
}
static int nvme_check_sqid(NvmeCtrl *n, uint16_t sqid)
@@ -152,6 +152,7 @@ static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1,
hwaddr trans_len = n->page_size - (prp1 % n->page_size);
trans_len = MIN(len, trans_len);
int num_prps = (len >> n->page_bits) + 1;
+ int ret;
if (unlikely(!prp1)) {
trace_nvme_err_invalid_prp();
@@ -178,7 +179,11 @@ static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1,
nents = (len + n->page_size - 1) >> n->page_bits;
prp_trans = MIN(n->max_prp_ents, nents) * sizeof(uint64_t);
- nvme_addr_read(n, prp2, (void *)prp_list, prp_trans);
+ ret = nvme_addr_read(n, prp2, (void *)prp_list, prp_trans);
+ if (ret) {
+ trace_pci_nvme_err_addr_read(prp2);
+ return NVME_DATA_TRAS_ERROR;
+ }
while (len != 0) {
uint64_t prp_ent = le64_to_cpu(prp_list[i]);
@@ -191,8 +196,12 @@ static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1,
i = 0;
nents = (len + n->page_size - 1) >> n->page_bits;
prp_trans = MIN(n->max_prp_ents, nents) * sizeof(uint64_t);
- nvme_addr_read(n, prp_ent, (void *)prp_list,
- prp_trans);
+ ret = nvme_addr_read(n, prp_ent, (void *)prp_list,
+ prp_trans);
+ if (ret) {
+ trace_pci_nvme_err_addr_read(prp_ent);
+ return NVME_DATA_TRAS_ERROR;
+ }
prp_ent = le64_to_cpu(prp_list[i]);
}
@@ -286,6 +295,7 @@ static void nvme_post_cqes(void *opaque)
NvmeCQueue *cq = opaque;
NvmeCtrl *n = cq->ctrl;
NvmeRequest *req, *next;
+ int ret;
QTAILQ_FOREACH_SAFE(req, &cq->req_list, entry, next) {
NvmeSQueue *sq;
@@ -295,15 +305,21 @@ static void nvme_post_cqes(void *opaque)
break;
}
- QTAILQ_REMOVE(&cq->req_list, req, entry);
sq = req->sq;
req->cqe.status = cpu_to_le16((req->status << 1) | cq->phase);
req->cqe.sq_id = cpu_to_le16(sq->sqid);
req->cqe.sq_head = cpu_to_le16(sq->head);
addr = cq->dma_addr + cq->tail * n->cqe_size;
+ ret = pci_dma_write(&n->parent_obj, addr, (void *)&req->cqe,
+ sizeof(req->cqe));
+ if (ret) {
+ trace_pci_nvme_err_addr_write(addr);
+ trace_pci_nvme_err_cfs();
+ n->bar.csts = NVME_CSTS_FAILED;
+ break;
+ }
+ QTAILQ_REMOVE(&cq->req_list, req, entry);
nvme_inc_cq_tail(cq);
- pci_dma_write(&n->parent_obj, addr, (void *)&req->cqe,
- sizeof(req->cqe));
QTAILQ_INSERT_TAIL(&sq->req_list, req, entry);
}
if (cq->tail != cq->head) {
@@ -888,7 +904,12 @@ static void nvme_process_sq(void *opaque)
while (!(nvme_sq_empty(sq) || QTAILQ_EMPTY(&sq->req_list))) {
addr = sq->dma_addr + sq->head * n->sqe_size;
- nvme_addr_read(n, addr, (void *)&cmd, sizeof(cmd));
+ if (nvme_addr_read(n, addr, (void *)&cmd, sizeof(cmd))) {
+ trace_pci_nvme_err_addr_read(addr);
+ trace_pci_nvme_err_cfs();
+ n->bar.csts = NVME_CSTS_FAILED;
+ break;
+ }
nvme_inc_sq_head(sq);
req = QTAILQ_FIRST(&sq->req_list);
diff --git a/hw/block/trace-events b/hw/block/trace-events
index c03e80c..4e4ad4e 100644
--- a/hw/block/trace-events
+++ b/hw/block/trace-events
@@ -60,6 +60,9 @@ nvme_mmio_shutdown_set(void) "shutdown bit set"
nvme_mmio_shutdown_cleared(void) "shutdown bit cleared"
# nvme traces for error conditions
+pci_nvme_err_addr_read(uint64_t addr) "addr 0x%"PRIx64""
+pci_nvme_err_addr_write(uint64_t addr) "addr 0x%"PRIx64""
+pci_nvme_err_cfs(void) "controller fatal status"
nvme_err_invalid_dma(void) "PRP/SGL is too small for transfer size"
nvme_err_invalid_prplist_ent(uint64_t prplist) "PRP list entry is null or not page aligned: 0x%"PRIx64""
nvme_err_invalid_prp2_align(uint64_t prp2) "PRP2 is not page aligned: 0x%"PRIx64""
--
1.8.3.1

View File

@@ -0,0 +1,55 @@
From 55428706d5b0b8889b8e009eac77137bb556a4f0 Mon Sep 17 00:00:00 2001
From: Klaus Jensen <k.jensen@samsung.com>
Date: Tue, 9 Jun 2020 21:03:17 +0200
Subject: [PATCH 1/2] hw/block/nvme: refactor nvme_addr_read
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Pull the controller memory buffer check to its own function. The check
will be used on its own in later patches.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Message-Id: <20200609190333.59390-7-its@irrelevant.dk>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
hw/block/nvme.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 12d8254..e6f24a6 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -52,14 +52,22 @@
static void nvme_process_sq(void *opaque);
+static bool nvme_addr_is_cmb(NvmeCtrl *n, hwaddr addr)
+{
+ hwaddr low = n->ctrl_mem.addr;
+ hwaddr hi = n->ctrl_mem.addr + int128_get64(n->ctrl_mem.size);
+
+ return addr >= low && addr < hi;
+}
+
static void nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
{
- if (n->cmbsz && addr >= n->ctrl_mem.addr &&
- addr < (n->ctrl_mem.addr + int128_get64(n->ctrl_mem.size))) {
+ if (n->cmbsz && nvme_addr_is_cmb(n, addr)) {
memcpy(buf, (void *)&n->cmbuf[addr - n->ctrl_mem.addr], size);
- } else {
- pci_dma_read(&n->parent_obj, addr, buf, size);
+ return;
}
+
+ pci_dma_read(&n->parent_obj, addr, buf, size);
}
static int nvme_check_sqid(NvmeCtrl *n, uint16_t sqid)
--
1.8.3.1

View File

@@ -0,0 +1,236 @@
From 5a44a01c9eca6507be45d107c27377a3e8d0ee8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>
Date: Mon, 28 Nov 2022 21:27:39 +0100
Subject: [PATCH] hw/display/qxl: Pass requested buffer size to qxl_phys2virt()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Currently qxl_phys2virt() doesn't check for buffer overrun.
In order to do so in the next commit, pass the buffer size
as argument.
For QXLCursor in qxl_render_cursor() -> qxl_cursor() we
verify the size of the chunked data ahead, checking we can
access 'sizeof(QXLCursor) + chunk->data_size' bytes.
Since in the SPICE_CURSOR_TYPE_MONO case the cursor is
assumed to fit in one chunk, no change are required.
In SPICE_CURSOR_TYPE_ALPHA the ahead read is handled in
qxl_unpack_chunks().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20221128202741.4945-4-philmd@linaro.org>
Backport and rebase patch to fix compile error which imported by CVE-2022-4144.patch:
/qxl.c: In function 'qxl_phys2virt':
| /home/hitendra/work/yocto-work/cgx-data/dunfell-3.1/x86-generic-64-5.4-3.1-cgx/project/tmp/work/i586-montavistamllib32-linux/lib32-qemu/4.2.0-r0.8/qemu-4.2.0/hw/display/qxl.c:1508:67: error: 'size' undeclared (first use in this function); did you mean 'gsize'?
| 1508 | if (!qxl_get_check_slot_offset(qxl, pqxl, &slot, &offset, size)) {
| | ^~~~
| | gsize
Upstream-Status: Backport [https://github.com/qemu/qemu/commit/61c34fc && https://gitlab.com/qemu-project/qemu/-/commit/8efec0ef8bbc1e75a7ebf6e325a35806ece9b39f]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
hw/display/qxl-logger.c | 22 +++++++++++++++++++---
hw/display/qxl-render.c | 20 ++++++++++++++++----
hw/display/qxl.c | 17 +++++++++++------
hw/display/qxl.h | 3 ++-
4 files changed, 48 insertions(+), 14 deletions(-)
diff --git a/hw/display/qxl-logger.c b/hw/display/qxl-logger.c
index 2ec6d8fa..031ddfec 100644
--- a/hw/display/qxl-logger.c
+++ b/hw/display/qxl-logger.c
@@ -106,7 +106,7 @@ static int qxl_log_image(PCIQXLDevice *qxl, QXLPHYSICAL addr, int group_id)
QXLImage *image;
QXLImageDescriptor *desc;
- image = qxl_phys2virt(qxl, addr, group_id);
+ image = qxl_phys2virt(qxl, addr, group_id, sizeof(QXLImage));
if (!image) {
return 1;
}
@@ -216,7 +216,8 @@ int qxl_log_cmd_cursor(PCIQXLDevice *qxl, QXLCursorCmd *cmd, int group_id)
cmd->u.set.position.y,
cmd->u.set.visible ? "yes" : "no",
cmd->u.set.shape);
- cursor = qxl_phys2virt(qxl, cmd->u.set.shape, group_id);
+ cursor = qxl_phys2virt(qxl, cmd->u.set.shape, group_id,
+ sizeof(QXLCursor));
if (!cursor) {
return 1;
}
@@ -238,6 +239,7 @@ int qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext)
{
bool compat = ext->flags & QXL_COMMAND_FLAG_COMPAT;
void *data;
+ size_t datasz;
int ret;
if (!qxl->cmdlog) {
@@ -249,7 +251,20 @@ int qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext)
qxl_name(qxl_type, ext->cmd.type),
compat ? "(compat)" : "");
- data = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
+ switch (ext->cmd.type) {
+ case QXL_CMD_DRAW:
+ datasz = compat ? sizeof(QXLCompatDrawable) : sizeof(QXLDrawable);
+ break;
+ case QXL_CMD_SURFACE:
+ datasz = sizeof(QXLSurfaceCmd);
+ break;
+ case QXL_CMD_CURSOR:
+ datasz = sizeof(QXLCursorCmd);
+ break;
+ default:
+ goto out;
+ }
+ data = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id, datasz);
if (!data) {
return 1;
}
@@ -271,6 +286,7 @@ int qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext)
qxl_log_cmd_cursor(qxl, data, ext->group_id);
break;
}
+out:
fprintf(stderr, "\n");
return 0;
}
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
index d532e157..a65a6d64 100644
--- a/hw/display/qxl-render.c
+++ b/hw/display/qxl-render.c
@@ -107,7 +107,9 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)
qxl->guest_primary.resized = 0;
qxl->guest_primary.data = qxl_phys2virt(qxl,
qxl->guest_primary.surface.mem,
- MEMSLOT_GROUP_GUEST);
+ MEMSLOT_GROUP_GUEST,
+ qxl->guest_primary.abs_stride
+ * height);
if (!qxl->guest_primary.data) {
return;
}
@@ -222,7 +224,8 @@ static void qxl_unpack_chunks(void *dest, size_t size, PCIQXLDevice *qxl,
if (offset == size) {
return;
}
- chunk = qxl_phys2virt(qxl, chunk->next_chunk, group_id);
+ chunk = qxl_phys2virt(qxl, chunk->next_chunk, group_id,
+ sizeof(QXLDataChunk) + chunk->data_size);
if (!chunk) {
return;
}
@@ -289,7 +292,8 @@ fail:
/* called from spice server thread context only */
int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
{
- QXLCursorCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
+ QXLCursorCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id,
+ sizeof(QXLCursorCmd));
QXLCursor *cursor;
QEMUCursor *c;
@@ -308,7 +312,15 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
}
switch (cmd->type) {
case QXL_CURSOR_SET:
- cursor = qxl_phys2virt(qxl, cmd->u.set.shape, ext->group_id);
+ /* First read the QXLCursor to get QXLDataChunk::data_size ... */
+ cursor = qxl_phys2virt(qxl, cmd->u.set.shape, ext->group_id,
+ sizeof(QXLCursor));
+ if (!cursor) {
+ return 1;
+ }
+ /* Then read including the chunked data following QXLCursor. */
+ cursor = qxl_phys2virt(qxl, cmd->u.set.shape, ext->group_id,
+ sizeof(QXLCursor) + cursor->chunk.data_size);
if (!cursor) {
return 1;
}
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 6bc8385b..858d3e93 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -275,7 +275,8 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
QXL_IO_MONITORS_CONFIG_ASYNC));
}
- cfg = qxl_phys2virt(qxl, qxl->guest_monitors_config, MEMSLOT_GROUP_GUEST);
+ cfg = qxl_phys2virt(qxl, qxl->guest_monitors_config, MEMSLOT_GROUP_GUEST,
+ sizeof(QXLMonitorsConfig));
if (cfg != NULL && cfg->count == 1) {
qxl->guest_primary.resized = 1;
qxl->guest_head0_width = cfg->heads[0].width;
@@ -460,7 +461,8 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
switch (le32_to_cpu(ext->cmd.type)) {
case QXL_CMD_SURFACE:
{
- QXLSurfaceCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
+ QXLSurfaceCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id,
+ sizeof(QXLSurfaceCmd));
if (!cmd) {
return 1;
@@ -494,7 +496,8 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
}
case QXL_CMD_CURSOR:
{
- QXLCursorCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
+ QXLCursorCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id,
+ sizeof(QXLCursorCmd));
if (!cmd) {
return 1;
@@ -674,7 +677,8 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
*
* https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/commit/?id=f6e099db39e7d0787f294d5fd0dce328b5210faa
*/
- void *msg = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
+ void *msg = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id,
+ sizeof(QXLCommandRing));
if (msg != NULL && (
msg < (void *)qxl->vga.vram_ptr ||
msg > ((void *)qxl->vga.vram_ptr + qxl->vga.vram_size))) {
@@ -1494,7 +1498,8 @@ static bool qxl_get_check_slot_offset(PCIQXLDevice *qxl, QXLPHYSICAL pqxl,
}
/* can be also called from spice server thread context */
-void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
+void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id,
+ size_t size)
{
uint64_t offset;
uint32_t slot;
@@ -1994,7 +1999,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl)
}
cmd = qxl_phys2virt(qxl, qxl->guest_surfaces.cmds[i],
- MEMSLOT_GROUP_GUEST);
+ MEMSLOT_GROUP_GUEST, sizeof(QXLSurfaceCmd));
assert(cmd);
assert(cmd->type == QXL_SURFACE_CMD_CREATE);
qxl_dirty_one_surface(qxl, cmd->u.surface_create.data,
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index 80eb0d26..fcfd133a 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -147,7 +147,8 @@ typedef struct PCIQXLDevice {
#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V12
/* qxl.c */
-void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
+void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id,
+ size_t size);
void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
GCC_FMT_ATTR(2, 3);
--
2.25.1

View File

@@ -0,0 +1,61 @@
From 957bb7cb81995f26c671afce0ee50a5c660e540e Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Date: Wed, 29 Mar 2023 13:28:25 +0900
Subject: [PATCH] CVE-2023-28756
CVE: CVE-2023-28756
Upstream-Status: Backport [https://github.com/ruby/ruby/commit/957bb7cb81995f26c671afce0ee50a5c660e540e]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
lib/time.rb | 6 +++---
test/test_time.rb | 9 +++++++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/lib/time.rb b/lib/time.rb
index f27bacd..4a86e8e 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -501,8 +501,8 @@ class Time
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
(\d{2,})\s+
(\d{2})\s*
- :\s*(\d{2})\s*
- (?::\s*(\d{2}))?\s+
+ :\s*(\d{2})
+ (?:\s*:\s*(\d\d))?\s+
([+-]\d{4}|
UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-IK-Z])/ix =~ date
# Since RFC 2822 permit comments, the regexp has no right anchor.
@@ -717,7 +717,7 @@ class Time
#
# If self is a UTC time, Z is used as TZD. [+-]hh:mm is used otherwise.
#
- # +fractional_digits+ specifies a number of digits to use for fractional
+ # +fraction_digits+ specifies a number of digits to use for fractional
# seconds. Its default value is 0.
#
# require 'time'
diff --git a/test/test_time.rb b/test/test_time.rb
index ca20788..4f11048 100644
--- a/test/test_time.rb
+++ b/test/test_time.rb
@@ -62,6 +62,15 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
assert_equal(true, t.utc?)
end
+ def test_rfc2822_nonlinear
+ pre = ->(n) {"0 Feb 00 00 :00" + " " * n}
+ assert_linear_performance([100, 500, 5000, 50_000], pre: pre) do |s|
+ assert_raise(ArgumentError) do
+ Time.rfc2822(s)
+ end
+ end
+ end
+
def test_encode_rfc2822
t = Time.utc(1)
assert_equal("Mon, 01 Jan 0001 00:00:00 -0000", t.rfc2822)
--
2.25.1

View File

@@ -7,6 +7,7 @@ SRC_URI += " \
file://run-ptest \
file://0001-Modify-shebang-of-libexec-y2racc-and-libexec-racc2y.patch \
file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \
file://CVE-2023-28756.patch \
"
SRC_URI[md5sum] = "f972fb0cce662966bec10d5c5f32d042"

View File

@@ -1,7 +1,7 @@
[Unit]
Description=Run pending postinsts
DefaultDependencies=no
After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount ldconfig.service
Before=sysinit.target
[Service]

View File

@@ -0,0 +1,39 @@
From 77ff5f1be394eb2c786df561ff37dde7f982ec76 Mon Sep 17 00:00:00 2001
From: Stefano Babic <sbabic@denx.de>
Date: Fri, 28 Jul 2017 13:20:52 +0200
Subject: [PATCH] Wrong CRC with ASCII CRC for large files
Due to signedness, the checksum is not computed when filesize is bigger
a 2GB.
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-cpio/2017-07/msg00004.html]
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
src/copyout.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/copyout.c b/src/copyout.c
index 1f0987a..727aeca 100644
--- a/src/copyout.c
+++ b/src/copyout.c
@@ -34,13 +34,13 @@
compute and return a checksum for them. */
static uint32_t
-read_for_checksum (int in_file_des, int file_size, char *file_name)
+read_for_checksum (int in_file_des, unsigned int file_size, char *file_name)
{
uint32_t crc;
char buf[BUFSIZ];
- int bytes_left;
- int bytes_read;
- int i;
+ unsigned int bytes_left;
+ unsigned int bytes_read;
+ unsigned int i;
crc = 0;
--
2.7.4

View File

@@ -10,6 +10,7 @@ SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
file://0002-src-global.c-Remove-superfluous-declaration-of-progr.patch \
file://CVE-2021-38185.patch \
file://0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch \
"
SRC_URI[md5sum] = "389c5452d667c23b5eceb206f5000810"

View File

@@ -0,0 +1,54 @@
From 37ed5022cecd584de868933b5b60da2e995b3179 Mon Sep 17 00:00:00 2001
From: Ken Sharp <ken.sharp@artifex.com>
Date: Fri, 24 Mar 2023 13:19:57 +0000
Subject: [PATCH] Graphics library - prevent buffer overrun in (T)BCP encoding
Bug #706494 "Buffer Overflow in s_xBCPE_process"
As described in detail in the bug report, if the write buffer is filled
to one byte less than full, and we then try to write an escaped
character, we overrun the buffer because we don't check before
writing two bytes to it.
This just checks if we have two bytes before starting to write an
escaped character and exits if we don't (replacing the consumed byte
of the input).
Up for further discussion; why do we even permit a BCP encoding filter
anyway ? I think we should remove this, at least when SAFER is true.
Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;h=37ed5022cecd584de868933b5b60da2e995b3179]
CVE: CVE-2023-28879
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
base/sbcp.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/base/sbcp.c b/base/sbcp.c
index 6b0383c..90784b5 100644
--- a/base/sbcp.c
+++ b/base/sbcp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2019 Artifex Software, Inc.
+/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -50,6 +50,14 @@ s_xBCPE_process(stream_state * st, stream_cursor_read * pr,
byte ch = *++p;
if (ch <= 31 && escaped[ch]) {
+ /* Make sure we have space to store two characters in the write buffer,
+ * if we don't then exit without consuming the input character, we'll process
+ * that on the next time round.
+ */
+ if (pw->limit - q < 2) {
+ p--;
+ break;
+ }
if (p == rlimit) {
p--;
break;
--
2.25.1

View File

@@ -14,7 +14,7 @@ stack than are available.
To cope, add in stack limit checking to throw an appropriate error when this
happens.
CVE: CVE-2021-45944
Upstream-Status: Backported [https://git.ghostscript.com/?p=ghostpdl.git;a=patch;h=7861fcad13c497728189feafb41cd57b5b50ea25]
Signed-off-by: Minjae Kim <flowergom@gmail.com>
---

View File

@@ -39,6 +39,7 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d
file://CVE-2021-3781_1.patch \
file://CVE-2021-3781_2.patch \
file://CVE-2021-3781_3.patch \
file://CVE-2023-28879.patch \
"
SRC_URI = "${SRC_URI_BASE} \

View File

@@ -0,0 +1,29 @@
From cfaa28168a07ea4a53276b63068f94fce37d6aff Mon Sep 17 00:00:00 2001
From: Tim Kientzle <kientzle@acm.org>
Date: Thu, 24 Mar 2022 10:35:00 +0100
Subject: [PATCH] ZIP reader: fix possible out-of-bounds read in
zipx_lzma_alone_init()
Fixes #1672
CVE: CVE-2022-26280
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/cfaa28168a07ea4a53276b63068f94fce37d6aff]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
libarchive/archive_read_support_format_zip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c
index 38ada70b5..9d6c900b2 100644
--- a/libarchive/archive_read_support_format_zip.c
+++ b/libarchive/archive_read_support_format_zip.c
@@ -1667,7 +1667,7 @@ zipx_lzma_alone_init(struct archive_read *a, struct zip *zip)
*/
/* Read magic1,magic2,lzma_params from the ZIPX stream. */
- if((p = __archive_read_ahead(a, 9, NULL)) == NULL) {
+ if(zip->entry_bytes_remaining < 9 || (p = __archive_read_ahead(a, 9, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated lzma data");
return (ARCHIVE_FATAL);

View File

@@ -39,6 +39,7 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
file://CVE-2021-23177.patch \
file://CVE-2021-31566-01.patch \
file://CVE-2021-31566-02.patch \
file://CVE-2022-26280.patch \
file://CVE-2022-36227.patch \
"

View File

@@ -0,0 +1,40 @@
From e9ad41bfedb4537a6f0de20f00b27c7739f168f7 Mon Sep 17 00:00:00 2001
From: Alexander Naumov <alexander_naumov@opensuse.org>
Date: Mon, 30 Jan 2023 17:22:25 +0200
Subject: fix: missing signal sending permission check on failed query messages
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
CVE: CVE-2023-24626
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/screen.git/commit/?id=e9ad41bfedb4537a6f0de20f00b27c7739f168f7]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
socket.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/socket.c b/socket.c
index bb68b35..9d87445 100644
--- a/socket.c
+++ b/socket.c
@@ -1285,11 +1285,16 @@ ReceiveMsg()
else
queryflag = -1;
- Kill(m.m.command.apid,
+ if (CheckPid(m.m.command.apid)) {
+ Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid);
+ }
+ else {
+ Kill(m.m.command.apid,
(queryflag >= 0)
? SIGCONT
: SIG_BYE); /* Send SIG_BYE if an error happened */
- queryflag = -1;
+ queryflag = -1;
+ }
}
break;
case MSG_COMMAND:
--
2.25.1

Some files were not shown because too many files have changed in this diff Show More