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, Christian Holpert <christian@holpert.de>,
	Sean Young <sean@mess.org>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Subject: [PATCH 5.0 14/25] media: Revert "media: rc: some events are dropped by userspace"
Date: Tue, 12 Mar 2019 10:08:52 -0700	[thread overview]
Message-ID: <20190312170404.596258547@linuxfoundation.org> (raw)
In-Reply-To: <20190312170403.643852550@linuxfoundation.org>

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

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

From: Sean Young <sean@mess.org>

commit 05f0edadcc5fccdfc0676825b3e70e75dc0a8a84 upstream.

When an rc device is created, we do not know what key codes it will
support, since a new keymap might be loaded at some later point. So,
we set all keybit in the input device.

The uevent for the input device includes all the key codes, of which
there are now 768. This overflows the size of the uevent
(UEVENT_BUFFER_SIZE) and no event is generated.

Revert for now until we figure out a different solution.

This reverts commit fec225a04330d0f222d24feb5bea045526031675.

Cc: <stable@vger.kernel.org> # 4.20+
Reported-by: Christian Holpert <christian@holpert.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/rc/rc-main.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -274,6 +274,7 @@ static unsigned int ir_update_mapping(st
 				      unsigned int new_keycode)
 {
 	int old_keycode = rc_map->scan[index].keycode;
+	int i;
 
 	/* Did the user wish to remove the mapping? */
 	if (new_keycode == KEY_RESERVED || new_keycode == KEY_UNKNOWN) {
@@ -288,9 +289,20 @@ static unsigned int ir_update_mapping(st
 			old_keycode == KEY_RESERVED ? "New" : "Replacing",
 			rc_map->scan[index].scancode, new_keycode);
 		rc_map->scan[index].keycode = new_keycode;
+		__set_bit(new_keycode, dev->input_dev->keybit);
 	}
 
 	if (old_keycode != KEY_RESERVED) {
+		/* A previous mapping was updated... */
+		__clear_bit(old_keycode, dev->input_dev->keybit);
+		/* ... but another scancode might use the same keycode */
+		for (i = 0; i < rc_map->len; i++) {
+			if (rc_map->scan[i].keycode == old_keycode) {
+				__set_bit(old_keycode, dev->input_dev->keybit);
+				break;
+			}
+		}
+
 		/* Possibly shrink the keytable, failure is not a problem */
 		ir_resize_table(dev, rc_map, GFP_ATOMIC);
 	}
@@ -1750,7 +1762,6 @@ static int rc_prepare_rx_device(struct r
 	set_bit(EV_REP, dev->input_dev->evbit);
 	set_bit(EV_MSC, dev->input_dev->evbit);
 	set_bit(MSC_SCAN, dev->input_dev->mscbit);
-	bitmap_fill(dev->input_dev->keybit, KEY_CNT);
 
 	/* Pointer/mouse events */
 	set_bit(EV_REL, dev->input_dev->evbit);



  parent reply	other threads:[~2019-03-12 17:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 17:08 [PATCH 5.0 00/25] 5.0.2-stable review Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 01/25] media: uvcvideo: Fix type check leading to overflow Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 02/25] Input: wacom_serial4 - add support for Wacom ArtPad II tablet Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 03/25] Input: elan_i2c - add id for touchpad found in Lenovo s21e-20 Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 04/25] iscsi_ibft: Fix missing break in switch statement Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 05/25] scsi: aacraid: " Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 06/25] x86/PCI: Fixup RTIT_BAR of Intel Denverton Trace Hub Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 07/25] arm64: dts: zcu100-revC: Give wifi some time after power-on Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 08/25] arm64: dts: hikey: " Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 09/25] arm64: dts: hikey: Revert "Enable HS200 mode on eMMC" Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 10/25] ARM: dts: exynos: Fix pinctrl definition for eMMC RTSN line on Odroid X2/U3 Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 11/25] ARM: dts: exynos: Add minimal clkout parameters to Exynos3250 PMU Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 12/25] ARM: dts: exynos: Fix max voltage for buck8 regulator on Odroid XU3/XU4 Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 13/25] drm: disable uncached DMA optimization for ARM and arm64 Greg Kroah-Hartman
2019-03-12 17:08 ` Greg Kroah-Hartman [this message]
2019-03-12 17:08 ` [PATCH 5.0 15/25] Revert "PCI/PME: Implement runtime PM callbacks" Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 16/25] bpf: Stop the psock parser before canceling its work Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 17/25] gfs2: Fix missed wakeups in find_insert_glock Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 18/25] staging: erofs: keep corrupted fs from crashing kernel in erofs_namei() Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 19/25] staging: erofs: compressed_pages should not be accessed again after freed Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 20/25] scripts/gdb: replace flags (MS_xyz -> SB_xyz) Greg Kroah-Hartman
2019-03-12 17:08 ` [PATCH 5.0 21/25] ath9k: Avoid OF no-EEPROM quirks without qca,no-eeprom Greg Kroah-Hartman
2019-03-12 17:09 ` [PATCH 5.0 22/25] perf/x86/intel: Make cpuc allocations consistent Greg Kroah-Hartman
2019-03-12 17:09 ` [PATCH 5.0 23/25] perf/x86/intel: Generalize dynamic constraint creation Greg Kroah-Hartman
2019-03-12 17:09 ` [PATCH 5.0 24/25] x86: Add TSX Force Abort CPUID/MSR Greg Kroah-Hartman
2019-03-12 17:09 ` [PATCH 5.0 25/25] perf/x86/intel: Implement support for TSX Force Abort Greg Kroah-Hartman
2019-03-13  8:57 ` [PATCH 5.0 00/25] 5.0.2-stable review Naresh Kamboju
2019-03-13 17:37 ` Jon Hunter
2019-03-13 20:36 ` Guenter Roeck
2019-03-13 20:59   ` Greg Kroah-Hartman

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=20190312170404.596258547@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=christian@holpert.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=sean@mess.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).