linux-samsung-a6lte: fix nullptr dereference (MR 5467)

I've had the kernel panic with a NULL pointer dereference in the
addrconf_rt_table function. I have no idea how it could be triggered,
but the fix is straightforward.
This commit is contained in:
Sergey Lisov 2024-08-07 00:20:57 +03:00 committed by Robert Eckelmann
parent aaef79a7af
commit 36bf4eb5fe
No known key found for this signature in database
GPG key ID: 30C0D50BEF63BF54
3 changed files with 17 additions and 3 deletions

View file

@ -3,7 +3,7 @@
pkgname=linux-samsung-a6lte
pkgver=3.18.140
pkgrel=5
pkgrel=6
pkgdesc="Samsung Galaxy A6 2018 kernel fork"
arch="aarch64"
_carch="arm64"
@ -43,6 +43,7 @@ source="
disable-boot-mode-check.patch
uncomment-rfcomm-in-makefile.patch
linux3.7to4.5-ARM64-remove-Sun-Solaris-style-flag-on-section.patch
fix-addrconf_rt_table-nullptr-deref.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="."
@ -74,7 +75,7 @@ package() {
sha512sums="
c2cc5190c480de4ac2d376827c5c56a542c6644d3dbeb47956d0b90c5570b246872ecedbf5655ac5564c9f61190d23567a4c496bb4235c46f6bd7a6d8addcc68 linux-samsung-a6lte-981969320c1cdc214cf8a1a357fab642f401a5d1.tar.gz
bac785d34c8e5e986c2a17cc5cc0a975d4d87ef5b01a6496cc89cac274f28a33b76a514515f0819e6b6ca2337ee19b7eb0e3c86f88bea93abea69a9de98658ee config-samsung-a6lte.aarch64
82ca91133a27967d164c5e38545bfe84055c0ec7dde738038ba8258a05d518e07b16a2ba7b9c1b7dda28236dbdc62def3cfb643ae695bca88498714b6fd25e56 config-samsung-a6lte.aarch64
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
3f65a690e48f913fcb980718fae4dc03c29a6dc86eecb1e2af644488ad415de326a61d840399fb69915cbc5d56d5586f2df2287b3e7323a2927ae73a3b1b1373 zram-zs-create-pool-null.patch
5bd204239a5daff9f990757178398707ae5ec64f823ed9ec72a8d50ebe6d5f0a3cc9743e0d775094da4b3a7566f1ccceb56f39f3b0234d08ca05e537d86271ec decon-fb-colors.patch
@ -82,4 +83,5 @@ e1409844c46869ffe6ac9e028c3f38868120b6fd38dcf52ca7c1fdb98e90d2717d72ed52f7f41d3b
1e705ff6f256b93986adba4c1f296b2d47be48986490d6a1130fc57126a462b2adfb4f51d3717ef70e91d0b42eb54a33b0d29f85d0c0bb9bf1498bb80c1bb7c1 disable-boot-mode-check.patch
cd41a79406341cb72b4d569b21b2af3bbba4fcedd891a73b3273d5e9561466d5b99c424ce29bac83650298fc51d53b5cb65037a644f622a7e287ec38d30af66f uncomment-rfcomm-in-makefile.patch
75545ccd0082a119b9ad95fcef3523c939a5c946f8f3a5c3dde15cee1502f6c1011050a0ad5359426f018bb7ceea1c97a28c7665941bc89f365c8d11065ce0f6 linux3.7to4.5-ARM64-remove-Sun-Solaris-style-flag-on-section.patch
713bfcbcd6c78d554fc1e50746792b25dfde455c98cef483ad9b07044171fd064d266ffbc9338bb1aa42d921f583433b00f4586cf8b03c6d21468ca88bd60fed fix-addrconf_rt_table-nullptr-deref.patch
"

View file

@ -4577,7 +4577,7 @@ CONFIG_CRYPTO=y
#
# Crypto core or helper
#
CONFIG_CRYPTO_FIPS=y
# CONFIG_CRYPTO_FIPS is not set
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y

View file

@ -0,0 +1,12 @@
--- a/net/ipv6/addrconf.c 2022-02-08 08:17:30.000000000 +0300
+++ b/net/ipv6/addrconf.c 2024-08-06 00:58:50.314960285 +0300
@@ -2125,6 +2125,9 @@
* - If < 0, put routes into table dev->ifindex + (-rt_table).
*/
struct inet6_dev *idev = in6_dev_get(dev);
+ if (!idev) {
+ return 0;
+ }
u32 table;
int sysctl = idev->cnf.accept_ra_rt_table;
if (sysctl == 0) {