linux-kernel.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,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Sasha Levin <alexander.levin@microsoft.com>
Subject: [PATCH 4.9 020/144] rtc: ensure rtc_set_alarm fails when alarms are not supported
Date: Wed,  1 Aug 2018 18:50:47 +0200	[thread overview]
Message-ID: <20180801164950.777761867@linuxfoundation.org> (raw)
In-Reply-To: <20180801164949.023217860@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

[ Upstream commit abfdff44bc38e9e2ef7929f633fb8462632299d4 ]

When using RTC_ALM_SET or RTC_WKALM_SET with rtc_wkalrm.enabled not set,
rtc_timer_enqueue() is not called and rtc_set_alarm() may succeed but the
subsequent RTC_AIE_ON ioctl will fail. RTC_ALM_READ would also fail in that
case.

Ensure rtc_set_alarm() fails when alarms are not supported to avoid letting
programs think the alarms are working for a particular RTC when they are
not.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/rtc/interface.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -359,6 +359,11 @@ int rtc_set_alarm(struct rtc_device *rtc
 {
 	int err;
 
+	if (!rtc->ops)
+		return -ENODEV;
+	else if (!rtc->ops->set_alarm)
+		return -EINVAL;
+
 	err = rtc_valid_tm(&alarm->time);
 	if (err != 0)
 		return err;



  parent reply	other threads:[~2018-08-01 17:27 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 16:50 [PATCH 4.9 000/144] 4.9.117-stable review Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 001/144] Input: elan_i2c - add ACPI ID for lenovo ideapad 330 Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 002/144] Input: i8042 - add Lenovo LaVie Z to the i8042 reset list Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 003/144] Input: elan_i2c - add another ACPI ID for Lenovo Ideapad 330-15AST Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 005/144] tracing: Fix double free of event_trigger_data Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 006/144] tracing: Fix possible double free in event_enable_trigger_func() Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 007/144] kthread, tracing: Dont expose half-written comm when creating kthreads Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 008/144] tracing/kprobes: Fix trace_probe flags on enable_trace_kprobe() failure Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 009/144] tracing: Quiet gcc warning about maybe unused link variable Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 010/144] arm64: fix vmemmap BUILD_BUG_ON() triggering on !vmemmap setups Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 012/144] kcov: ensure irq code sees a valid area Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 013/144] xen/netfront: raise max number of slots in xennet_get_responses() Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 014/144] ALSA: emu10k1: add error handling for snd_ctl_add Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 015/144] ALSA: fm801: " Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 016/144] nfsd: fix potential use-after-free in nfsd4_decode_getdeviceinfo Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 017/144] vfio: platform: Fix reset module leak in error path Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 018/144] mm: vmalloc: avoid racy handling of debugobjects in vunmap Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 019/144] mm/slub.c: add __printf verification to slab_err() Greg Kroah-Hartman
