Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has anyone tested the mainline kernel n64 support? #5

Open
jshield opened this issue Dec 27, 2022 · 12 comments
Open

has anyone tested the mainline kernel n64 support? #5

jshield opened this issue Dec 27, 2022 · 12 comments

Comments

@jshield
Copy link

jshield commented Dec 27, 2022

I can get the clbr/linux n64 branch to build and boot using a recent mips64 toolchain, can't seem to get anything more recent to boot, it never gets to a point where the console is initialized. and I can't see any evidence of dmesg in memory.

does anyone have a working config/toolchain?

Cheers,

@clbr
Copy link
Owner

clbr commented Dec 28, 2022

I tested the upstream kernel after everything was merged (config in this repo), but haven't tried more recent kernels.

@jshield
Copy link
Author

jshield commented Dec 28, 2022

cheers, so far I have managed to get the bootloader compiling against the latest libdragon, with a few changes to cover changes to cache invalidation needing to be aligned to 16-byte chunks and can get that to boot a kernel built against your repo in ares, the n64cart fails to mount for reasons I haven't investigated, as far as I can tell the offsets are correct. using the bootloader you built does work (gets to joyterm) for either my build of the kernel or the one that was distributed, so it's clearly a difference in the way libdragon initializes the hardware or the changes to the cache invalidation.

I couldn't get the upstream kernel to boot, I saw you replaced the custom n64rdp driver with some code in init.c to setup simpleframebuffer, but otherwise everything besides some config details don't appear to have changed significantly, it manages to reset the display to black and appears to do nothing, scanning the memory it doesn't appear to even reach early console stage, as I can't find any evidence of the dmesg buffer being populated.

I was hoping to extend ares to emulate some of the common dev carts to start working on drivers for them, in particular enabling direct access to the SDRAM backing the cartridges so I can modify the block driver to be used as a swap device/ramdisk and add in SD card support for mounting rootfs off that.

you wouldn't happen to have a binary I can test of your last working config?

cheers,

@clbr
Copy link
Owner

clbr commented Dec 28, 2022

Sorry, the only binaries are the ones already posted.

There is no dmesg buffer, at least early on. The early messages go out directly, one char at a time. IIRC during dev I edited the emulator to make some mem address special and had the early prints go to that, then the emu passed them on to the terminal it was running in.

@jshield
Copy link
Author

jshield commented Dec 28, 2022

ah yep, that makes sense, I suspect I may have to implement the FIFO part of a dev cart now, so I can do that exact thing.

hmm actually Ares has the ISViewer-64 mapped on its cartridge, so early console could probably log to that as a ring buffer.

Thanks for the advice.

@jshield
Copy link
Author

jshield commented Dec 29, 2022

status update:

  • Got early printk output by implementing a simple prom_putchar that passes output to "IS Viewer-64" in Ares
  • N64s modded with 16Mb RDRAM should work now.
  • Managed to sort out n64cart issues and can boot your linux kernel repo to joyterm with my updated bootloader code
  • 5.15.85 boots far enough to launch init but fails to mount n64cart, potentially related to refactoring and changes made since initial upstreaming
  • 6.1.1 crashes out completely looks like it gets stuck in a loop writing garbage to increasing memory addresses
  • haven't tested 6.0
