Commit Graph

649588 Commits

Author SHA1 Message Date
Jiamin Ma
ab2a0dd78f DTS: fix compile warnings [1/1]
PD#SWPL-12245

Problem:
Warning (resets_property): Missing property '#reset-cells'

Solution:
Add #reset-cells to node clock-controller

Verify:
P212

Change-Id: I5bc01ab88774be2088764ee6fb0eb9a863894ca2
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2020-06-29 11:45:47 +09:00
Qianggui Song
44cb00d7cf irqchip: sm1 support double-edge gpio irq trigger [1/1]
PD#SWPL-5395

Problem:
sm1 support double-edge trigger, current code do not support.

Solution:
add relatvie bitmask to support this function.

Verify:
ptm & sm1_skt

Change-Id: I48ebc9b38db868f946c49b6fd5f98d427b2669df
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:47 +09:00
Tao Zeng
6c72eb1412 ramdump: write compressed data [2/2]
PD#SWPL-6193

Problem:
ramdump need write compressed data to persist storage device.
But if we write it under uboot, it may cause journal and block
bitmap mismatch due to different version of file system. This
caused kernel panic after ramdump finished.

Solution:
Write compressed data under kernel.
This change also removed some extern function of ramdump since
we use sticky register to store ramdump information.

Verify:
p212

Change-Id: Idd83ec6ead4783918b90a39cf716fd3117402278
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2020-06-29 11:45:47 +09:00
Shunzhou Jiang
e56c051873 clk: sm1: add sm1 dsu clk notify for change dsu freq [1/1]
PD#SWPL-8145

Problem:
dsu clk can't change freq

Solution:
add sm1 dsu clk notify

Verify:
sm1_skt

Change-Id: If3ecf1066b49c07e6af69ce342956cb0469a5f87
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
2020-06-29 11:45:47 +09:00
Lei Qian
1ba443cfdc clock: merge from mainline
PD#SWPL-15312

Change-Id: Icf34b5ebe85efb0565536144df854bc56ebd4791
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
2020-06-29 11:45:47 +09:00
Jian Hu
44f39642cc clk: x301: cpu hangup when play 3D game [1/1]
PD#SWPL-9471

Problem:
it will hangup when play 3D game for a long time

Solution:
using the origin clk-mux ops to register cpu clock

Verify:
test passed on x301

Change-Id: I1b977e3a9559ef5f376d4cb8a4735e943c07f525
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2020-06-29 11:45:46 +09:00
Ao Xu
a982972fc4 drm: solve debug node write string issue [1/1]
PD#SWPL-15143

Problem:
userspace program use the write() syscall to write the node.
when write the strlen() length content, it will fail.

Solution:
use the buf[size] to instead of buf[size-1]

Verify:
U200

Change-Id: I886d9a1cbf3da459476bca76c9a5708ecbc20afe
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:46 +09:00
Dezhi Kong
cab45b3348 drm: merge commit related to gamma [1/1]
PD#SWPL-11059

Problem:
gamma setting in DRM

Solution:
merge commit related to gamma

Author: Ao Xu <ao.xu@amlogic.com>
Date:   Tue Oct 30 19:18:21 2018 +0800

    drm: add meson private property gamma_lut

    When setting CTM, gamma is also set again.
    Setting gamma frequently will lead to visual glitches.
    Add a private value to record whether
    gamma_lut blob is changed.

    Bug: b/113682067
    Test: Ran on device and changed gamma to verify there are no glitches

Author: Fergus Simpson <afergs@google.com>
Date:   Fri Aug 10 13:18:36 2018 -0700

    [Estelle] Enable top/bottom color clamping

    Modifies amvecm's color clipping to allow either the lower or upper
    limit to be set. This sets clipping registers that hold the top and
    bottom 10-bit clipping values for each color channel.

    This does not cause the artifacts that we've been seeing while trying
    enable the gamma tables.

    Usage (set a clip of 32/255):
    echo 20080020 > /sys/class/amvecm/color_bottom

    Bug: 109942195
    Test: Flashed to device and tested with a internal changes that use the
          registers.