2018-08-01 16:50 ` Greg Kroah-Hartman [this message]
2018-08-01 16:50 ` [PATCH 4.9 021/144] perf tools: Fix pmu events parsing rule Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 022/144] netfilter: ipset: List timing out entries with "timeout 1" instead of zero Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 023/144] infiniband: fix a possible use-after-free bug Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 024/144] powerpc/eeh: Fix use-after-release of EEH driver Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 025/144] hvc_opal: dont set tb_ticks_per_usec in udbg_init_opal_common() Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 026/144] powerpc/64s: Fix compiler store ordering to SLB shadow area Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 027/144] RDMA/mad: Convert BUG_ONs to error flows Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 028/144] netfilter: nf_tables: check msg_type before nft_trans_set(trans) Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 029/144] pnfs: Dont release the sequence slot until weve processed layoutget on open Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 030/144] disable loading f2fs module on PAGE_SIZE > 4KB Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 031/144] f2fs: fix error path of move_data_page Greg Kroah-Hartman
2018-08-01 16:50 ` [PATCH 4.9 032/144] f2fs: fix to dont trigger writeback during recovery Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 033/144] f2fs: fix to wait page writeback during revoking atomic write Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 034/144] f2fs: Fix deadlock in shutdown ioctl Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 035/144] f2fs: fix race in between GC and atomic open Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 036/144] usbip: usbip_detach: Fix memory, udev context and udev leak Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 037/144] perf/x86/intel/uncore: Correct fixed counter index check in generic code Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 038/144] perf/x86/intel/uncore: Correct fixed counter index check for NHM Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 040/144] iwlwifi: pcie: fix race in Rx buffer allocator Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 041/144] Bluetooth: hci_qca: Fix "Sleep inside atomic section" warning Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 042/144] Bluetooth: btusb: Add a new Realtek 8723DE ID 2ff8:b011 Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 043/144] ASoC: dpcm: fix BE dai not hw_free and shutdown Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 044/144] mfd: cros_ec: Fail early if we cannot identify the EC Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 045/144] mwifiex: handle race during mwifiex_usb_disconnect Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 046/144] wlcore: sdio: check for valid platform device data before suspend Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 047/144] media: tw686x: Fix incorrect vb2_mem_ops GFP flags Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 048/144] media: videobuf2-core: dont call memop finish when queueing Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 049/144] btrfs: add barriers to btrfs_sync_log before log_commit_wait wakeups Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 050/144] btrfs: qgroup: Finish rescan when hit the last leaf of extent tree Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 051/144] PCI: Prevent sysfs disable of device while driver is attached Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 052/144] ath: Add regulatory mapping for FCC3_ETSIC Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 053/144] ath: Add regulatory mapping for ETSI8_WORLD Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 054/144] ath: Add regulatory mapping for APL13_WORLD Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 055/144] ath: Add regulatory mapping for APL2_FCCA Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 056/144] ath: Add regulatory mapping for Uganda Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 057/144] ath: Add regulatory mapping for Tanzania Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 058/144] ath: Add regulatory mapping for Serbia Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 059/144] ath: Add regulatory mapping for Bermuda Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 060/144] ath: Add regulatory mapping for Bahamas Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 065/144] powerpc/8xx: fix invalid register expression in head_8xx.S Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 066/144] pinctrl: at91-pio4: add missing of_node_put Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 067/144] bpf: powerpc64: pad function address loads with NOPs Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 068/144] PCI: pciehp: Request control of native hotplug only if supported Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 070/144] mwifiex: correct histogram data with appropriate index Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 071/144] ima: based on policy verify firmware signatures (pre-allocated buffer) Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 072/144] drivers/perf: arm-ccn: dont log to dmesg in event_init Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 073/144] fscrypt: use unbound workqueue for decryption Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 074/144] scsi: ufs: fix exception event handling Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 075/144] ALSA: emu10k1: Rate-limit error messages about page errors Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 076/144] regulator: pfuze100: add .is_enable() for pfuze100_swb_regulator_ops Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 077/144] md: fix NULL dereference of mddev->pers in remove_and_add_spares() Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 078/144] ixgbevf: fix MAC address changes through ixgbevf_set_mac() Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 079/144] media: smiapp: fix timeout checking in smiapp_read_nvm Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 080/144] net: ethernet: ti: cpsw-phy-sel: check bus_find_device() ret value Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 081/144] ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 082/144] arm64: cmpwait: Clear event register before arming exclusive monitor Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 083/144] HID: hid-plantronics: Re-resend Update to map button for PTT products Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 084/144] drm/radeon: fix mode_valids return type Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 086/144] HID: i2c-hid: check if device is there before really probing Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 087/144] EDAC, altera: Fix ARM64 build warning Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 088/144] ARM: dts: emev2: Add missing interrupt-affinity to PMU node Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 089/144] ARM: dts: sh73a0: " Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 090/144] nvmem: properly handle returned value nvmem_reg_read Greg Kroah-Hartman
2018-08-01 16:51 ` [PATCH 4.9 091/144] tty: Fix data race in tty_insert_flip_string_fixed_flag Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 093/144] media: rcar_jpu: Add missing clk_disable_unprepare() on error in jpu_open() Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 094/144] libata: Fix command retry decision Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 095/144] media: media-device: fix ioctl function types Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 096/144] media: saa7164: Fix driver name in debug output Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 097/144] mtd: rawnand: fsl_ifc: fix FSL NAND driver to read all ONFI parameter pages Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 098/144] brcmfmac: Add support for bcm43364 wireless chipset Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 099/144] s390/cpum_sf: Add data entry sizes to sampling trailer entry Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 100/144] perf: fix invalid bit in diagnostic entry Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 101/144] bnxt_en: Check unsupported speeds in bnxt_update_link() on PF only Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 102/144] scsi: 3w-9xxx: fix a missing-check bug Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 103/144] scsi: 3w-xxxx: " Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 104/144] scsi: megaraid: silence a static checker bug Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 105/144] staging: lustre: o2iblnd: fix race at kiblnd_connect_peer Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 106/144] thermal: exynos: fix setting rising_threshold for Exynos5433 Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 107/144] bpf: fix references to free_bpf_prog_info() in comments Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 108/144] media: siano: get rid of __le32/__le16 cast warnings Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 109/144] drm/atomic: Handling the case when setting old crtc for plane Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 110/144] ALSA: hda/ca0132: fix build failure when a local macro is defined Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 111/144] mmc: dw_mmc: update actual clock for mmc debugfs Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 112/144] mmc: pwrseq: Use kmalloc_array instead of stack VLA Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 113/144] dt-bindings: pinctrl: meson: add support for the Meson8m2 SoC Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 114/144] dt-bindings: net: meson-dwmac: new compatible name for AXG SoC Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 115/144] fasync: Fix deadlock between task-context and interrupt-context kill_fasync() Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 116/144] stop_machine: Use raw spinlocks Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 117/144] memory: tegra: Do not handle spurious interrupts Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 118/144] memory: tegra: Apply interrupts mask per SoC Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 120/144] drm/gma500: fix psb_intel_lvds_mode_valid()s return type Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 121/144] ipconfig: Correctly initialise ic_nameservers Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 122/144] rsi: Fix invalid vdd warning in mmc Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 124/144] staging: lustre: llite: correct removexattr detection Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 125/144] staging: lustre: ldlm: free resource when ldlm_lock_create() fails Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 126/144] serial: core: Make sure compiler barfs for 16-byte earlycon names Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 127/144] microblaze: Fix simpleImage format generation Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 128/144] usb: hub: Dont wait for connect state at resume for powered-off ports Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 129/144] crypto: authencesn - dont leak pointers to authenc keys Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 130/144] crypto: authenc " Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 131/144] media: omap3isp: fix unbalanced dma_iommu_mapping Greg Kroah-Hartman
2018-08-01 18:34   ` Pavel Machek
2018-08-01 16:52 ` [PATCH 4.9 132/144] scsi: scsi_dh: replace too broad "TP9" string with the exact models Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 133/144] scsi: megaraid_sas: Increase timeout by 1 sec for non-RAID fastpath IOs Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 134/144] media: si470x: fix __be16 annotations Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 136/144] random: mix rdrand with entropy sent in from userspace Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 137/144] squashfs: be more careful about metadata corruption Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 138/144] ext4: fix inline data updates with checksums enabled Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 139/144] ext4: check for allocation block validity with block group locked Greg Kroah-Hartman
2018-08-01 16:52 ` [PATCH 4.9 140/144] RDMA/uverbs: Protect from attempts to create flows on unsupported QP Greg Kroah-Hartman
2018-08-01 17:52 ` [PATCH 4.9 000/144] 4.9.117-stable review Nathan Chancellor
2018-08-02  6:59   ` Greg Kroah-Hartman
2018-08-01 23:38 ` Shuah Khan
2018-08-02  6:59 ` Naresh Kamboju
2018-08-03  6:28   ` Naresh Kamboju
2018-08-02 15:42 ` Guenter Roeck

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=20180801164950.777761867@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@microsoft.com \
    --cc=alexandre.belloni@bootlin.com \
    --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 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).