mbox series

[GIT,PULL,FOR,v6.12] cec core fix/improvement

Message ID 5626252b-cea1-41b7-89f4-b4e68e2e09c9@xs4all.nl (mailing list archive)
State New
Headers show
Series [GIT,PULL,FOR,v6.12] cec core fix/improvement | expand

Pull-request

git://linuxtv.org/hverkuil/media_tree.git tags/br-v6.12b

Message

Hans Verkuil Aug. 8, 2024, 10:37 a.m. UTC
Hi Mauro,

After adding the new CEC_MSG_FL_REPLY_VENDOR_ID flag I discovered that the
cec_msg_set_reply_to() helper in the public cec.h header never set the flags
field to 0. Application code that never initialized struct cec_msg and that
used this helper function could end up with a random value in the flags field.

With the original two flags this had very limited impact (i.e. it was not
very likely that this would cause transmit errors), but after adding the
new flag, this could easily cause a transmit to be rejected if it was
inadvertently set and it was used with a message other than
CEC_MSG_VENDOR_COMMAND_WITH_ID since that would now return -EINVAL.

This PR adds two patches: one properly zeroes the flags field in
cec_msg_set_reply_to() (marked for stable), the second improves the
handling of the new flag by clearing it unless it is used in combination
with the CEC_MSG_VENDOR_COMMAND_WITH_ID message, rather than returning
-EINVAL as it did originally.

Regards,

	Hans

The following changes since commit e7311aa47a6ac355558bc65512aa7c381f8506ec:

  media: siano: Simplify smscore_load_firmware_from_file (2024-08-05 16:30:24 +0200)

are available in the Git repository at:

  git://linuxtv.org/hverkuil/media_tree.git tags/br-v6.12b

for you to fetch changes up to 4428fcb0fc70cc718c826d8e2940043d884e851a:

  media: cec: cec-adap.c: improve CEC_MSG_FL_REPLY_VENDOR_ID check (2024-08-08 11:14:29 +0200)

----------------------------------------------------------------
Tag branch

----------------------------------------------------------------
Hans Verkuil (2):
      media: uapi/linux/cec.h: cec_msg_set_reply_to: zero flags
      media: cec: cec-adap.c: improve CEC_MSG_FL_REPLY_VENDOR_ID check

 drivers/media/cec/core/cec-adap.c | 11 ++++++-----
 include/uapi/linux/cec.h          |  6 +++++-
 2 files changed, 11 insertions(+), 6 deletions(-)