Author: Frank Chen <frank.chen@amlogic.com>
Date:   Wed Aug 8 15:21:17 2018 +0800

    remove gamma_enable in am_meson_crtc_create

Verify:
verify by u200

Change-Id: I4221b3b4671516e7afd4dea14ce3cd71b4b66433
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
2020-06-29 11:45:46 +09:00
Ao Xu
d45e20a596 drm: add gem import interface to support drm-hwc [1/1]
PD#SWPL-11320

Problem:
current gem driver have not implementted the import interface.
For drm-hwc in android, gralloc allocate the dumb buffer, it
should use the import interface to import the allocated buffer
to the drm driver.

Solution:
implement the gem import interface

Verify:
g12a-u200

Change-Id: I32f7705fd67853a1000875b2af69fcaf700330e1
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:46 +09:00
Dezhi Kong
455c74d2d8 drm: add TL1 drm support [1/1]
PD#SWPL-7987

Problem:
TL1 DRM support

Solution:
add TL1 DRM support

Verify:
t962x2_x301

Change-Id: Ibc8ff641f42c0a416e80c3a420c1d808e0ad8b26
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
2020-06-29 11:45:46 +09:00
lingjie li
c945cbd1a3 drm: start hdcp work when the "Content Protection" was set thought atomic [1/1]
PD#SWPL-4866

Problem:
1. The old implement not support atomic. (the atomic check on am_meson
hdmi.c will disable CP,The set property function will not reached when
use atomic set CP)
2. The hdcp work kthread start and terminal not match cause coredump.

Problem:
need add hdcp function.

Solution:
Start hdcp work when the encoder enabled.stop when encoder disabled.
modified hdcp work state machine.

Verify:
On u212 drm backend, use drm-helper-client to set CP property.
need enable atomic on wayland.based on below CL
http://scgit.amlogic.com:8080/#/c/78810/1
http://scgit.amlogic.com:8080/#/c/78804/2
http://scgit.amlogic.com:8080/#/c/78811/1

Change-Id: If213b7def89ff1f1ec63b866a21a3323e098786f
Signed-off-by: lingjie li <lingjie.li@amlogic.com>
2020-06-29 11:45:46 +09:00
lingjie li
ecb536d3db osd: update osd_count according to the chip [2/4]
PD#SWPL-3996

Problem:
g12b/g12a wayland-drm device print below error
"fb: error osd index=0" while start wayland-client.
while start wayland-client.

Solution:
set to the proper osd_count

Verify:
W400

Change-Id: I3c4c6d821ff0778cd4912a67046f7dbab60be2ad
Signed-off-by: lingjie li <lingjie.li@amlogic.com>
2020-06-29 11:45:46 +09:00
Ao Xu
4d4e4149c0 drm: add meson drm debugfs node [1/1]
PD#SWPL-12289

Problem:
drm driver has no debug sysfs file

Solution:
add follow sysfs node
1. dump the osd register
/sys/kernel/debug/dri/%minor%/vpu/reg_dump
2. dump the gem buffer image
/sys/kernel/debug/dri/%minor%/vpu/dump
3. set the gem buffer image store path
/sys/kernel/debug/dri/%minor%/vpu/imgpath
4. set 1 to disable the osd plane
/sys/kernel/debug/dri/%minor%/vpu/blank

Verify:
g12a-u200

Change-Id: I10746d65b09d3b530dc22720b8cee669fa120dde
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:46 +09:00
Ao Xu
0d1925d781 drm: add afbc support in drm driver [1/1]
PD#SWPL-13092

Problem:
drm driver has no drm support

Solution:
add afbc block support

Verify:
g12a-u200

