From 70f81fc7c3e93cb1653311738d6014de38673008 Mon Sep 17 00:00:00 2001 From: Jan-Simon Möller Date: Fri, 4 Nov 2016 21:20:14 +0100 Subject: Backport fix for CVE-2016-5195 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8da95aa22cf2ba90419a897a6f5880a9451b987e Signed-off-by: Jan-Simon Möller --- .../9999-Backport-fix-for-CVE-2016-5195.patch | 68 ++++++++++++++++++++++ .../recipes-kernel/linux/linux-renesas_3.10.bb | 3 + 2 files changed, 71 insertions(+) create mode 100644 meta-rcar-gen2/recipes-kernel/linux/linux-renesas/9999-Backport-fix-for-CVE-2016-5195.patch (limited to 'meta-rcar-gen2/recipes-kernel/linux') diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/9999-Backport-fix-for-CVE-2016-5195.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/9999-Backport-fix-for-CVE-2016-5195.patch new file mode 100644 index 0000000..e7a143f --- /dev/null +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/9999-Backport-fix-for-CVE-2016-5195.patch @@ -0,0 +1,68 @@ +From 8003e1524789537680204d44d5bf7a82561f8ba3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= +Date: Fri, 4 Nov 2016 20:58:46 +0100 +Subject: [PATCH] Backport fix for CVE-2016-5195 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Jan-Simon Möller +--- + include/linux/mm.h | 1 + + mm/memory.c | 14 ++++++++++++-- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/include/linux/mm.h b/include/linux/mm.h +index 3bf21c3..263b405 100644 +--- a/include/linux/mm.h ++++ b/include/linux/mm.h +@@ -1702,6 +1702,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma, + #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ + #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ + #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ ++#define FOLL_COW 0x4000 /* internal GUP flag */ + + typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, + void *data); +diff --git a/mm/memory.c b/mm/memory.c +index 48aa275..3a3f316 100644 +--- a/mm/memory.c ++++ b/mm/memory.c +@@ -1462,6 +1462,16 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + } + EXPORT_SYMBOL_GPL(zap_vma_ptes); + ++/* ++ * FOLL_FORCE can write to even unwritable pte's, but only ++ * after we've gone through a COW cycle and they are dirty. ++ */ ++static inline bool can_follow_write_pte(pte_t pte, unsigned int flags) ++{ ++ return pte_write(pte) || ++ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte)); ++} ++ + /** + * follow_page_mask - look up a page descriptor from a user-virtual address + * @vma: vm_area_struct mapping @address +@@ -1569,7 +1579,7 @@ split_fallthrough: + } + if ((flags & FOLL_NUMA) && pte_numa(pte)) + goto no_page; +- if ((flags & FOLL_WRITE) && !pte_write(pte)) ++ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags)) + goto unlock; + + page = vm_normal_page(vma, address, pte); +@@ -1876,7 +1886,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, + */ + if ((ret & VM_FAULT_WRITE) && + !(vma->vm_flags & VM_WRITE)) +- foll_flags &= ~FOLL_WRITE; ++ foll_flags |= FOLL_COW; + + cond_resched(); + } +-- +2.1.4 + diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb index 4ef7e25..010e362 100644 --- a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb @@ -156,6 +156,9 @@ SRC_URI_append_smack = " \ SRC_URI_append_porter = " file://can-rcar.cfg" +# Backport fix for CVE-2016-5195 +SRC_URI_append = " file://9999-Backport-fix-for-CVE-2016-5195.patch " + S = "${WORKDIR}/git" KERNEL_DEFCONFIG = "shmobile_defconfig" -- cgit 1.2.3-korg From b3036a9d0d264f1958e68fbf99efbb8fb9bd9487 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 8 Nov 2016 18:28:09 +0100 Subject: Change DA9063 I2C address to 0x5A since we are using high-speed interface Change-Id: I8b4031223a8e645c210ee7c86de8cd44913976cd Signed-off-by: Anton Gerasimov --- .../recipes-bsp/u-boot/u-boot/0004-uboot-porter-board-support.patch | 4 ++-- .../linux/linux-renesas/0008-Porter-board-support.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'meta-rcar-gen2/recipes-kernel/linux') diff --git a/meta-rcar-gen2/recipes-bsp/u-boot/u-boot/0004-uboot-porter-board-support.patch b/meta-rcar-gen2/recipes-bsp/u-boot/u-boot/0004-uboot-porter-board-support.patch index 846527b..0c48b09 100644 --- a/meta-rcar-gen2/recipes-bsp/u-boot/u-boot/0004-uboot-porter-board-support.patch +++ b/meta-rcar-gen2/recipes-bsp/u-boot/u-boot/0004-uboot-porter-board-support.patch @@ -403,9 +403,9 @@ index 0000000..e6ded08 + u8 val; + + i2c_init(CONFIG_SYS_I2C_SPEED, 0); -+ i2c_read(0x58, 0x13, 1, &val, 1); ++ i2c_read(0x5a, 0x13, 1, &val, 1); + val |= 0x02; -+ i2c_write(0x58, 0x13, 1, &val, 1); ++ i2c_write(0x5a, 0x13, 1, &val, 1); +} + +enum { diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0008-Porter-board-support.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0008-Porter-board-support.patch index 13fc68b..e452f0e 100644 --- a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0008-Porter-board-support.patch +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0008-Porter-board-support.patch @@ -1322,7 +1322,7 @@ index 0000000..d481ecd + +/* POWER IC */ +static struct i2c_board_info poweric_i2c[] = { -+ { I2C_BOARD_INFO("da9063", 0x58), }, ++ { I2C_BOARD_INFO("da9063", 0x5a), }, +}; + +static void porter_restart(char mode, const char *cmd) -- cgit 1.2.3-korg From bfdf1a0cfd9c8afbdf472345269037fb75f5c432 Mon Sep 17 00:00:00 2001 From: Harunobu Kurokawa Date: Wed, 21 Dec 2016 23:10:36 +0900 Subject: rcar-gen2: linux-renesas: Add audio patch to fix SPEC-365 Fix the issue that pulseaudio sometimes doesn't work correctly. Bug-AGL: SPEC-365 Change-Id: I30420d80691212a072d7604be6a3833c680bce1e Signed-off-by: Harunobu Kurokawa --- ...-ak4642-Replace-mdelay-function-to-msleep.patch | 29 ++++++++++++++++++++++ .../recipes-kernel/linux/linux-renesas_3.10.bb | 1 + 2 files changed, 30 insertions(+) create mode 100644 meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ASoC-ak4642-Replace-mdelay-function-to-msleep.patch (limited to 'meta-rcar-gen2/recipes-kernel/linux') diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ASoC-ak4642-Replace-mdelay-function-to-msleep.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ASoC-ak4642-Replace-mdelay-function-to-msleep.patch new file mode 100644 index 0000000..7bfff9a --- /dev/null +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ASoC-ak4642-Replace-mdelay-function-to-msleep.patch @@ -0,0 +1,29 @@ +From 21b85faf93b8028cfa477279354bedab93dcea04 Mon Sep 17 00:00:00 2001 +From: Harunobu Kurokawa +Date: Wed, 21 Dec 2016 11:27:34 +0900 +Subject: [PATCH] ASoC: ak4642: Replace mdelay function to msleep + +Replace mdelay to msleep to avoid busy loop on ak4642_lout_event(). +Otherwise, sometimes playback doesn't work correctly when pulseaudio was used. + +Signed-off-by: Harunobu Kurokawa +--- + sound/soc/codecs/ak4642.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c +index 40500cd..0205ae1 100644 +--- a/sound/soc/codecs/ak4642.c ++++ b/sound/soc/codecs/ak4642.c +@@ -186,7 +186,7 @@ static int ak4642_lout_event(struct snd_soc_dapm_widget *w, + break; + case SND_SOC_DAPM_POST_PMU: /* after widget power up */ + /* Power save mode OFF */ +- mdelay(popup_wait); ++ msleep(popup_wait); + snd_soc_update_bits(codec, SG_SL2, LOPS, 0); + break; + case SND_SOC_DAPM_PRE_PMD: /* before widget power down */ +-- +2.9.2 + diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb index 010e362..4d8e332 100644 --- a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas_3.10.bb @@ -17,6 +17,7 @@ SRC_URI = "${RENESAS_BACKPORTS_URL};protocol=git;branch=bsp/v3.10.31-ltsi/rcar-g file://0001-arm-koelsch-Add-vmalloc-384M-to-bootargs-of-DTS.patch \ file://0001-arm-alt-Add-vmalloc-384M-to-bootargs-of-DTS.patch \ file://0001-arm-gose-Add-vmalloc-384M-to-bootargs-of-DTS.patch \ + file://0001-ASoC-ak4642-Replace-mdelay-function-to-msleep.patch \ " SRC_URI_append_porter = " \ -- cgit 1.2.3-korg