From: Michael Benedict Date: Fri, 30 Aug 2019 14:24:16 +0000 (+1000) Subject: source: N950F DSH1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=refs%2Fheads%2Flineage-16.0;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git source: N950F DSH1 Signed-off-by: Michael Benedict --- diff --git a/drivers/staging/android/freecess.c b/drivers/staging/android/freecess.c index e8d9fd442fd5..af97bf7ccb72 100644 --- a/drivers/staging/android/freecess.c +++ b/drivers/staging/android/freecess.c @@ -281,11 +281,19 @@ static void recv_handler(struct sk_buff *skb) struct kfreecess_msg_data *payload = NULL; struct nlmsghdr *nlh = NULL; unsigned int msglen = 0; + uid_t uid = 0; if (!skb) { pr_err("recv_handler %s: skb is NULL!\n", __func__); return; } + + uid = (*NETLINK_CREDS(skb)).uid.val; + //only allow system user to communicate with Freecess kernel part. + if (uid != 1000) { + pr_err("freecess--uid: %d, permission denied\n", uid); + return; + } if (skb->len >= NLMSG_SPACE(0)) { nlh = nlmsg_hdr(skb); @@ -302,10 +310,15 @@ static void recv_handler(struct sk_buff *skb) pr_err("USER_HOOK_CALLBACK %s: dst_portid is %d not kernel!\n", __func__, payload->dst_portid); return; } + + if (!check_mod_type(payload->mod)) { + pr_err("USER_HOOK_CALLBACK %s: mod %d is not valid!\n", __func__, payload->mod); + return; + } - atomic_set(&bind_port[payload->mod], payload->src_portid); switch (payload->type) { case LOOPBACK_MSG: + atomic_set(&bind_port[payload->mod], payload->src_portid); dump_kfreecess_msg(payload); mod_sendmsg(LOOPBACK_MSG, payload->mod, NULL); break; diff --git a/drivers/video/fbdev/exynos/dpu/displayport_edid.c b/drivers/video/fbdev/exynos/dpu/displayport_edid.c index f8fe13c4967c..1a9442505817 100644 --- a/drivers/video/fbdev/exynos/dpu/displayport_edid.c +++ b/drivers/video/fbdev/exynos/dpu/displayport_edid.c @@ -68,11 +68,11 @@ struct displayport_supported_preset displayport_supported_presets[] = { {V4L2_DV_BT_CEA_4096X2160P60, 4096, 2160, 60, FB_VMODE_NONINTERLACED, 102, "4096x2160p@60"}, }; -videoformat ud_mode_h14b_vsdb[] = { - v3840x2160p_30Hz, - v3840x2160p_25Hz, - v3840x2160p_24Hz, - v4096x2160p_24Hz +struct displayport_supported_preset ud_mode_h14b_vsdb[] = { + {V4L2_DV_BT_CEA_3840X2160P30, 3840, 2160, 30, FB_VMODE_NONINTERLACED, 95, "3840x2160p@30"}, + {V4L2_DV_BT_CEA_3840X2160P25, 3840, 2160, 25, FB_VMODE_NONINTERLACED, 94, "3840x2160p@25"}, + {V4L2_DV_BT_CEA_3840X2160P24, 3840, 2160, 24, FB_VMODE_NONINTERLACED, 93, "3840x2160p@24"}, + {V4L2_DV_BT_CEA_4096X2160P24, 4096, 2160, 24, FB_VMODE_NONINTERLACED, 98, "4096x2160p@24"} }; const int displayport_pre_cnt = ARRAY_SIZE(displayport_supported_presets); @@ -426,10 +426,8 @@ static int edid_parse_audio_video_db(unsigned char *edid, struct fb_audio *sad) return 0; } -int static edid_dv_timing_to_fb_video(videoformat video, struct fb_videomode *fb) +int static edid_dv_timing_to_fb_video(struct displayport_supported_preset pre, struct fb_videomode *fb) { - struct displayport_supported_preset pre = displayport_supported_presets[video]; - fb->name = pre.name; fb->refresh = pre.refresh; fb->xres = pre.dv_timings.bt.width;