Change-Id: If2e57b63032e9f93be800bda652b80e560163231
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:46 +09:00
Dezhi Kong
91e5facadb drm: add sm1 support [1/1]
PD#SWPL-8061

Problem:
SM1 support

Solution:
add sm1 support

Verify:
verify by ac200 with modetest command

Change-Id: Id79f227afa7f7dbcaad09887f8bdbd1f64b93c4a
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
2020-06-29 11:45:46 +09:00
Dezhi Kong
ab623e744d drm: add multi-layer support [1/1]
PD#SWPL-9646

Problem:
unsupport multi-layer

Solution:
add multi-layer support

Verify:
verify by w400 with modetest command

Change-Id: I5cd50761d2ab9cfff0f80d38e20455044c7a33fd
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
2020-06-29 11:45:46 +09:00
yao liu
098824072d DV: playback bl+el black screen [1/1]
PD#SWPL-7872

Problem:
TM2 special case , vd2 afbc can't work on TM2

Solution:
Process bl+el as SDR on TM2

Verify:
T962e2

Change-Id: I2433b72c4b5548e75665aba9623a29cd5f12d202
Signed-off-by: yao liu <yao.liu@amlogic.com>
2020-06-29 11:45:45 +09:00
Luke Go
900d412085 tmp
Change-Id: Iba93a2353a0792553a39f70578e9a024aa6fa88b
2020-06-29 11:45:45 +09:00
Pengcheng Chen
9f2c11d704 osd: add osd sw_sync [1/1]
PD#SWPL-9736

Problem:
osd fence crash when play AIV H264 video

Solution:
add osd sw_sync

Verify:
Verified with raven,w400

Change-Id: I309af0e3718221e2309460a990ef0badb9e8bd39
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2020-06-29 11:45:45 +09:00
Luke Go
dee0572dd6 IEEEOUI to ieeeoui
Change-Id: I266d8e8ea51f49c6c58c0fbeea5d77fab89a5e5a
2020-06-29 11:45:45 +09:00
Nian Jing
0664273f62 tvafe: add atv format get func [1/1]
PD#TV-1586

Problem:
no atv format get func

Solution:
Add atv format get func

Verify:
verified by x301

Change-Id: Ia43d5a67370d2b025e1b32833a5408a5e7d251d4
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
2020-06-29 11:45:45 +09:00
Evoke Zhang
f93549bc47 tvafe: fine tune ntsc-m recurrence [1/1]
PD#TV-6007

Problem:
ATV scan range is not qualified

Solution:
1.change 0x128 from 0x140008 to 0x1f0008 for ntsc-m
2.support cutwindow adjust debug:
    echo h index val >/sys/class/tvafe/tvafe0/cutwin
    echo v index val >/sys/class/tvafe/tvafe0/cutwin
    echo r >/sys/class/tvafe/tvafe0/cutwin
3.support cutwindow config in dts

Verify:
x301

Change-Id: Idc3a3e8857cea2462da6edcbbf4ffefab6d48f7b
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2020-06-29 11:45:45 +09:00
Evoke Zhang
69fd2c7b16 tvafe: update parameters for AV NTSC [1/1]
PD#SWPL-7283

Problem:
display is not good

Solution:
modify cvd2 0xb0, 0xb1 reg value

Verify:
x301

Change-Id: Ib512258336d3a6bb14c4eda04488fbaf60e38af0
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2020-06-29 11:45:45 +09:00
yao liu
fc433996d7 dv: enable drop frame for dv [1/1]
PD#SWPL-13115

Problem:
Apk drop lots of frames before render
the first frame, in this case, omx_run
is false and no frames will render.
Decoder doesn't have free output buffer.

Solution:
Drop dv frames in video sync before render
the first frame if app want to drop.

Verify:
Verified on U212

