stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Li Zhong <floridsleeves@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15 022/121] net/core/skbuff: Check the return value of skb_copy_bits()
Date: Tue, 13 Sep 2022 16:03:33 +0200	[thread overview]
Message-ID: <20220913140358.298585115@linuxfoundation.org> (raw)
In-Reply-To: <20220913140357.323297659@linuxfoundation.org>

From: lily <floridsleeves@gmail.com>

[ Upstream commit c624c58e08b15105662b9ab9be23d14a6b945a49 ]

skb_copy_bits() could fail, which requires a check on the return
value.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/skbuff.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 563848242ad33..3c193e7d4bc67 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4188,9 +4188,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
 				SKB_GSO_CB(nskb)->csum_start =
 					skb_headroom(nskb) + doffset;
 			} else {
-				skb_copy_bits(head_skb, offset,
-					      skb_put(nskb, len),
-					      len);
+				if (skb_copy_bits(head_skb, offset, skb_put(nskb, len), len))
+					goto err;
 			}
 			continue;
 		}
-- 
2.35.1




  parent reply	other threads:[~2022-09-13 15:06 UTC|newest]

Thread overview: 137+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 14:03 [PATCH 5.15 000/121] 5.15.68-rc1 review Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 001/121] net: wwan: iosm: remove pointless null check Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 002/121] efi: libstub: Disable struct randomization Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 003/121] efi: capsule-loader: Fix use-after-free in efi_capsule_write Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 004/121] wifi: iwlegacy: 4965: corrected fix for potential off-by-one overflow in il4965_rs_fill_link_cmd() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 005/121] net: mvpp2: debugfs: fix memory leak when using debugfs_lookup() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 006/121] fs: only do a memory barrier for the first set_buffer_uptodate() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 007/121] Revert "mm: kmemleak: take a full lowmem check in kmemleak_*_phys()" Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 008/121] scsi: qla2xxx: Disable ATIO interrupt coalesce for quad port ISP27XX Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 009/121] scsi: megaraid_sas: Fix double kfree() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 010/121] drm/gem: Fix GEM handle release errors Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 011/121] drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 012/121] drm/amdgpu: Check num_gfx_rings for gfx v9_0 rb setup Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 013/121] drm/radeon: add a force flush to delay work when radeon Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 014/121] scsi: ufs: core: Reduce the power mode change timeout Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 015/121] Revert "parisc: Show error if wrong 32/64-bit compiler is being used" Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 016/121] parisc: ccio-dma: Handle kmalloc failure in ccio_init_resources() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 017/121] parisc: Add runtime check to prevent PA2.0 kernels on PA1.x machines Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 018/121] arm64: cacheinfo: Fix incorrect assignment of signed error value to unsigned fw_level Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 019/121] arm64/signal: Raise limit on stack frames Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 020/121] netfilter: conntrack: work around exceeded receive window Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 021/121] cpufreq: check only freq_table in __resolve_freq() Greg Kroah-Hartman
2022-09-13 14:03 ` Greg Kroah-Hartman [this message]
2022-09-13 14:03 ` [PATCH 5.15 023/121] md: Flush workqueue md_rdev_misc_wq in md_alloc() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 024/121] fbdev: fbcon: Destroy mutex on freeing struct fb_info Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 025/121] fbdev: chipsfb: Add missing pci_disable_device() in chipsfb_pci_init() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 026/121] drm/amdgpu: mmVM_L2_CNTL3 register not initialized correctly Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 027/121] ALSA: pcm: oss: Fix race at SNDCTL_DSP_SYNC Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 028/121] ALSA: emu10k1: Fix out of bounds access in snd_emu10k1_pcm_channel_alloc() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 029/121] ALSA: aloop: Fix random zeros in capture data when using jiffies timer Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 030/121] ALSA: usb-audio: Split endpoint setups for hw_params and prepare Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 031/121] ALSA: usb-audio: Fix an out-of-bounds bug in __snd_usb_parse_audio_interface() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 032/121] tracing: Fix to check event_mutex is held while accessing trigger list Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 033/121] btrfs: zoned: set pseudo max append zone limit in zone emulation mode Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 034/121] vfio/type1: Unpin zero pages Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 035/121] kprobes: Prohibit probes in gate area Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 036/121] debugfs: add debugfs_lookup_and_remove() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 037/121] sched/debug: fix dentry leak in update_sched_domain_debugfs Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 038/121] drm/amd/display: fix memory leak when using debugfs_lookup() Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 039/121] nvmet: fix a use-after-free Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 040/121] drm/i915: Implement WaEdpLinkRateDataReload Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 041/121] scsi: mpt3sas: Fix use-after-free warning Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 042/121] scsi: lpfc: Add missing destroy_workqueue() in error path Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 043/121] NFS: Further optimisations for ls -l Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 044/121] NFS: Save some space in the inode Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 045/121] NFS: Fix another fsync() issue after a server reboot Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 046/121] cgroup: Elide write-locking threadgroup_rwsem when updating csses on an empty subtree Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 047/121] cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock Greg Kroah-Hartman
2022-09-13 14:03 ` [PATCH 5.15 048/121] riscv: dts: microchip: mpfs: Fix reference clock node Greg Kroah-Hartman
2022-09-13 16:09   ` Conor.Dooley
2022-09-13 16:14     ` Greg KH
2022-09-13 14:04 ` [PATCH 5.15 049/121] ASoC: qcom: sm8250: add missing module owner Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 050/121] RDMA/rtrs-clt: Use the right sg_cnt after ib_dma_map_sg Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 051/121] RDMA/rtrs-srv: Pass the correct number of entries for dma mapped SGL Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 052/121] ARM: dts: imx6qdl-kontron-samx6i: remove duplicated node Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 053/121] soc: imx: gpcv2: Assert reset before ungating clock Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 054/121] regulator: core: Clean up on enable failure Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 055/121] tee: fix compiler warning in tee_shm_register() Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 056/121] RDMA/cma: Fix arguments order in net device validation Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 057/121] soc: brcmstb: pm-arm: Fix refcount leak and __iomem leak bugs Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 058/121] RDMA/hns: Fix supported page size Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 059/121] RDMA/hns: Fix wrong fixed value of qp->rq.wqe_shift Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 060/121] wifi: wilc1000: fix DMA on stack objects Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 061/121] ARM: at91: pm: fix self-refresh for sama7g5 Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 062/121] ARM: at91: pm: fix DDR recalibration when resuming from backup and self-refresh Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 063/121] ARM: dts: at91: sama5d27_wlsom1: specify proper regulator output ranges Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 064/121] ARM: dts: at91: sama5d2_icp: " Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 065/121] ARM: dts: at91: sama5d27_wlsom1: dont keep ldo2 enabled all the time Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 066/121] ARM: dts: at91: sama5d2_icp: dont keep vdd_other " Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 067/121] netfilter: br_netfilter: Drop dst references before setting Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 068/121] netfilter: nf_tables: clean up hook list when offload flags check fails Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 069/121] netfilter: nf_conntrack_irc: Fix forged IP logic Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 070/121] RDMA/srp: Set scmnd->result only when scmnd is not NULL Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 071/121] ALSA: usb-audio: Inform the delayed registration more properly Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 072/121] ALSA: usb-audio: Register card again for iface over delayed_register option Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 073/121] rxrpc: Fix ICMP/ICMP6 error handling Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 074/121] rxrpc: Fix an insufficiently large sglist in rxkad_verify_packet_2() Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 075/121] afs: Use the operation issue time instead of the reply time for callbacks Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 076/121] Revert "net: phy: meson-gxl: improve link-up behavior" Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 077/121] sch_sfb: Dont assume the skb is still around after enqueueing to child Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 078/121] tipc: fix shift wrapping bug in map_get() Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 079/121] net: introduce __skb_fill_page_desc_noacc Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 080/121] tcp: TX zerocopy should not sense pfmemalloc status Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 081/121] ice: use bitmap_free instead of devm_kfree Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 082/121] i40e: Fix kernel crash during module removal Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 083/121] iavf: Detach device during reset task Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 084/121] net: fec: Use a spinlock to guard `fep->ptp_clk_on` Greg Kroah-Hartman
2022-09-13 15:56   ` Marc Kleine-Budde
2022-09-13 19:09     ` Csókás Bence
2022-09-13 14:04 ` [PATCH 5.15 085/121] xen-netback: only remove hotplug-status when the vif is actually destroyed Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 086/121] RDMA/siw: Pass a pointer to virt_to_page() Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 087/121] ipv6: sr: fix out-of-bounds read when setting HMAC data Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 088/121] IB/core: Fix a nested dead lock as part of ODP flow Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 089/121] RDMA/mlx5: Set local port to one when accessing counters Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 090/121] erofs: fix pcluster use-after-free on UP platforms Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 091/121] nvme-tcp: fix UAF when detecting digest errors Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 092/121] nvme-tcp: fix regression that causes sporadic requests to time out Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 093/121] tcp: fix early ETIMEDOUT after spurious non-SACK RTO Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 094/121] nvmet: fix mar and mor off-by-one errors Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 095/121] RDMA/irdma: Report the correct max cqes from query device Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 096/121] RDMA/irdma: Return correct WC error for bind operation failure Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 097/121] RDMA/irdma: Report RNR NAK generation in device caps Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 098/121] sch_sfb: Also store skb len before calling child enqueue Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 099/121] perf script: Fix Cannot print iregs field for hybrid systems Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 100/121] hwmon: (tps23861) fix byte order in resistance register Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 101/121] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 102/121] ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 103/121] MIPS: loongson32: ls1c: Fix hang during startup Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 104/121] kbuild: disable header exports for UML in a straightforward way Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 105/121] i40e: Refactor tc mqprio checks Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 106/121] i40e: Fix ADQ rate limiting for PF Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 107/121] swiotlb: avoid potential left shift overflow Greg Kroah-Hartman
2022-09-13 14:04 ` [PATCH 5.15 108/121] iommu/amd: use full 64-bit value in build_completion_wait() Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 109/121] s390/boot: fix absolute zero lowcore corruption on boot Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 110/121] hwmon: (mr75203) fix VM sensor allocation when "intel,vm-map" not defined Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 111/121] hwmon: (mr75203) update pvt->v_num and vm_num to the actual number of used sensors Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 112/121] hwmon: (mr75203) fix voltage equation for negative source input Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 113/121] hwmon: (mr75203) fix multi-channel voltage reading Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 114/121] hwmon: (mr75203) enable polling for all VM channels Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 115/121] Revert "arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags"" Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 116/121] arm64/bti: Disable in kernel BTI when cross section thunks are broken Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 117/121] iommu/vt-d: Correctly calculate sagaw value of IOMMU Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 118/121] arm64: errata: add detection for AMEVCNTR01 incrementing incorrectly Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 119/121] drm/bridge: display-connector: implement bus fmts callbacks Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 120/121] perf machine: Use path__join() to compose a path instead of snprintf(dir, /, filename) Greg Kroah-Hartman
2022-09-13 14:05 ` [PATCH 5.15 121/121] ARM: at91: ddr: remove CONFIG_SOC_SAMA7 dependency Greg Kroah-Hartman
2022-09-14  9:13 ` [PATCH 5.15 000/121] 5.15.68-rc1 review Bagas Sanjaya
2022-09-14  9:40 ` Sudip Mukherjee
2022-09-14  9:41 ` Naresh Kamboju
2022-09-15 15:59   ` Wang Yugui
2022-09-15 21:27     ` David Wysochanski
2022-09-16  9:27       ` Greg Kroah-Hartman
2022-09-14 10:28 ` Ron Economos
2022-09-14 15:27 ` Jon Hunter
2022-09-15  0:11 ` Guenter Roeck
2022-09-15  2:26 ` Florian Fainelli
2022-09-15 13:53 ` Kelsey Steele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220913140358.298585115@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=floridsleeves@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).