Saturday, September 24, 2022

snap store error ubuntu

sudo snap --refresh

[sudo] password for xxxx: 

panic: runtime error: invalid memory address or nil pointer dereference [recovered]

panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x55d2d3e4c645]


goroutine 1 [running]:

main.main.func1()

/build/snapd/parts/snapd-deb/build/cmd/snap/main.go:492 +0x95

panic(0x55d2d44ef040, 0x55d2d4b658f0)

/usr/lib/go-1.13/src/runtime/panic.go:679 +0x1b6

main.run(0xc000393db8, 0xe)

/build/snapd/parts/snapd-deb/build/cmd/snap/main.go:559 +0x375

main.main()

/build/snapd/parts/snapd-deb/build/cmd/snap/main.go:497 +0x371

Sep 24 16:17:01 chrx CRON[5822]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)

Sep 24 16:17:01 chterx CRON[5823]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Sep 24 16:17:01 chx CRON[5822]: pam_unix(cron:session): session closed for user root

Sep 24 16:17:33 chx sudo[5839]: cohter : TTY=pts/0 ; PWD=/home/chuter ; USER=root ; COMMAND=/usr/bin/snap --refresh

Sep 24 16:17:33 chrx sudo[5839]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)

Sep 24 16:17:33 cherx sudo[5839]: pam_unix(sudo:session): session closed for user root