Change-Id: I463619f658d7f78ad8d513e17ca78482e17b3a4e
Signed-off-by: yao liu <yao.liu@amlogic.com>
2020-06-29 11:45:45 +09:00
Evoke Zhang
e04a70e982 vpu: add tm2 support [1/1]
PD#SWPL-6397

Problem:
tm2 is a new chip

Solution:
add vpu driver support for tm2

Verify:
pxp

Change-Id: I19275c513b68fba8feced37f1ff8fca9bf48d395
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2020-06-29 11:45:44 +09:00
Shuai Li
47408422ea audio: mclk pad0 doesn't output clk [1/1]
PD#OTT-5603

Problem:
Configurate GPIO_AO 9 as mclk_0,it doesn't work.

Solution:
From SM1, the mclk pad register is changed.
Using standard clk tree to make it compitable.

Verify:
TM2, SM1.

Change-Id: I8d53296297536c90768495232570f33fc89db131
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
2020-06-29 11:45:44 +09:00
Kaifu Hu
b0193feb46 hdmitx: add 3d framepack mode support [1/1]
PD#SWPL-4233

Problem:
3D framepacking mode display black screen

Solution:
Add vinfo 3d flag and hdmitx update
when work 3d mode

Verify:
U212

Change-Id: Ia2b7b25c9ed401dbec2c487ea2a5c6cc1e0d8b8d
Signed-off-by: Kaifu Hu <kaifu.hu@amlogic.com>
2020-06-29 11:45:44 +09:00
Lei Qian
33b1ffea56 include: merge from mainline
PD#SWPL-15312

Change-Id: Ia2357535da1b5dc9b595ed2e810469277c6682c7
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
2020-06-29 11:45:44 +09:00
Evoke Zhang
c5855e5c32 tvafe: support nostd config nostd_vs_th in dts [1/1]
PD#TV-6046

Problem:
nostd atv display flicker

Solution:
config nostd_vs_th in dts for special tuner

Verify:
x301

Change-Id: Ibdb6422b0a9f031dab0a88b1654c566bcaa0c0d0
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2020-06-29 11:45:44 +09:00
Evoke Zhang
62a2168d6a tvafe: change force_nostd adjust to sysfs node [1/1]
PD#TV-5482

Problem:
Image flicker for non-std avin,
because the force_nostd parameter is modified to a unsuitable value.

Solution:
remove force_nostd paramete,
add sysfs node support for force_nostd

Verify:
x301

Change-Id: Ic50a311c6b5a63bcbd1d56651713de5be60a38a2
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2020-06-29 11:45:44 +09:00
changqing.gao
ceff2f8513 fs: KASAN error in nls uniname cmp [1/1]
PD#SWPL-6404

Problem:
KASAN error:global-out-of-bounds in nls_uniname_cmp

Solution:
Append "\0\0" to the string of UNI_CUR_DIR_NAME and UNI_PAR_DIR_NAME

Verify:
x301

Change-Id: Ic94e837ed7874d337207c31eedfc966b46ab8ecd
Signed-off-by: changqing.gao <changqing.gao@amlogic.com>
2020-06-29 11:45:44 +09:00
Hanjie Lin
c329f60c6b sdcardfs: revert because compile fail [1/1]
PD#SWPL-15901

Problem:
Revert "RAVENPLAT-277: Kernel components sdcardfs - CVE-2018-9514 [1/1]"

Solution:
This reverts commit d03e7aa0704f2165d357337d77041041ac14af27.

Platform:
Raven

Verify:
Raven

Change-Id: I6110ce2290dc763146d1de68d86ab227a3cb8890
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:44 +09:00
Hanjie Lin
ac7c8de0a8 ext4: always initialize the crc32c checksum driver [1/1]
PD#SWPL-15901

Problem:
OTT-6792
upstream a45403b515

The extended attribute code now uses the crc32c checksum for hashing
purposes, so we should just always always initialize it.  We also want
to prevent NULL pointer dereferences if one of the metadata checksum
features is enabled after the file sytsem is originally mounted.

