From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Hans Petter Selasky <hps@selasky.org>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] Bad IOCTLs - time to fix them?
Date: Tue, 23 Mar 2021 14:20:47 +0100 [thread overview]
Message-ID: <20210323142031.7b727b1b@coco.lan> (raw)
In-Reply-To: <a957de07-96f9-b1cd-31e5-19c096e5f974@selasky.org>
Em Mon, 28 Dec 2020 16:21:05 +0100
Hans Petter Selasky <hps@selasky.org> escreveu:
> Hi,
>
> For some years now, FreeBSD's webcamd project at GitHub has carried
> patches to fix up IOCTL's in the Linux Kernel and I'm reaching out once
> again, that the bad read/write bits for certain IOCTLs may be seen as a
> security issue and should be fixed. These are:
>
> diff --git a/include/uapi/linux/dvb/ca.h b/include/uapi/linux/dvb/ca.h
> index dffa59e95ebb..c4533a16d93e 100644
> --- a/include/uapi/linux/dvb/ca.h
> +++ b/include/uapi/linux/dvb/ca.h
> @@ -134,9 +134,17 @@ struct ca_descr {
>
> #define CA_RESET _IO('o', 128)
> #define CA_GET_CAP _IOR('o', 129, struct ca_caps)
> +/*
> + * At least CA_GET_SLOT_INFO and CA_GET_MSG need to be _IOWR not _IOR.
> + * This is wrong on Linux too but there the driver doesn't care.
> + *
> #define CA_GET_SLOT_INFO _IOR('o', 130, struct ca_slot_info)
> #define CA_GET_DESCR_INFO _IOR('o', 131, struct ca_descr_info)
> #define CA_GET_MSG _IOR('o', 132, struct ca_msg)
> +*/
> +#define CA_GET_SLOT_INFO _IOWR('o', 130, struct ca_slot_info)
> +#define CA_GET_DESCR_INFO _IOR('o', 131, struct ca_descr_info)
> +#define CA_GET_MSG _IOWR('o', 132, struct ca_msg)
> #define CA_SEND_MSG _IOW('o', 133, struct ca_msg)
> #define CA_SET_DESCR _IOW('o', 134, struct ca_descr)
>
> diff --git a/include/uapi/linux/dvb/frontend.h
> b/include/uapi/linux/dvb/frontend.h
> index 4f9b4551c534..a5e950404072 100644
> --- a/include/uapi/linux/dvb/frontend.h
> +++ b/include/uapi/linux/dvb/frontend.h
> @@ -908,7 +908,8 @@ struct dtv_properties {
> #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
>
> #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
> -#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
> +#define FE_GET_PROPERTY _IOW('o', 83, struct dtv_properties)
> +#define FE_GET_PROPERTY_OLD _IOR('o', 83, struct dtv_properties)
>
> #if defined(__DVB_CORE__) || !defined(__KERNEL__)
Commenting just the issues related to the media subsystem. You should
forward the evdev ones to linux-input@vger.kernel.org.
This has been wrongly defined for so long time that I'm not sure if
it makes sense to fix.
If this is touched, we need to have _OLD versions for all the ioctls,
and the code also need to be changed in order to accept both ways.
So, at the current stage, this patch seems incomplete.
Thanks,
Mauro
prev parent reply other threads:[~2021-03-23 13:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 15:21 [PATCH] Bad IOCTLs - time to fix them? Hans Petter Selasky
2021-03-23 13:20 ` Mauro Carvalho Chehab [this message]
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=20210323142031.7b727b1b@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=hps@selasky.org \
--cc=linux-media@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.