Sep 24 16:19:56 hrx polkitd(authority=local)[817]: Registered Authentication Agent for unix-process:5993:113025 (system bus name :1.99 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object >

Sep 24 16:20:00 chrx polkitd(authority=local)[817]: Operator of unix-session:1 successfully authenticated as unix-user:chr to gain TEMPORARY authorization for action org.freedesktop.syst>

Sep 24 16:20:00 chx polkitd(authority=local)[817]: Unregistered Authentication Agent for unix-process:5993:113025 (system bus name :1.99, object path /org/freedesktop/PolicyKit1/Authenticati>





Monday, September 19, 2022

dmesg: read kernel buffer failed: Operation not permitted

Don’t worry, it still works, it has just become a privileged operation, and it works fine with sudo dmesg. But why the change?

Well, I happen to be the one who proposed for this change to be made, and followed up on getting the configuration changes made. This blog post will describe how it slightly improves the security of Ubuntu, and the journey to getting the changes landed in a release.

Matthew Ruffell

Sustaining Engineer @ Canonical.

https://ruffell.nz/programming/writeups/2020/10/24/getting-dmesg-restrict-enabled-in-ubuntu-groovy.html

https://www.phoronix.com/news/Ubuntu-20.10-Restrict-dmesg



Why should users have access to dmesg if they can't access /var/log/kern.log?

https://lists.ubuntu.com/archives/ubuntu-devel/2020-June/041063.html


For those interested this new default restriction can be turned off with


sudo sysctl kernel.dmesg_restrict=0

https://archived.forum.manjaro.org/t/why-did-dmesg-become-a-priveleged-operation-suddenly/86468/2



sysctl kernel.dmesg_restrict

kernel.dmesg_restrict = 1


 ls -l /var/log/dmesg*

-rw-r----- 1 root adm 83674 Sep 20 07:56 /var/log/dmesg

-rw-r----- 1 root adm 85387 Sep 20 07:06 /var/log/dmesg.0

-rw-r----- 1 root adm 20186 Sep 19 20:55 /var/log/dmesg.1.gz

-rw-r----- 1 root adm 20637 Sep 19 20:50 /var/log/dmesg.2.gz

-rw-r----- 1 root adm 20154 Sep 19 09:40 /var/log/dmesg.3.gz

-rw-r----- 1 root adm 20840 Sep 19 04:57 /var/log/dmesg.4.gz



message during bootup (mtd device must be supplied)

 MTD subsystem (stands for Memory Technology Devices) provides an abstraction layer for raw flash devices. It makes it possible to use the same API when working with different flash types and technologies, e.g. NAND, OneNAND, NOR, AG-AND, ECC'd NOR, etc.

http://www.linux-mtd.infradead.org/doc/general.html



sudo dmesg | grep mtd

[    2.910229] systemd[1]: Starting Load Kernel Module mtdpstore...

[    2.946037] mtd device must be supplied (device name is empty)

[    2.979483] systemd[1]: modprobe@mtdpstore.service: Deactivated successfully.

[    2.979714] systemd[1]: Finished Load Kernel Module mtdpstore.

systemd-pstore.service - Platform Persistent Storage Archival
     Loaded: loaded (/lib/systemd/system/systemd-pstore.service; enabled; vendo>
     Active: inactive (dead)
  Condition: start condition failed at Tue 2022-09-20 07:06:20 IST; 14min ago
             └─ ConditionDirectoryNotEmpty=/sys/fs/pstore was not met
       Docs: man:systemd-pstore(8)

Systemd has a systemd-pstore component that scans the pstore on boot and if non-empty, takes all previously created dumps, transfers them into its journal and removes the pstore elements. This is very important on UEFI systems, which only have a limited amount of space for variables.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1978079

This problem affects (at least) Ubuntu 20.04 and 22.04. A quick fix would be to configure CONFIG_EFI_VARS_PSTORE=y so that it's always available. A long term fix would make systemd rescan the directory after all module probing settled.


computer@computer:~$ uname -r
5.15.0-47-generic
computer@computer:~$ ls /boot
config-5.15.0-46-generic  initrd.img                    memtest86+.bin                System.map-5.15.0-47-generic  vmlinuz.old
config-5.15.0-47-generic  initrd.img-5.15.0-46-generic  memtest86+.elf                vmlinuz
efi                       initrd.img-5.15.0-47-generic  memtest86+_multiboot.bin      vmlinuz-5.15.0-46-generic
grub                      initrd.img.old                System.map-5.15.0-46-generic  vmlinuz-5.15.0-47-generic


journalctl -xn
Sep 20 07:30:01 computerx CRON[5108]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Sep 20 07:30:01 computerx CRON[5109]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-r>
Sep 20 07:30:01 computerx CRON[5108]: pam_unix(cron:session): session closed for user root
Sep 20 07:30:08 computerx sudo[5112]: computer : TTY=pts/0 ; PWD=/home/computer ; USER=root ; COMMAND=/usr/bin/sh -c echo 1 > /proc/sys/>
Sep 20 07:30:08 computerx sudo[5112]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Sep 20 07:30:08 computerx sudo[5112]: pam_unix(sudo:session): session closed for user root
Sep 20 07:31:09 computerx anacron[5176]: Anacron 2.3 started on 2022-09-20
Sep 20 07:31:09 computerx systemd[1]: Started Run anacron jobs.
░░ Subject: A start job for unit anacron.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit anacron.service has finished successfully.
░░ 
░░ The job identifier is 2557.
Sep 20 07:31:09 computerx anacron[5176]: Normal exit (0 jobs run)
Sep 20 07:31:09 computerx systemd[1]: anacron.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit anacron.service has successfully entered the 'dead' state.

ls -lrt /var/spool/anacron
total 12
-rw------- 1 root root 9 Sep  2 16:28 cron.monthly
-rw------- 1 root root 9 Sep 16 11:18 cron.weekly
-rw------- 1 root root 9 Sep 20 07:11 cron.daily

cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
HOME=/root
LOGNAME=root

# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
https://www.thegeekdiary.com/linux-os-service-anacron/

https://launchpad.net/~mustafakemalgilor


https://linuxconfig.org/how-to-enable-all-sysrq-functions-on-linux




Friday, June 10, 2022

investigating the mouse and keyboard freeze on ubuntu 22.04

 


dmesg --level=warn

[    0.005871] ACPI BIOS Warning (bug): Optional FADT field Pm2ControlBlock has valid Length but zero Address: 0x0000000000000000/0x1 (20210331/tbfadt-615)

[    0.441107] AMD-Vi: [Firmware Warn]: EFR mismatch. Use IVHD EFR (0x37ef22294ada : 0x77ef22294ada).

[    0.441205] pci 0000:00:00.2: can't derive routing for PCI INT A

[    0.441207] pci 0000:00:00.2: PCI INT A: not connected

[    0.809850] platform eisa.0: EISA: Cannot allocate resource for mainboard

[    0.809852] platform eisa.0: Cannot allocate resource for EISA slot 1

[    0.809853] platform eisa.0: Cannot allocate resource for EISA slot 2

[    0.809855] platform eisa.0: Cannot allocate resource for EISA slot 3

[    0.809856] platform eisa.0: Cannot allocate resource for EISA slot 4

[    0.809857] platform eisa.0: Cannot allocate resource for EISA slot 5

[    0.809858] platform eisa.0: Cannot allocate resource for EISA slot 6

[    0.809859] platform eisa.0: Cannot allocate resource for EISA slot 7

[    0.809861] platform eisa.0: Cannot allocate resource for EISA slot 8

[    3.251160] systemd-journald[269]: File /var/log/journal/031a21c3a8864f3681b5d2599bcc40df/system.journal corrupted or uncleanly shut down, renaming and replacing.

[    4.270016] amdgpu 0000:00:01.0: amdgpu: Trusted Memory Zone (TMZ) feature not supported

[    4.413232] [drm] Unsupported Connector type:5!

[    4.842451] acp_audio_dma: probe of acp_audio_dma.1.auto failed with error -110

[  163.581036] systemd-journald[269]: File /var/log/journal/031a21c3a8864f3681b5d2599bcc40df/user-1000.journal corrupted or uncleanly shut down, renaming and replacing.

[  169.562975] kauditd_printk_skb: 28 callbacks suppressed

https://lore.kernel.org/all/16533743-de8d-6355-211d-1b4f8949fcfb@molgen.mpg.de/

sudo sysctl -a | grep net.core.message_

https://www.kernel.org/doc/Documentation/sysctl/net.txt

Ubuntu AMDGPU-PRO

The open source AMDGPU driver does not support (currently) HDMI audio. Installing the following "hybrid" AMDGPU-Pro driver from AMD will resolve this issue.

https://www.dell.com/support/kbdoc/en-in/000146175/installing-and-configuring-amdgpu-pro-in-ubuntu-16-04-linux

lspci -k | grep -EA2 'VGA|3D'

00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Wani [Radeon R5/R6/R7 Graphics] (rev e6)

Subsystem: Gigabyte Technology Co., Ltd Radeon R7 Graphics

Kernel driver in use: amdgpu

https://www.amd.com/en/support/kb/release-notes/rn-radpro-lin-16-40

https://amdgpu-install.readthedocs.io/en/latest/

dpkg -l amdgpu-pro

dpkg-query: no packages found matching amdgpu-pro

dpkg -l amdgpu-pro
dpkg-query: no packages found matching amdgpu-pro


sudo lshw -c video

  *-display                 

       description: VGA compatible controller

       product: Wani [Radeon R5/R6/R7 Graphics]

       vendor: Advanced Micro Devices, Inc. [AMD/ATI]

       physical id: 1

       bus info: pci@0000:00:01.0

       version: e6

       width: 64 bits

       clock: 33MHz

       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom

       configuration: driver=amdgpu latency=0

       resources: irq:34 memory:c0000000-cfffffff memory:d0000000-d07fffff ioport:f000(size=256) memory:feb00000-feb3ffff memory:c0000-dffff


 lsmod | grep amd

edac_mce_amd           32768  0

kvm_amd               118784  0

ccp                    98304  1 kvm_amd

kvm                   864256  1 kvm_amd

amdgpu               6348800  23

iommu_v2               24576  1 amdgpu

gpu_sched              36864  1 amdgpu

drm_ttm_helper         16384  1 amdgpu

ttm                    69632  2 amdgpu,drm_ttm_helper

drm_kms_helper        253952  1 amdgpu

i2c_algo_bit           16384  1 amdgpu

drm                   557056  11 gpu_sched,drm_kms_helper,amdgpu,drm_ttm_helper,ttm

dmesg | grep -i amdgpu

[    4.255521] [drm] amdgpu kernel modesetting enabled.

[    4.266085] amdgpu: Topology: Add APU node [0x0:0x0]

[    4.266158] fb0: switching to amdgpudrmfb from VESA VGA

[    4.269763] amdgpu 0000:00:01.0: vgaarb: deactivate vga console

[    4.270016] amdgpu 0000:00:01.0: amdgpu: Trusted Memory Zone (TMZ) feature not supported

[    4.283825] amdgpu 0000:00:01.0: amdgpu: Fetched VBIOS from ROM BAR

[    4.283893] amdgpu 0000:00:01.0: amdgpu: VRAM: 512M 0x000000F400000000 - 0x000000F41FFFFFFF (512M used)

[    4.283896] amdgpu 0000:00:01.0: amdgpu: GART: 1024M 0x000000FF00000000 - 0x000000FF3FFFFFFF

[    4.283959] [drm] amdgpu: 512M of VRAM memory ready

[    4.283962] [drm] amdgpu: 3072M of GTT memory ready.

[    4.365552] amdgpu: hwmgr_sw_init smu backed is smu8_smu

[    4.386916] amdgpu: smu version 19.13.09

[    4.425432] snd_hda_intel 0000:00:01.1: bound 0000:00:01.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])

[    4.712433] kfd kfd: amdgpu: Allocated 3969056 bytes on gart

[    4.712579] amdgpu: Topology: Add APU node [0x9874:0x1002]

[    4.712583] kfd kfd: amdgpu: added device 1002:9874

[    4.712586] amdgpu 0000:00:01.0: amdgpu: SE 1, SH per SE 1, CU per SH 8, active_cu_number 6

[    4.714678] fbcon: amdgpudrmfb (fb0) is primary device

[    4.716197] amdgpu 0000:00:01.0: [drm] fb0: amdgpudrmfb frame buffer device

[    4.753215] [drm] Initialized amdgpu 3.41.0 20150101 for 0000:00:01.0 on minor 0


sudo add-apt-repository ppa:oibaf/graphics-drivers

In case you need to revert back to your original Ubuntu AMD Radeon drivers you can remove the PPA driver installation using the below commands:


$ sudo apt install ppa-purge

$ sudo ppa-purge ppa:oibaf/graphics-drivers

https://linuxconfig.org/amd-radeon-ubuntu-20-04-driver-installation

Linux uses this mechanism to throttle the spamming of log events, decreasing the likelihood of a denial-of-service attack.

lsmod | grep -i amdgpu

amdgpu               6348800  23

iommu_v2               24576  1 amdgpu

gpu_sched              36864  1 amdgpu

drm_ttm_helper         16384  1 amdgpu

ttm                    69632  2 amdgpu,drm_ttm_helper

drm_kms_helper        253952  1 amdgpu

i2c_algo_bit           16384  1 amdgpu

drm                   557056  11 gpu_sched,drm_kms_helper,amdgpu,drm_ttm_helper,ttm

https://www.amd.com/en/support


good guess its a driver problem, the drivers for your card is not included in Ubuntu, see this from AMD/ATI it includes the software you need

https://www.phoronix.com/scan.php?page=news_item&px=AMDGPU-TMZ-Default-Soonv

https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-50


https://wiki.archlinux.org/title/Keyboard_shortcuts#Kernel