From: Suraj Kandpal <suraj.kandpal(a)intel.com>
mainline inclusion
from mainline-v6.12-rc1
commit 31b42af516afa1e184d1a9f9dd4096c54044269a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB5KR6
CVE: CVE-2024-53051
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
drm/i915/hdcp: Add encoder check in intel_hdcp_get_capability
Sometimes during hotplug scenario or suspend/resume scenario encoder is
not always initialized when intel_hdcp_get_capability add
a check to avoid kernel null pointer dereference.
Signed-off-by: Suraj Kandpal <suraj.kandpal(a)intel.com>
Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane(a)intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240722064451.3610512-2-sura…
Conflicts:
drivers/gpu/drm/i915/display/intel_hdcp.c
[The conflict is that the name of the function intel_hdcp_capable
has been changed to intel_hdcp_get_capability in the mainline commit
8e754d9e9e8a068d18cba6618e099a1f24347c98. And in order to reduce the
scope of modification, only the code changes in the function are merged.]
Signed-off-by: Zhao Yipeng <zhaoyipeng5(a)huawei.com>
---
drivers/gpu/drm/i915/display/intel_hdcp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index cb99839afcd0..aa4c06b15190 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -142,11 +142,16 @@ int intel_hdcp_read_valid_bksv(struct intel_digital_port *dig_port,
/* Is HDCP1.4 capable on Platform and Sink */
bool intel_hdcp_capable(struct intel_connector *connector)
{
- struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
+ struct intel_digital_port *dig_port;
const struct intel_hdcp_shim *shim = connector->hdcp.shim;
bool capable = false;
u8 bksv[5];
+ if (!intel_attached_encoder(connector))
+ return capable;
+
+ dig_port = intel_attached_dig_port(connector);
+
if (!shim)
return capable;
--
2.34.1
From: Ignat Korchagin <ignat(a)cloudflare.com>
mainline inclusion
from mainline-v6.13-rc1
commit 811a7ca7320c062e15d0f5b171fe6ad8592d1434
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBEANB
CVE: CVE-2024-56603
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
On error can_create() frees the allocated sk object, but sock_init_data()
has already attached it to the provided sock object. This will leave a
dangling sk pointer in the sock object and may cause use-after-free later.
Signed-off-by: Ignat Korchagin <ignat(a)cloudflare.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent(a)wanadoo.fr>
Reviewed-by: Kuniyuki Iwashima <kuniyu(a)amazon.com>
Reviewed-by: Marc Kleine-Budde <mkl(a)pengutronix.de>
Link: https://patch.msgid.link/20241014153808.51894-5-ignat@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
Signed-off-by: Zhang Changzhong <zhangchangzhong(a)huawei.com>
---
net/can/af_can.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 7c80315..76b75de 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -189,6 +189,7 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
/* release sk on errors */
sock_orphan(sk);
sock_put(sk);
+ sock->sk = NULL;
}
errout:
--
2.9.5