This issue has been assigned CVE-2018-1094.

https://bugzilla.kernel.org/show_bug.cgi?id=199183
https://bugzilla.redhat.com/show_bug.cgi?id=1560788

Solution:

Verify:

Change-Id: I30362945537ff4aa05fbf8e83dc52c25b3d24586
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:44 +09:00
Hanjie Lin
be15e1f813 RAVENPLAT-310: Kernel components ext4 filesystem - CVE-2018-10880[1/1]
PD#SWPL-15901

Problem:
In ext4_xattr_make_inode_space of xattr.c, there is a possible out-of-bounds
write due to improper input validation. This could lead to local escalation
of privilege in the kernel with no additional execution privileges needed.
User interaction is needed for exploitation.

Solution:
The fix is designed to never move system.data out of the inode.

Platform:
Raven

Verify:
Raven

Change-Id: I0820e6e84c8a5ab7d40d14ce14c11f9f8e1f9503
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:44 +09:00
Hanjie Lin
d5a35d151f RAVENPLAT-277: Kernel components sdcardfs - CVE-2018-9514 [1/1]
PD#SWPL-15901

Problem:
In sdcardfs_open of file.c, there is a possible Use After Free
due to an unusual root cause. This could lead to local escalation
of privilege with no additional execution privileges needed.
User interaction is not needed for exploitation.

Solution:
The fix is designed to avoid the OVERRIDE_CRED macro in favor
of more explicit control flow.

Platform:
Raven

Verify:
Raven

Change-Id: Idab016c33c2dfbd9425533ed5c5501b671677572
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:44 +09:00
Sriram Rajagopalan
01c5015da5 Android Security Bulletin - November 2019-11 - Kernel components ext4 filesystem - CVE-2019-11833 [1/1]
PD#OTT-6798

Problem:
ext4: zero out the unused memory region in the extent tree block

Solution:
This commit zeroes out the unused memory region in the buffer_head
corresponding to the extent metablock after writing the extent header
and the corresponding extent node entries.

This is done to prevent random uninitialized data from getting into
the filesystem when the extent block is synced.

This fixes CVE-2019-11833.

Verify:
Raven

Change-Id: I5c6aae01432f5517b539312507e59e8dfb9c25eb
Signed-off-by: Sriram Rajagopalan <sriramr@arista.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:43 +09:00
Jianxin Pan
f9c5f8a821 dts: debug: enable ftrace_ramoops for new dts [1/1]
PD#SWPL-6028
PD#SWPL-8535

Problem:
enable ftrce in ramoops for new dtbs

Solution:
enable ftrce in ramoops for new dtbs

Verify:
X301

Change-Id: If5db23ed5e37dcd2522229e5aa2ed31e78a75c48
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2020-06-29 11:45:43 +09:00
Lei Qian
527a2ac25d kernel: merge DTVKit [12/14]
PD#SWPL-10512

Problem:
merge DTVKit

Solution:
merge DTVKit

Verify:
verify by r314, marconi

Change-Id: I103edf65cebbc2b4fcf4152edd7a83a4f0e6f27e
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
2020-06-29 11:45:43 +09:00
Hanjie Lin
08ba6e7ffa sched: disable EAS on non-big-little platforms [1/1]
PD#SWPL-8759

Problem:
disable EAS on non-big-little platforms

Solution:
disable EAS on non-big-little platforms

Verify:
w400, u200

Change-Id: I11845def9efaa2e1da8fd30ac26daeb0dc47eda4
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:43 +09:00
Hanjie Lin
91db4e07b9 RAVENPLAT-199: CVE-2017-0605 vulnerability in kernel trace subsystem [1/1]
PD#SWPL-15901

Problem:
Elevation of privilege vulnerability in kernel trace subsystem
(device specific)

Solution:
use strlcpy instead of strcpy

Platform:
Raven

Verify:
Raven

Change-Id: Ie0214a88c4194f892f8f7cda4965c1931e415bbc
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:43 +09:00
Tao Zeng
6ce0e26b0e cpuhotplug: offline workqueue before close cpu [1/1]
PD#TV-7079

Problem:
Deadlock happened when burning cpu at high temperature.
 1486                        1916
schedule                    schedule
schedule_preempt_disabled   schedule_timeout
__mutex_lock_slowpath       wait_for_common
mutex_lock                  wait_for_completion

cpu_hotplug_set_max --wait hpg.mutex

                            cpuhp_kick_ap_work   --wait flush work
cpufreq_set_max_cpu_num     _cpu_down            --hold hpg.mutex
cpucore_set_cur_state       do_cpu_down
thermal_cdev_update         cpu_down
power_actor_set_power       cpu_subsys_offline
power_allocator_throttle    device_offline
handle_thermal_trip         cpu_hotplug_thread
thermal_zone_device_update  kthread
thermal_zone_device_check   ret_from_fork
process_one_work
worker_thread    --It's a work
kthread
ret_from_fork

Solution:
Close work queue before hold lock

Verify:
T972

Change-Id: I557281a1674bd67472b0655e4f1ba409ffead42f
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2020-06-29 11:45:43 +09:00
Qiufang Dai
58104a8866 suspend: fix freeze abort hangup which caused by insmod [1/1]
PD#GH-134

Problem:
When freeze abort happen, it will lose device_unblock_probing(),
so device probe is blocked.

Solution:
When freeze abort happen, release device_block_probing

Verify:
SM1_S905D3_AC200

Change-Id: I3e591fe9ed392b6a4d30285817a91fbfec25336f
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
2020-06-29 11:45:43 +09:00
Joel Fernandes (Google)
a8ec9f5274 rcu: Avoid unnecessary softirq when system is idle
PD#SWPL-16045

commit b2eb85b49a upstream

When there are no callbacks pending on an idle system, I noticed that
RCU softirq is continuously firing. During this the cpu_no_qs is set to
false, and core_needs_qs is set to true indefinitely. This causes
rcu_process_callbacks to be repeatedly called, even though the node
corresponding to the CPU has that CPU's mask bit cleared and the system
is idle. I believe the race is when such mask clearing is done during
idle CPU scan of the quiescent state forcing stage in the kthread
instead of the softirq. Since the rnp mask is cleared, but the flags on
the CPU's rdp are not cleared, the CPU thinks it still needs to report
to core RCU.

Cure this by clearing the core_needs_qs flag when the CPU detects that
its node is already updated which will avoid the unwanted softirq raises
to the benefit of real-time systems.

Test: Ran rcutorture for various tree RCU configs.

Change-Id: Ibf34014eabdb0105847e5e642348e32e4a6194a1
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:43 +09:00
Kees Cook
c4aa33507d Revert "pstore: Honor dmesg_restrict sysctl on dmesg dumps"
PD#SWPL-7092

This reverts commit 68c4a4f8ab, with
various conflict clean-ups.

With the default root directory mode set to 0750 now, the capability
check was redundant.

Change-Id: If978c34cef8345b0ba67a038eed7d54d4f1423d6
Suggested-by: Nick Kralevich <nnk@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
2020-06-29 11:45:43 +09:00
Jiamin Ma
67deaf62c8 Security: fix sts testPocCVE_2016_6753 [1/1]
PD#SWPL-7852

Problem:
android.security.sts.Poc16_11#testPocCVE_2016_6753 fail

Solution:
do not expose kernel addr info via cgroup_css_links_read

Verify:
U200

Change-Id: I74e4904e8b662db9d6589a1926c62c87e12d6f6f
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2020-06-29 11:45:43 +09:00
zhiqiang liang
d447e8dbeb suspend: power: plug off the secondary cpus for freeze mode [1/1]
PD#SWPL-2399