IS Viewer-64 Log: [    0.000000] Linux version 5.15.85-n64 (jshield@vm-js-wrk-001) (mips64-linux-gnuabi64-gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 Thu Dec 29 06:04:14 UTC 2022

IS Viewer-64 Log:  [    0.000000] printk: bootconsole [early0] enabled
IS Viewer-64 Log:   [    0.000000] CPU0 revision is: 00000b22 (R4300)
IS Viewer-64 Log:  [    0.000000] FPU revision is: 00000b00
IS Viewer-64 Log:    [    0.000000] Initrd not found or empty - disabling initr
IS Viewer-64 Log: [    0.000000] Primary instruction cache 16kB, VIPT, direct mapped, linesize 32 bytes.

IS Viewer-64 Log: [    0.000000] Primary data cache 8kB, direct mapped, VIPT, cache aliases, linesize 16 bytes

IS Viewer-64 Log:   [    0.000000] Zone ranges:
IS Viewer-64 Log:    [    0.000000]   Normal   [mem 0x0000000000000000-0x0000000000ffffff
IS Viewer-64 Log:   [    0.000000] Movable zone start for each node
IS Viewer-64 Log:    [    0.000000] Early memory node range
IS Viewer-64 Log: [    0.000000]   node   0: [mem 0x0000000000000000-0x0000000000ffffff]

IS Viewer-64 Log: [    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000000ffffff]

IS Viewer-64 Log:  [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 4040
IS Viewer-64 Log:   [    0.000000] Kernel command line: n64cart.start=2956566528 n64cart.size=864256
IS Viewer-64 Log: [    0.000000] Dentry cache hash table entries: 2048 (order: 2, 16384 bytes, linear)

IS Viewer-64 Log:   [    0.000000] Inode-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
IS Viewer-64 Log:   [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
IS Viewer-64 Log:   [    0.000000] Memory: 13760K/16384K available (1741K kernel code, 159K rwdata, 192K rodata, 128K init, 95K bss, 2624K reserved, 0K cma-reserved)
IS Viewer-64 Log:  [    0.000000] NR_IRQS: 8
IS Viewer-64 Log: [    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 40773556198 ns

IS Viewer-64 Log: [    0.000023] sched_clock: 32 bits at 46MHz, resolution 21ns, wraps every 45812984821ns

IS Viewer-64 Log:   [    0.002426] Console: colour dummy device 40x30
IS Viewer-64 Log:  [    0.002976] printk: console [tty0] enabled
IS Viewer-64 Log: [    0.003495] printk: bootconsole [early0] disabled

@jshield
Copy link
Author

jshield commented Jan 5, 2023

further followup, a recent change in MIPS land between 6.0 and 6.1 regarding rngseed, means that passing a rngseed value in via the environment is needed at boot, otherwise it appears that it hangs trying to fw_getenv("rngseed") and ends up writing garbage everywhere.

image

@clbr
Copy link
Owner

clbr commented Jan 5, 2023

https://lore.kernel.org/lkml/20221001160910.GB13443@alpha.franken.de/T/

fw_getenv should return NULL gracefully according to that patch.

@jshield
Copy link
Author

jshield commented Jan 5, 2023

yeah I saw the commit but hadn't looked at LKML yet, I had added some debugging info and it appeared to never get past fw_getenv, I've added passing in rngseed derived from the kernel size and the disk size in the short term and it boots to that point, asking a couple of N64 devs about sources of randomness that might be a little more reliable.

on a side note, I've added preliminary support for the RandNet 64 keyboard over the joybus, and the N64 mouse.

I've also added support for detecting https://github.com/Polprzewodnikowy/SummerCollection/ and using part of the SDRAM as a swap disk.

switched to cramfs, since we aren't likely to need anything more than 256Mb of root, and since multiuser is compiled out, it appears to be a better choice (smaller kernel, less kernel memory footprint)

@clbr
Copy link
Owner

clbr commented Jan 5, 2023

Consoles generally don't have any other randomness source than the user. Meaning it's not useful to pass any seed from the rom, interrupts caused by user activity is as good as it can be.

(please don't edit the posts, it gets hard to see what is new if I visit after an edit...)

@jshield
Copy link
Author

jshield commented Jan 5, 2023

yeah apologies for the edit, seems that passing in the NULL env no longer passes muster, however it is happy with an empty rngseed env var. not sure if that is a bug in the fw_getenv, or if atleast with respect to MIPS platforms the N64 bootloader was the only one to pass an empty env in.

@jshield
Copy link
Author

jshield commented Jan 5, 2023

passing a NULL value to env on the entry point also boots so it looks like fw_getenv can't handle an empty but valid env pointer.

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Apr 11, 2023
fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1054009064 pushed a commit to 1054009064/linux that referenced this issue Apr 13, 2023
fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
FlyGoat added a commit to AOSC-Tracking/linux that referenced this issue Apr 24, 2023
fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
cthbleachbit pushed a commit to AOSC-Tracking/linux that referenced this issue Apr 24, 2023
fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
@FlyGoat
Copy link

FlyGoat commented May 7, 2023

Fixed in upstream kernel with torvalds/linux@ee1809e

mj22226 pushed a commit to mj22226/linux that referenced this issue May 7, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bananafunction pushed a commit to bananafunction/android_kernel_oneplus_sdm845 that referenced this issue May 8, 2023
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cthbleachbit pushed a commit to AOSC-Tracking/linux that referenced this issue May 9, 2023
fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 11, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 11, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 11, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 11, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
charwliu pushed a commit to charwliu/linux that referenced this issue May 12, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
TogoFire pushed a commit to Dev-msm8953/kernel_xiaomi_msm8953 that referenced this issue May 16, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Change-Id: I537e3703b512ac42e344ae7c5838500a51a71374
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9def337)
Signed-off-by: Togo 77 <togofire@mailfence.com>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 17, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 17, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 17, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 17, 2023
commit ee1809e upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
miraclestars pushed a commit to miraclestars/android_kernel_samsung_sm8250 that referenced this issue May 17, 2023
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sorayukii pushed a commit to Sorayukii/kernel_sony_tama that referenced this issue Oct 15, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sorayukii pushed a commit to Sorayukii/kernel_sony_tama that referenced this issue Oct 15, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sorayukii pushed a commit to Sorayukii/kernel_sony_tama that referenced this issue Oct 15, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Debarpan102 pushed a commit to Debarpan102/kernel_oplus_RMX3461 that referenced this issue Oct 15, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sorayukii pushed a commit to Sorayukii/kernel_sony_tama that referenced this issue Oct 18, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sorayukii pushed a commit to Sorayukii/kernel_sony_tama that referenced this issue Oct 20, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sorayukii pushed a commit to Sorayukii/android_kernel_tama_sdm845 that referenced this issue Oct 26, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sorayukii pushed a commit to Sorayukii/android_kernel_tama_sdm845 that referenced this issue Oct 27, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sorayukii pushed a commit to Sorayukii/android_kernel_tama_sdm845 that referenced this issue Nov 1, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ekkusa pushed a commit to miyoubi/kernel_sony_sdm845 that referenced this issue Nov 12, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
FakeShell pushed a commit to FuriLabs/linux-furiphone-krypton that referenced this issue Dec 7, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Dec 30, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Dec 30, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Dec 31, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Dec 31, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Dec 31, 2024
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 1, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 1, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 1, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 1, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 4, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
re-noroi pushed a commit to re-noroi/kernel_sm8250 that referenced this issue Jan 6, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aflaungos pushed a commit to Aflaungos/android_kernel_samsung_sm7225 that referenced this issue Jan 7, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 11, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 11, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 12, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 13, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 13, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_qcom_sdm8455 that referenced this issue Jan 13, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
ptxxp pushed a commit to ptxxp/android_kernel_845 that referenced this issue Jan 21, 2025
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: clbr/n64bootloader#5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants