#StackBounty: #linux #openwrt Linux stops booting after eth0 link up. How to make it show more log?

Bounty: 50

I compiled the latest OpenWRT with Linux kernel 4.4.7 and flashed it into a Netgear WNDR3700v2. Here’s the boot log from serial port.

U-Boot 1.1.4 (Jan 15 2015 - 11:30:07)

AP96 (AR7161 rev 2) U-Boot
DRAM:  128 MB
Flash: Macronix MX25L12835E (16 MB)
Using default environment

Clocks: CPU:680MHz, DDR:340MHz, AHB:170MHz, Ref:40MHz
In:    serial
Out:   serial
Err:   serial
Net:   ag7100_enet_initialize...
No valid address in Flash. Using fixed MAC Address
No valid address in Flash. Using fixed MAC Address
GMAC: cfg1 0xf cfg2 0x7014
eth0: 00:03:7f:09:0b:ad
eth0 up
GMAC: cfg1 0xf cfg2 0x7014
eth1: 00:03:7f:09:0b:ad
eth1 up
eth0, eth1
Hit any key to stop autoboot:  0 
### SQUASHFS loading 'image/uImage' to 0x80800000
### SQUASHFS load complete: 1376256 bytes loaded to 0x80800000
## Booting image at 80800000 ...
   Image Name:   MIPS OpenWrt Linux-4.4.7
   Created:      2016-04-17  22:20:11 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1330577 Bytes =  1.3 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x80800040 ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 4.4.7 (wesley@localhost) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49195) ) #3 Mon Apr 18 06:37:58 UTC 2016
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7161 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] No valid device tree found, continuing without
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line:  board=WNDR3700 mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 125204K/131072K available (2932K kernel code, 152K rwdata, 744K rodata, 260K init, 200K bss, 5868K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Clocks: CPU:680.000MHz, DDR:340.000MHz, AHB:170.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5621354254 ns
[    0.000008] sched_clock: 32 bits at 340MHz, resolution 2ns, wraps every 6316128254ns
[    0.007780] Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
[    0.070505] pid_max: default: 32768 minimum: 301
[    0.075225] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.081837] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090915] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.101352] NET: Registered protocol family 16
[    0.106751] MIPS: machine is NETGEAR WNDR3700/WNDR3800/WNDRMAC
[    2.752903] registering PCI controller with io_map_base unset
[    2.765999] PCI host bridge to bus 0000:00
[    2.770151] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    2.777007] pci_bus 0000:00: root bus resource [io  0x0000]
[    2.782574] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    2.789346] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    2.797331] pci 0000:00:11.0: fixup device configuration
[    2.804098] pci 0000:00:12.0: fixup device configuration
[    2.810875] pci 0000:00:11.0: BAR 0: assigned [mem 0x10000000-0x1000ffff]
[    2.817657] pci 0000:00:12.0: BAR 0: assigned [mem 0x10010000-0x1001ffff]
[    2.824462] pci 0000:00:11.0: using irq 40 for pin 1
[    2.829416] pci 0000:00:12.0: using irq 41 for pin 1
[    2.835081] clocksource: Switched to clocksource MIPS
[    2.841158] NET: Registered protocol family 2
[    2.846252] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    2.853221] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    2.859613] TCP: Hash tables configured (established 1024 bind 1024)
[    2.866051] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    2.871887] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    2.878381] NET: Registered protocol family 1
[    2.883579] futex hash table entries: 256 (order: -1, 3072 bytes)
[    2.902548] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.908438] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.920214] io scheduler noop registered
[    2.924143] io scheduler deadline registered (default)
[    2.929696] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    2.936431] console [ttyS0] disabled
[    2.960048] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 10625000) is a 16550A
[    2.968754] console [ttyS0] enabled
[    2.968754] console [ttyS0] enabled
[    2.975715] bootconsole [early0] disabled
[    2.975715] bootconsole [early0] disabled
[    2.986372] m25p80 spi0.0: found mx25l12805d, expected m25p80
[    2.992122] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    2.997236] 4 cmdlinepart partitions found on MTD device spi0.0
[    3.003137] Creating 4 MTD partitions on "spi0.0":
[    3.007942] 0x000000000000-0x000000050000 : "u-boot"
[    3.014619] 0x000000050000-0x000000070000 : "u-boot-env"
[    3.021309] 0x000000070000-0x000000ff0000 : "firmware"
[    3.040253] 2 netgear-fw partitions found on MTD device firmware
[    3.046298] 0x000000070000-0x0000001b6440 : "kernel"
[    3.052382] 0x0000001b6440-0x000000ff0000 : "rootfs"
[    3.058685] mtd: device 4 (rootfs) set to be root filesystem
[    3.064391] 1 squashfs-split partitions found on MTD device rootfs
[    3.070612] 0x000000410000-0x000000ff0000 : "rootfs_data"
[    3.077349] 0x000000ff0000-0x000001000000 : "art"
[    3.084250] Realtek RTL8366S ethernet switch driver version 0.2.2
[    3.090429] rtl8366s rtl8366s: using GPIO pins 5 (SDA) and 7 (SCK)
[    3.096695] rtl8366s rtl8366s: RTL8366 ver. 1 chip found
[    3.142470] libphy: rtl8366s: probed
[    3.466770] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    3.786924] ag71xx ag71xx.1: connected to PHY at rtl8366s:04 [uid=001cc960, driver=Generic PHY]
[    3.796246] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RGMII
[    3.804209] NET: Registered protocol family 10
[    3.811932] NET: Registered protocol family 17
[    3.816496] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    3.829205] 8021q: 802.1Q VLAN Support v1.8
[    3.839848] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    3.847744] Freeing unused kernel memory: 260K (8041f000 - 80460000)
[    4.768274] init: Console is alive
[    4.771859] init: - watchdog -
[    5.751955] usbcore: registered new interface driver usbfs
[    5.757566] usbcore: registered new interface driver hub
[    5.762950] usbcore: registered new device driver usb
[    5.772288] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.780101] ehci-platform: EHCI generic platform driver
[    5.785453] ehci-platform ehci-platform: EHCI Host Controller
[    5.791230] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    5.799247] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    5.825113] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    5.832136] hub 1-0:1.0: USB hub found
[    5.836185] hub 1-0:1.0: 2 ports detected
[    5.842660] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    5.850013] ohci-platform: OHCI generic platform driver
[    5.855357] ohci-platform ohci-platform: Generic Platform OHCI controller
[    5.862157] ohci-platform ohci-platform: new USB bus registered, assigned bus number 2
[    5.870155] ohci-platform ohci-platform: irq 14, io mem 0x1c000000
[    5.939900] hub 2-0:1.0: USB hub found
[    5.943895] hub 2-0:1.0: 2 ports detected
[    5.949443] init: - preinit -
[    6.475369] eth0: link up (1000Mbps/Full duplex)

It hangs here for a few seconds then reboots itself, over and over. What should I do to know what happened there, since the log provides no more than this?

By the way, it boots fine if I replace Linux kernel 4.4.7 with 4.1.20.


Get this bounty!!!

#StackBounty: #linux #bash #debian #shell #dash Trap on DEBUG signal for the dash shell?

Bounty: 50

With the bash shell, you can install a trap on the synthetic DEBUG signal. This is useful and will execute your function or bit of code on every shell command. For example:

$ trap 'logger -t shell "${BASH_COMMAND}"' DEBUG

Looking at the dash shell source code, I seem to understand there’s no such DEBUG signal available.

Are these any workarounds or alternatives to achieve the same result with the dash shell?


Get this bounty!!!

#StackBounty: #linux #devices #network-interface Why did the interface name of my wireless card change when I added a sound card?

Bounty: 50

Predictable network interface names are not supposed to change when hardware is added or removed. Isn’t that the whole point of the naming scheme???

My wireless interface was named wlp3s0.

I installed an ASUS Xonar DX 7.1 Channels PCI Express x1 Interface Sound Card in a free PCI slot and my wireless interface name changed to wlp5s0.

The wireless card is in the same PCI slot that it was in before the sound card was installed, so why would the interface name change?!

The mobo is a GIGABYTE GA-970A-UD3, and the wireless card is an ASUS PCE-N15. The system is running Arch Linux with a stock kernel.

I’m looking for a reasonable explanation of why the interface name would change in this scenario. If there is not a good reason why the interface name would change, where do I file a bug report/who do I complain to?

It’s not a big deal and the only config I needed to change was my network profile for netctl. I just think if a “predictable” network interface name isn’t predictable then they completely failed at their job and this naming scheme is useless garbage!
/rant


Get this bounty!!!

#StackBounty: #linux #audio #gnome #microphone #headphones Headphones not reproducing bass under GNOME

Bounty: 50

I have a 2012 Retina MacBook Pro running Arch Linux with GNOME. Normally, I listen to music using the analog audio I/O interface — the 3.5mm socket.

Recently, I had to attach a USB microphone to the laptop. While doing that, I used the microphone’s built-in 3.5mm socket to monitor the sound I was recording with lower latency and less distortion than what the laptop’s internal amplifier, and the backing software, would produce. Because of this, I went into GNOME’s sound options and updated the audio output profile to digial, which allowed me to pipe system sounds through the mic and into my headphones while I was monitoring the audio received by the microphone.

After switching back to using the 3.5mm socket on my laptop and reverting the audio output profile to analog (the only option available without the mic), the outputted audio’s really distorted. After some tinkering using the ALSA mixer and reproduction of the issue on the laptop’s main speakers, I’ve concluded that the issue is that outputting audio to my headphones now results in the bass part of the spectrum being cut off completely, resulting in a tinny, distorted, and almost downsampled effect.

Unfortunately, I haven’t found any settings allowing me to tweak the bass response for the 3.5mm out.

Where can I do this system-wide?


Get this bounty!!!

#StackBounty: #linux #google-chrome #browser #chromium #web-development Disable Chrome scaling

Bounty: 200

So I have this small box display in Chrome

But it’s in fact 130px big. Chrome is scaling all web because of my 1080p monitor.

Example 1[1]

How to disable it? It’s only annoying when you are developing websites.

Example 2


Get this bounty!!!

#StackBounty: #linux #c #exploit-development #x86 #race-condition Are memcpy() based race conditions exploitable for causing remote cod…

Bounty: 50

Let’s say I have the following pseudocode in the trusted part of a sandbox which prevent untrusted code calling mprotect() and mmap() and ptrace() directly (mutext isn’t accessible from sandboxed memory)

//src and dest are user controlled but must be valid.
TrustedPart_for_safe_jit(void * mutext, uint8_t *src,uint8_t *dest, uint32_t size) // in the current case, *dest targets a PROT_NONE memory region
{
    MutexLock(mutext);
    ValidateOpcodesOrCrash(src,size); // uses calls to mmap on size internally. Contains many loops : this is the longest part.
    unwriteprotect(dest,size); // calls many sandbox’s internal functions

    SafeMemcpy(src,dest,size); // THIS IS the function which contains the race condition

    asm("mfence");
    unEXECprotect(dest,size); // involve write protecting as well as allowing reading
    MutexUnlock(mutext);
}

SafeMemcpy(uint8_t *src,uint8_t *dest, uint32_t size) // the data to be copied cannot exceed 128Mb
{
    if(!CheckUserTarget(dest,size) {
        uint8_t *src_ptr=src;
        uint8_t *dest_ptr=dest;
        uint8_t *end_ptr=des+size;
        while (dest_ptr < end_ptr) { // that loop should execute very fast
            *(uint32_t *) dest_ptr = *(uint32_t *) src_ptr;
            dest_ptr += 4;
            src_ptr += 4;
        }
    }
}

That part is responsible for allowing untrusted code to use ᴊɪᴛ compilation.
The point is untrusted thread aren’t suspended.

As you know, when 2 threads use memcpy() with the same destination, they generate random data. In that case, such data could potentially contains instructions like int 0x80, thus allowing to escape the sandbox.

Things I thought to so far :

  • Write data to a file and read it with the read system call through the sandbox. If the memory is still write protected the program doesn’t crash. This would involve looping and even if the data to be copied can be 128Mb large I’m not sure it would works because of syscall overhead.
    An Alternative would be to create code several times and try reading with several timing, but I have no idea on how to select the initial timing window.
  • Use futex… But I couldn’t found if futex can be used to check the value of non allocated memory. I’m also unsure if the thread could wake up before memory become write protected.

So, is it possible to plan for memcpy race conditions ?


Get this bounty!!!

#StackBounty: #linux #remote #proxy #gateway Linux Replacement of RD Gateway

Bounty: 50

Is there a way to replace RDS Gateway with some sort of linux based proxy. I know there some ways to do it with ssh/port forwarding, but this is to replace a current RDS Gateway our users utilize for remote access (~300 users). I need to support multiple windows clients using their native RDP to connect to their windows desktops on campus, using some sort of linux proxy in between.

From my searching, there are some solutions (xrdp,ssh proxy, port forwarding, etc) that sort of do what I need but they either aren’t user friendly or they involve using multiple/non-standard ports. Before I give up my search and succumb to paying MS Licensing for RDS, is it currently possible to use linux to proxy RDP from windows using their native client?

[Multiple Remote Windows Clients] => [Linux proxy/gateway] => [Corporate Windows Desktops]


Get this bounty!!!

#StackBounty: #linux #centos7 #video-streaming vlc decoder error while streaming

Bounty: 50

I’m re-streaming rtsp stream with vlc for two cameras. The second camera doesn’t have audio and it works fine, for the first one (which has audio) stream start fails 9 out of 10 times with error core decoder error: cannot continue streaming due to errors. However if the streams starts, it works fine until restarted. However I get some errors on the cam 1 (when the stream starts correctly):

core mux warning: late buffer for mux input (145003)

And sometimes (rarely) I get these errors:

mux_ts mux warning: packet with too strange dts (dts=-6272,old=0,pcr=0)

I’m using VLC 2.2.4 on CentOS7 from nux-dextop repo:

VLC media player 2.2.4 Weatherwax (revision 2.2.3-37-g888b7e89)

It’s installed on Virtual machine without desktop and probably doesn’t have any audio support (no virtual audio hardware).

vlc start script for the first camera (s):

#!/bin/bash

URL="rtsp://192.168.40.201:554/axis-media/media.amp"

#--rtsp-frame-buffer-size=200000 
sudo -u vlc cvlc -v 
 --loop --http-reconnect --http-continuous -I dummy $URL 
 --logfile=/var/log/bird-cam1.log 
 --sout '#transcode{}'
':duplicate{dst=std{access=livehttp{seglen=3,delsegs=true,numsegs=5,index=/var/www/html/live/cam1/mystream.m3u8,index-url=http://10.20.30.40/live/cam1/mystream-########.ts},mux=ts{use-key-frames},'
'dst=/var/www/html/live/cam1/mystream-########.ts},'
'dst=std{access=http,mux=ts,dst=:8081/video.mp4}}'

vlc output

VLC media player 2.2.4 Weatherwax (revision 2.2.3-37-g888b7e89)
[0000000000b4f348] core interface error: no suitable interface module
[0000000000a50118] core libvlc error: interface "globalhotkeys,none" initialization failed
[0000000000b4f348] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0000000000b4f348] core interface error: no suitable interface module
[0000000000a50118] core libvlc error: interface "dbus,none" initialization failed
[0000000000b4f348] dummy interface: using the dummy interface module...
MultiFramedRTPSource::doGetNextFrame1(): The total received frame size exceeds the client's buffer size (100000).  75129 bytes of trailing data will be dropped!
[00007fb95c0009b8] core input error: ES_OUT_RESET_PCR called
[00007fb960005148] mux_ts mux warning: packet with too strange dts (dts=-6457,old=0,pcr=0)
[00007fb9604d1228] mux_ts mux warning: packet with too strange dts (dts=-6457,old=0,pcr=0)
[00007fb95c0009b8] core input error: ES_OUT_RESET_PCR called
[00007fb96051d348] core decoder error: cannot continue streaming due to errors

Any ideas why the stream doesn’t start every time?
Both cameras stream RTSP. Codec h264 AVC, for the first camera audio is mp4a

Update:

Confirmed that the audio is causing the problem. With audio stream stopped vlc works just fine. Audio codec is AAC. It was set to 32kHz sampling/32 kbit/s. Now it’s 48kHz sampling/64kbit/s – still the same problem.


Get this bounty!!!

#StackBounty: #linux #embedded #swap #sd-card How does swappiness affect the longevity of SDHC memory cards in embedded computers?

Bounty: 200

In this question over at superuser several answers report SDHC card failures in Raspberry Pi single-board computers and other embedded devices over the course of periods varying from weeks to years.

In comments to this answer to an unrelated question about the swappiness, there was speculation as to whether adjusting swappiness to favour file cache pages over anonymous pages would increase the longevity of SD cards in embedded systems that rely on SD cards as their primary storage medium. Intuitively it seems that adjusting swappinness should have some effect on writes to the SD cards, but it is difficult to tell it is difficult how much swapping contributes to the overall strain on the SD card endurance compared to other contributing factors, such as logging or temporary files.

The question is: How much does adjusting the swappiness really affect the longevity of SD cards in such systems?

Answers should be backed up by specific experiences or references. Please keep Good Subjective, Bad Subjective in mind.


Get this bounty!!!

#StackBounty: #linux #centos #lxc Unable to do 'yum install' inside LXC container on CentOS 7

Bounty: 100

I am trying to create CentOS container inside CentOS 7 and host my application. But I am unable to install anything inside container.

If I do
yum -y install nodejs‘ i got below error

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fibergrid.in
 * extras: mirror.fibergrid.in
 * updates: mirror.fibergrid.in
No package nodejs available.
Error: Nothing to do

It is found that internet is not available inside the container, but outside the container internet is available.


Get this bounty!!!