From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ian Abbott <abbotti@mev.co.uk>,
David Binderman <dcb314@hotmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 5.2 092/135] staging: comedi: dt3000: Fix signed integer overflow 'divider * base'
Date: Thu, 22 Aug 2019 13:07:28 -0400 [thread overview]
Message-ID: <20190822170811.13303-93-sashal@kernel.org> (raw)
In-Reply-To: <20190822170811.13303-1-sashal@kernel.org>
From: Ian Abbott <abbotti@mev.co.uk>
commit b4d98bc3fc93ec3a58459948a2c0e0c9b501cd88 upstream.
In `dt3k_ns_to_timer()` the following lines near the end of the function
result in a signed integer overflow:
prescale = 15;
base = timer_base * (1 << prescale);
divider = 65535;
*nanosec = divider * base;
(`divider`, `base` and `prescale` are type `int`, `timer_base` and
`*nanosec` are type `unsigned int`. The value of `timer_base` will be
either 50 or 100.)
The main reason for the overflow is that the calculation for `base` is
completely wrong. It should be:
base = timer_base * (prescale + 1);
which matches an earlier instance of this calculation in the same
function.
Reported-by: David Binderman <dcb314@hotmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20190812111517.26803-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/comedi/drivers/dt3000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c
index 2edf3ee913000..4ad176fc14ad1 100644
--- a/drivers/staging/comedi/drivers/dt3000.c
+++ b/drivers/staging/comedi/drivers/dt3000.c
@@ -368,7 +368,7 @@ static int dt3k_ns_to_timer(unsigned int timer_base, unsigned int *nanosec,
}
prescale = 15;
- base = timer_base * (1 << prescale);
+ base = timer_base * (prescale + 1);
divider = 65535;
*nanosec = divider * base;
return (prescale << 16) | (divider);
--
2.20.1
next prev parent reply other threads:[~2019-08-22 17:09 UTC|newest]
Thread overview: 161+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 17:05 [PATCH 5.2 000/135] 5.2.10-stable review Sasha Levin
2019-08-22 17:05 ` [PATCH 5.2 001/135] KEYS: trusted: allow module init if TPM is inactive or deactivated Sasha Levin
2019-08-22 17:05 ` [PATCH 5.2 002/135] sh: kernel: hw_breakpoint: Fix missing break in switch statement Sasha Levin
2019-08-22 17:05 ` [PATCH 5.2 003/135] seq_file: fix problem when seeking mid-record Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 004/135] mm/hmm: fix bad subpage pointer in try_to_unmap_one Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 005/135] mm: mempolicy: make the behavior consistent when MPOL_MF_MOVE* and MPOL_MF_STRICT were specified Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 006/135] mm: mempolicy: handle vma with unmovable pages mapped correctly in mbind Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 007/135] mm/z3fold.c: fix z3fold_destroy_pool() ordering Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 008/135] mm/z3fold.c: fix z3fold_destroy_pool() race condition Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 009/135] mm/memcontrol.c: fix use after free in mem_cgroup_iter() Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 010/135] mm/usercopy: use memory range to be accessed for wraparound check Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 011/135] mm, vmscan: do not special-case slab reclaim when watermarks are boosted Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 012/135] cpufreq: schedutil: Don't skip freq update when limits change Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 013/135] drm/amdgpu: fix gfx9 soft recovery Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 014/135] drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 015/135] xtensa: add missing isync to the cpu_reset TLB code Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 016/135] arm64: ftrace: Ensure module ftrace trampoline is coherent with I-side Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 017/135] ALSA: hda/realtek - Add quirk for HP Envy x360 Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 018/135] ALSA: usb-audio: Fix a stack buffer overflow bug in check_input_term Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 019/135] ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 020/135] ALSA: hda - Apply workaround for another AMD chip 1022:1487 Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 021/135] ALSA: hda - Fix a memory leak bug Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 022/135] ALSA: hda - Add a generic reboot_notify Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 023/135] ALSA: hda - Let all conexant codec enter D3 when rebooting Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 024/135] HID: holtek: test for sanity of intfdata Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 025/135] HID: hiddev: avoid opening a disconnected device Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 026/135] HID: hiddev: do cleanup in failure of opening a device Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 027/135] Input: kbtab - sanity check for endpoint type Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 028/135] Input: iforce - add sanity checks Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 029/135] net: usb: pegasus: fix improper read if get_registers() fail Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 030/135] bpf: fix access to skb_shared_info->gso_segs Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 031/135] netfilter: ebtables: also count base chain policies Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 032/135] riscv: Correct the initialized flow of FP register Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 033/135] riscv: Make __fstate_clean() work correctly Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 034/135] Revert "i2c: imx: improve the error handling in i2c_imx_dma_request()" Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 035/135] blk-mq: move cancel of requeue_work to the front of blk_exit_queue Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 036/135] io_uring: fix manual setup of iov_iter for fixed buffers Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 037/135] RDMA/hns: Fix sg offset non-zero issue Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 038/135] IB/mlx5: Replace kfree with kvfree Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 039/135] clk: at91: generated: Truncate divisor to GENERATED_MAX_DIV + 1 Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 040/135] clk: sprd: Select REGMAP_MMIO to avoid compile errors Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 041/135] clk: renesas: cpg-mssr: Fix reset control race condition Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 042/135] dma-mapping: check pfn validity in dma_common_{mmap,get_sgtable} Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 043/135] platform/x86: pcengines-apuv2: Fix softdep statement Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 044/135] platform/x86: intel_pmc_core: Add ICL-NNPI support to PMC Core Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 045/135] mm/hmm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot} Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 046/135] xen/pciback: remove set but not used variable 'old_state' Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 047/135] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 048/135] irqchip/irq-imx-gpcv2: Forward irq type to parent Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 049/135] f2fs: fix to read source block before invalidating it Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 050/135] tools perf beauty: Fix usbdevfs_ioctl table generator to handle _IOC() Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 051/135] perf header: Fix divide by zero error if f_header.attr_size==0 Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 052/135] perf header: Fix use of unitialized value warning Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 053/135] RDMA/qedr: Fix the hca_type and hca_rev returned in device attributes Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 054/135] ALSA: pcm: fix lost wakeup event scenarios in snd_pcm_drain Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 055/135] libata: zpodd: Fix small read overflow in zpodd_get_mech_type() Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 056/135] powerpc/nvdimm: Pick nearby online node if the device node is not online Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 057/135] drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 058/135] drm/bridge: tc358764: Fix build error Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 059/135] Btrfs: fix deadlock between fiemap and transaction commits Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 060/135] scsi: hpsa: correct scsi command status issue after reset Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 061/135] scsi: qla2xxx: Fix possible fcport null-pointer dereferences Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 062/135] tracing: Fix header include guards in trace event headers Sasha Levin
2019-08-22 17:06 ` [PATCH 5.2 063/135] drm/amdkfd: Fix byte align on VegaM Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 064/135] drm/amd/powerplay: fix null pointer dereference around dpm state relates Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 065/135] drm/amdgpu: fix error handling in amdgpu_cs_process_fence_dep Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 066/135] drm/amdgpu: fix a potential information leaking bug Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 067/135] ata: libahci: do not complain in case of deferred probe Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 068/135] kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 069/135] kbuild: Check for unknown options with cc-option usage in Kconfig and clang Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 070/135] arm64/efi: fix variable 'si' set but not used Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 071/135] riscv: Fix perf record without libelf support Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 072/135] arm64: Lower priority mask for GIC_PRIO_IRQON Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 073/135] arm64: unwind: Prohibit probing on return_address() Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 074/135] arm64/mm: fix variable 'pud' set but not used Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 075/135] arm64/mm: fix variable 'tag' " Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 076/135] IB/core: Add mitigation for Spectre V1 Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 077/135] IB/mlx5: Fix MR registration flow to use UMR properly Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 078/135] RDMA/restrack: Track driver QP types in resource tracker Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 079/135] IB/mad: Fix use-after-free in ib mad completion handling Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 080/135] RDMA/mlx5: Release locks during notifier unregister Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 081/135] drm: msm: Fix add_gpu_components Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 082/135] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp() Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 083/135] drm/exynos: fix missing decrement of retry counter Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 084/135] arm64: kprobes: Recover pstate.D in single-step exception handler Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 085/135] arm64: Make debug exception handlers visible from RCU Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 086/135] Revert "kmemleak: allow to coexist with fault injection" Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 087/135] ocfs2: remove set but not used variable 'last_hash' Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 088/135] page flags: prioritize kasan bits over last-cpuid Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 089/135] asm-generic: fix -Wtype-limits compiler warnings Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 090/135] tpm: tpm_ibm_vtpm: Fix unallocated banks Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 091/135] arm64: KVM: regmap: Fix unexpected switch fall-through Sasha Levin
2019-08-22 17:07 ` Sasha Levin [this message]
2019-08-22 17:07 ` [PATCH 5.2 093/135] staging: comedi: dt3000: Fix rounding up of timer divisor Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 094/135] iio: adc: max9611: Fix temperature reading in probe Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 095/135] USB: core: Fix races in character device registration and deregistraion Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 096/135] usb: gadget: udc: renesas_usb3: Fix sysfs interface of "role" Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 097/135] usb: cdc-acm: make sure a refcount is taken early enough Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 098/135] USB: CDC: fix sanity checks in CDC union parser Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 099/135] USB: serial: option: add D-Link DWM-222 device ID Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 100/135] USB: serial: option: Add support for ZTE MF871A Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 101/135] USB: serial: option: add the BroadMobi BM818 card Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 102/135] USB: serial: option: Add Motorola modem UARTs Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 103/135] usb: setup authorized_default attributes using usb_bus_notify Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 104/135] netfilter: conntrack: Use consistent ct id hash calculation Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 105/135] iwlwifi: Add support for SAR South Korea limitation Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 106/135] Input: psmouse - fix build error of multiple definition Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 107/135] bnx2x: Fix VF's VLAN reconfiguration in reload Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 108/135] bonding: Add vlan tx offload to hw_enc_features Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 109/135] net: dsa: Check existence of .port_mdb_add callback before calling it Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 110/135] net/mlx4_en: fix a memory leak bug Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 111/135] net/packet: fix race in tpacket_snd() Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 112/135] net: sched: sch_taprio: fix memleak in error path for sched list parse Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 113/135] sctp: fix memleak in sctp_send_reset_streams Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 114/135] sctp: fix the transport error_count check Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 115/135] team: Add vlan tx offload to hw_enc_features Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 116/135] tipc: initialise addr_trail_end when setting node addresses Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 117/135] xen/netback: Reset nr_frags before freeing skb Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 118/135] net/mlx5e: Only support tx/rx pause setting for port owner Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 119/135] bnxt_en: Fix VNIC clearing logic for 57500 chips Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 120/135] bnxt_en: Improve RX doorbell sequence Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 121/135] bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 122/135] bnxt_en: Suppress HWRM errors for HWRM_NVM_GET_VARIABLE command Sasha Levin
2019-08-22 17:07 ` [PATCH 5.2 123/135] bnxt_en: Use correct src_fid to determine direction of the flow Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 124/135] bnxt_en: Fix to include flow direction in L2 key Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 125/135] net sched: update skbedit action for batched events operations Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 126/135] tc-testing: updated skbedit action tests with batch create/delete Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 127/135] netdevsim: Restore per-network namespace accounting for fib entries Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 128/135] net/mlx5e: ethtool, Avoid setting speed to 56GBASE when autoneg off Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 129/135] net/mlx5e: Fix false negative indication on tx reporter CQE recovery Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 130/135] net/mlx5e: Remove redundant check in CQE recovery flow of tx reporter Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 131/135] net/mlx5e: Use flow keys dissector to parse packets for ARFS Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 132/135] net/tls: prevent skb_orphan() from leaking TLS plain text with offload Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 133/135] net: phy: consider AN_RESTART status when reading link status Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 134/135] netlink: Fix nlmsg_parse as a wrapper for strict message parsing Sasha Levin
2019-08-22 17:08 ` [PATCH 5.2 135/135] Linux 5.2.10-rc1 Sasha Levin
2019-08-22 17:26 ` [PATCH 5.2 000/135] 5.2.10-stable review Greg KH
2019-08-22 22:05 ` Stefan Lippers-Hollmann
2019-08-22 23:38 ` Greg KH
2019-08-23 0:42 ` Stefan Lippers-Hollmann
2019-08-23 6:28 ` Sasha Levin
2019-08-23 17:36 ` Greg KH
2019-08-24 1:18 ` Sasha Levin
2019-08-24 2:32 ` Greg KH
2019-08-24 5:48 ` Sasha Levin
2019-08-24 12:14 ` Greg KH
2019-08-22 20:57 ` kernelci.org bot
2019-08-23 2:08 ` Jon Hunter
2019-08-23 2:08 ` Jon Hunter
2019-08-23 8:09 ` Naresh Kamboju
2019-08-23 14:29 ` Guenter Roeck
2019-08-23 18:41 ` shuah
2019-08-23 22:05 ` Sasha Levin
2019-08-24 2:38 ` Greg KH
2019-08-24 15:21 ` shuah
2019-08-24 15:33 ` Greg KH
2019-08-24 17:01 ` shuah
2019-08-24 18:14 ` Greg KH
2019-08-24 21:49 ` shuah
2019-08-27 10:51 ` Sasha Levin
2019-08-25 0:08 ` shuah
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=20190822170811.13303-93-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=abbotti@mev.co.uk \
--cc=dcb314@hotmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.