Problem:
freeze mode can not kill the secondary cpus

Solution:
move the cpu kill function before the freeze function

Verify:
tl1 test success

Change-Id: I1da7cb8bcd800b8372fd152490eadd4ef3866ece
Signed-off-by: zhiqiang liang <zhiqiang.liang@amlogic.com>
2020-06-29 11:45:43 +09:00
libo
2d53e35e98 wifi: add tcp delay ack support [1/1]
PD#OTT-5388

Problem:
wifi rx throughput issue

Solution:
add tcp delay ack support
enable tcp dealy ack by following command:
echo 1 > /proc/sys/net/ipv4/tcp_use_userconfig
echo 60 > /proc/sys/net/ipv4/tcp_delack_seg

Verify:
u211

Change-Id: I060810b2800bae377388ba6ed9f9256597c9e6ea
Signed-off-by: libo <bo.li@amlogic.com>
2020-06-29 11:45:43 +09:00
Hanjie Lin
7687cdf9a8 RAVENPLAT-247:Kernel components bluetooth - CVE-2018-9363[1/1]
PD#SWPL-15901

Problem:
In the hidp_process_report in bluetooth, there is an integer overflow.
This could lead to an out of bounds write with no additional execution
privileges needed.  User interaction is not needed for exploitation.

Solution:
The fix is designed to make the length an unsigned integer and prevent
the overflow condition.

Platform:
Raven

Verify:
Raven

Change-Id: I2f7b2c5aea90120777177a4bdf238110e2ec22e2
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:42 +09:00
Cong Wang
8264e9dd7b OSS vulnerability found in [boot.img]:[linux_kernel] (CVE-2018-12232) Risk:[] [1/1]
PD#OTT-6793

Problem:
socket: close race condition between sock_close() and sockfs_setattr()

Solution:
fchownat() doesn't even hold refcnt of fd until it figures out
fd is really needed (otherwise is ignored) and releases it after
it resolves the path. This means sock_close() could race with
sockfs_setattr(), which leads to a NULL pointer dereference
since typically we set sock->sk to NULL in ->release().

As pointed out by Al, this is unique to sockfs. So we can fix this
in socket layer by acquiring inode_lock in sock_close() and
checking against NULL in sockfs_setattr().

sock_release() is called in many places, only the sock_close()
path matters here. And fortunately, this should not affect normal
sock_close() as it is only called when the last fd refcnt is gone.
It only affects sock_close() with a parallel sockfs_setattr() in
progress, which is not common.

Verify:
Raven

Change-Id: I336827581400c93c655e6bd9b837ec6f07c94632
Fixes: 86741ec254 ("net: core: Add a UID field to struct sock.")
Reported-by: shankarapailoor <shankarapailoor@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:42 +09:00
Hanjie Lin
1c0227a312 RAVENPLAT 2381:OSS vulnerability found in [boot.img]:[linux_kernel] (CVE-2018-6555) Risk:[] [1/1]
PD#OTT-5671

[Problem]
The irda_setsockopt function in net/irda/af_irda.c and later in
drivers/staging/irda/net/af_irda.c in the Linux kernel before 4.17
allows local users to cause a denial of service (ias_object
		use-after-free and system crash) or possibly have unspecified other
impact via an AF_IRDA socket.

[Solution]
The irda_setsockopt() function conditionally allocates memory for a new
self->ias_object or, in some cases, reuses the existing
self->ias_object. Existing objects were incorrectly reinserted into the
LM_IAS database which corrupted the doubly linked list used for the
hashbin implementation of the LM_IAS database. When combined with a
memory leak in irda_bind(), this issue could be leveraged to create a
use-after-free vulnerability in the hashbin list. This patch fixes the
issue by only inserting newly allocated objects into the database.

[Test]

Change-Id: Idbdc870be0064e331969b39a7b6e447c16a9073a
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:42 +09:00