Re: Coding style when using atomic_dec_and_test

2024-03-30 Thread Valdis Klētnieks
On Sat, 30 Mar 2024 21:52:29 -0300, Camila Alvarez Inostroza said: > I've seen two ways of handling the resulting operation, below are a couple > of examples: > (1) if (!atomic_dec_and_test(>refcount)) >return; > call_rcu(>rcu, free_rootdomain); > > (2) if

Re: Boot stucks at "Loading initial ramdisk"

2024-01-05 Thread Valdis Klētnieks
On Fri, 05 Jan 2024 10:42:53 +0530, Aditya Gupta said: > It's a good start to use the distro config for building a kernel. > PS. I have been able to successfully boot by building with defconfig, then > manually enabling some drivers according to error messages during boot, 'make localmodconfig'

Re: Boot stucks at "Loading initial ramdisk"

2023-12-21 Thread Valdis Klētnieks
On Thu, 21 Dec 2023 17:58:23 +0530, Dileep Sankhla said: > I have cloned and built the latest rc kernel using the default config but > on boot, it stucks at "Loading initial ramdisk". I have tried booting after > removing the "quiet" option from the kernel parameters just before > selecting the

Re: when/how is the schedule() function actually called?

2023-12-08 Thread Valdis Klētnieks
On Sat, 09 Dec 2023 00:16:32 +0800, Dawei Li said: > Greetings! > (Although I am using the 2.6.34 version, I believe the question is generally > applicable to any kernel version.) That is, in general, a bad assumption when you are looking at kernel versions old enough that they count as digital

Re: Earlier Linux Code...

2023-05-27 Thread Valdis Klētnieks
On Fri, 26 May 2023 13:28:36 +0530, Deepak Goel said: > I did an online Google search but couldn't get much. Tried ChatGPT too, but > couldn't get much help. Note that ChatGPT is *NOT*, repeat *NOT* a reliable source of information, because it has no concept of "correctness" or "accuracy" of the

Re: Need help determining if the change is warranted.

2023-05-27 Thread Valdis Klētnieks
On Sat, 27 May 2023 07:05:40 +0100, Lucas Tanure said: > It's unusual for an I2C bus would suddenly stop working, so just one > check at the beginning of the function is enough. > I would remove all ret assignments apart from the first one for every > function on that driver. By the same token,

Re: trouble running lkp-tests

2023-05-20 Thread Valdis Klētnieks
On Fri, 19 May 2023 13:38:37 -0600, jim.cro...@gmail.com said: > hi all, > > anyone familiar enough with running lkp-tests to recognize these errors ? > any hints / guesses welcome ! Did you already check all the embarrassingly obvious things like a file system being full and/or out of inodes,

Re: Starting to learn Linux...

2023-05-16 Thread Valdis Klētnieks
On Tue, 16 May 2023 12:42:19 +0530, Deepak Goel said: > I want to learn more about Linux. Step 0: Learn what a kernel is, and what userspace is. Figure out if you are trying to learn how to use/administer a Linux-based system, or how to write user programs that run on Linux-based computers, or

Re: How to debug high sysload in 2,3 second

2023-05-16 Thread Valdis Klētnieks
On Mon, 15 May 2023 18:58:33 +1000, Naruto Nguyen said: > My system during idle sometimes has high sysload in 2,3 seconds > (around 70% sysload) and then come back to normal after that. I see it ... > CPU. Because I can reproduce the issue to see it, but only during 3 or > 4 minutes, ... > Could

Re: returned dma address value of dma_alloc_coherent, is it always in the lower 4GB range?

2023-03-13 Thread Valdis Klētnieks
On Mon, 13 Mar 2023 21:28:28 +0900, "Chan Kim" said: > which is 32-bit addressable. Even if the device indicates (via the DMA > mask) > that it may address the upper 32-bits, consistent allocation will only > return > 32-bit addresses for DMA if the consistent DMA mask has been > explicitly

Re: unmap memory mapped with devm_ioremap_resource

2022-12-09 Thread Valdis Klētnieks
On Fri, 09 Dec 2022 12:58:20 -0700, jim.cro...@gmail.com said: > On Fri, Dec 9, 2022 at 9:14 AM Adrian Fiergolski > wrote: > > Does the community have any other ideas? Or I am wrong, and devm_iounmap is > > enough? > I dunno, but it says you asked ~4 hrs ago. > I bet you could just try it and

Re: Abbreviation for variables

2022-10-01 Thread Valdis Klētnieks
On Sat, 01 Oct 2022 18:56:41 +0200, Philipp Hortmann said: > Here some examples of the names I want to change. Why? What actual improvement would accrue from doing this? (Hint: the code is almost certainly in drivers/staging because it has far worse issues than just using camel-case variable

Re: Can I debug busybox program running on a qemu virtual machine using gdb?

2022-07-07 Thread Valdis Klētnieks
On Fri, 08 Jul 2022 10:11:53 +0900, "Chan Kim" said: > I get the message "tftp: sendto: Network is unreachable". Unless you did something *really* drastic, like figure out how to build the kernel without IPv4 support (is that even possible yet?), or leave out support for whatever virtual network

Re: What to do when your patch gets ignored

2022-07-04 Thread Valdis Klētnieks
On Mon, 04 Jul 2022 16:57:23 +0200, Andrea Tomassetti said: > From: Andrea Tomassetti > > Hi all, > thank you very much to have pointed out the footer problem. > > It took sometime to my IT dpt to figure out a solution, but > now we have it. Hopefully, their solution was "Don't blindly attach

Re: What to do when your patch gets ignored

2022-06-11 Thread Valdis Klētnieks
On Fri, 10 Jun 2022 16:34:03 +0200, Greg KH said: > Now deleted. > > Note, this footer requires kernel developers to delete any email sent > with it as it is not compatible with the kernel license at all. I had a standard form letter for that sort of nonsense, which asked if they wanted us to

Re: request for feedback before sending this patch

2022-06-09 Thread Valdis Klētnieks
On Mon, 06 Jun 2022 23:09:02 -0700, ozzloy said: > lol, when do you sleep? > you reply so quickly, and did so last time i tried too. > thanks for the feedback. much appreciated! A long time ago on a mailing list far away, Linus Torvalds said: "Note that nobody reads every post in

Re: Hacking the schedutil governor to upshift to maximum clock rate at every process dispatch.

2022-05-26 Thread Valdis Klētnieks
On Mon, 23 May 2022 17:37:09 +0300, David Kra said: > I am considering modifying the scheduler and governor to get a jackrabbit > start whenever a process is dispatched. Before learning how to, I would > like some advice on whether to, and how much to do. Step 0: gather actual data, and see if

Re: UAPI syscall exception interpretation

2022-05-13 Thread Valdis Klētnieks
On Wed, 11 May 2022 21:19:42 -, Muhammad Ali said: > Does the Linux-syscall-note say that a.out can ALL be under any license of > your choice? > Or do you have to note that your binary is under License X and also includes > code which is under license GPL-2.0-WITH-Linux-syscall-note? Not a

Re: smp_processor_id used in preemptable context ?

2022-04-29 Thread Valdis Klētnieks
On Thu, 28 Apr 2022 11:15:27 +0200, Vincent Ray said: > Then I guess it could be preempted at any time, especially with aggressive > versions of preemptions ? > And if so, are we not at risk that our thread is migrated to an other CPU > just after smp_processor_id returned ? Often, we don't

Re: Exporting cpu instruction set to kernel .config file

2022-03-03 Thread Valdis Klētnieks
On Thu, 03 Mar 2022 20:51:09 +0530, Guddla Rupesh said: > Finally my request is there any way to export instruct set of my cpu to the > kernel configuration and so after compilation my video encoding takes less > time than previous. Why would the instruction set used by the kernel matter, when

Re: How do I start contributing to the Linux kernel?

2022-02-24 Thread Valdis Klētnieks
On Wed, 23 Feb 2022 17:24:49 -0300, Rog�rio Valentim Feitoza da Silva said: > How do I start contributing to the Linux kernel, as a person who has > never contributed before? First, figure out *why* you want to contribute.

Re: *** Compiler is too old

2022-02-22 Thread Valdis Klētnieks
On Sun, 20 Feb 2022 23:52:47 -0500, Aruna Hewapathirane said: > *** Compiler is too old. > > What would be the sanest way to do this? Meaning upgrade gcc and friends ? Well... the answer to the posed question is, of course, "install gcc 5.1 or later" (and even *that* is pretty damned ancient -

Re: Need good starting point

2022-02-15 Thread Valdis Klētnieks
On Tue, 15 Feb 2022 21:00:33 +0530, Ankit Pandey said: > I will be glad if someone can give me pointers for a good starting point to > contribute. Some guy wrote this a while back, and it's still mostly relevant. https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.html

Re: Fwd: Need guidance regarding fixing styleguide error in rtl871x_pwrctrl.h

2022-02-09 Thread Valdis Klētnieks
On Tue, 08 Feb 2022 23:26:54 +0530, Ankit Pandey said: > And I was asked to verify if there is some specific meaning is attached to > comment here (which was causing the issue). > I would be glad you could explain me how should I approach this issue? One > way would > be to rewrite that these

Re: Kernel freezes instead of panicking

2022-02-08 Thread Valdis Klētnieks
On Tue, 08 Feb 2022 08:03:56 +0300, David Kahurani said: > I figured I could use kdump to save the dmesg logs but it doesn't seem to > work with later kernels. kdump is probably overkill for just saving dmesg. If you're booting x86_64 in UEFI mode, using pstore to save the dmesg is probably a

Re: Time: new clocksource

2021-12-08 Thread Valdis Klētnieks
On Tue, 07 Dec 2021 13:03:07 +0530, Muni Sekhar said: > Which module is responsible for resulting in the absolute time? Is > absolute time synchronized across multiple systems connected on the > network? man -k ntp Keeping the system clock in sync with external timesources and reality is too

Re: loading a simple hypervisor(just prints Hello World) before the linux kernel

2021-11-10 Thread Valdis Klētnieks
On Wed, 10 Nov 2021 23:38:11 +0500, Mushahid Hussain said: > I have successfully done so. I can see the Hello World printed to UART by > two different binaries. What I cannot do is to jump from a binary(let's > call it a simple hypervisor, which prints Hello World) at EL2 to the > standard linux

Re: Kernel module that shuts down the device

2021-11-07 Thread Valdis Klētnieks
On Sun, 07 Nov 2021 18:16:55 -0600, Drew Abbott said: > You mentioned that this shouldn't be called in an irq context, but the > unplug event is detected with an irq. Where should I be calling > kernel_power_off() if not in the irq context? I think one way of doing this > would be to set a value

Re: Loading a simple "kernel" at the address other than default on Raspberry Pi 4

2021-11-02 Thread Valdis Klētnieks
On Tue, 02 Nov 2021 17:13:16 +0500, Mushahid Hussain said: > I have written a simple kernel which prints Hello World to UART. The simple > kernel works successfully and prints Hello World to UART, if I load it at > 0x8, which is the default load address for the 64-bit kernel. > > There's a

Re: Any tracing mechanism can track the executed instructions of a user process in the kernel?

2021-10-18 Thread Valdis Klētnieks
On Mon, 18 Oct 2021 16:41:14 +0800, Dongliang Mu said: > I want to log all the executed instructions of a user process (e.g., > poc.c in syzkaller) in the kernel mode and then would like to leverage > backward analysis to capture the root cause of kernel panic/crash. > Therefore, I need the

Re: ALSA kernel projects - for academic purposes

2021-09-30 Thread Valdis Klētnieks
On Wed, 29 Sep 2021 11:07:15 -0400, Ruben Safir said: > > such that when the patch(set) is finally accepted by the Linux > > community and Linus Torvalds ultimately, you can write a paper about > > it. > They are not writing a paper for Linus. They are writing it for their > dean or mentor. On

Re: List of all available kernel modules per version

2021-09-24 Thread Valdis Klētnieks
> On Fri, 24 Sep 2021 18:08:01 -0600, jim.cro...@gmail.com said: > > > grumble/ > > ive often wanted lsmod -b to tell me that list. or something like that. > > maybe a different rc > > See CONFIG_ICONFIG and friends in init/Kconfig > > That will give you not just the module list, but the entire

Re: List of all available kernel modules per version

2021-09-24 Thread Valdis Klētnieks
On Fri, 24 Sep 2021 18:08:01 -0600, jim.cro...@gmail.com said: > grumble/ > ive often wanted lsmod -b to tell me that list. or something like that. > maybe a different rc See CONFIG_ICONFIG and friends in init/Kconfig That will give you not just the module list, but the entire .config the

Re: ALSA kernel projects - for academic purposes

2021-09-24 Thread Valdis Klētnieks
On Fri, 24 Sep 2021 19:34:59 +0530, Muni Sekhar said: > What small projects would you suggest to a novice with the ALSA > kernel. The aim is to develop a familiarity with the ALSA kernel > source code, and also to submit it for academic purposes. A good place to start is getting a good handle on

Re: List of all available kernel modules per version

2021-09-23 Thread Valdis Klētnieks
On Thu, 23 Sep 2021 18:39:22 +0200, Leon Gross said: > If got more of a general question: Is there a way to list all the > standard kernel modules that are included in a specific kernel version? > And I don't meant the currently running modules I could get via lsmod > but I mean all the modules

Re: efivars

2021-09-23 Thread Valdis Klētnieks
On Wed, 22 Sep 2021 22:07:28 -0400, Ruben Safir said: > Aside from that, I really just want to know what efi varriables exist On Thu, 23 Sep 2021 00:01:20 -0400, Ruben Safir said: > What is all this garbage? > > ~$ sudo ls /sys/firmware/efi/efivars/ |wc > 211 211 11511 Put the keyboard

Re: efivars

2021-09-22 Thread Valdis Klētnieks
On Wed, 22 Sep 2021 11:58:55 -0400, Ruben Safir said: > OS's shouldn't need anything from a boot loader. That ties the OS to > the bootloader completely without need. You might want to read Documentation/x86/boot.rst and think about what the OS is expecting to get passed from the boot loader,

Re: Commit messages in a series of patches

2021-09-17 Thread Valdis Klētnieks
On Fri, 17 Sep 2021 11:12:45 +0200, FMDF said: > My question is: why "This patch is preparation for _io_ops [future] > structure removal." is good while "Eventually this function will be > deleted but some of the code will be reused later." is not. The first is specific about what is being

Re: thrashing on format %u vs size_t arg

2021-09-14 Thread Valdis Klētnieks
On Tue, 14 Sep 2021 09:32:33 -0600, jim.cro...@gmail.com said: > Im getting what appears to be conflicting warnings > about %u vs unsigned int (sometimes unsigned long int) > depending upon platform ?? Hint: What size is a size_t on a 32 bit platform, and on a 64 bit platform?

Re: Vmalloc.h implicit functions

2021-09-08 Thread Valdis Klētnieks
On Wed, 08 Sep 2021 12:02:39 +0200, Omar Mustafa said: > The driver is RTL8822BE Bluetooth That's not what I asked for. And that's not the *driver*, that's the *device*. For example, this laptop has an Ethernet and a wireless card: [~] lspci -nn |grep -i net 01:00.0 Ethernet controller [0200]:

Re: Vmalloc.h implicit functions

2021-09-07 Thread Valdis Klētnieks
On Wed, 08 Sep 2021 07:46:13 +0200, Omar Mustafa said: > Okay my kernel is 5.13.9-generic and I have tried what you mentioned but > failed > the only remaining solution I can think of is trying to install the Windows > driver through NDISWrapper and it’s the RTL8822BE Bluetooth not the WiFi

Re: Vmalloc.h implicit functions

2021-09-07 Thread Valdis Klētnieks
On Tue, 07 Sep 2021 18:06:26 +0200, Omar Mustafa said: > It’s the RTL8822BE Bluetooth which I have tried each and every solution > online ever existed and failed Looks like the PCI card variant has been supported for a while: [/usr/src/linux-next] git blame

Re: Kernel bug tracker

2021-09-03 Thread Valdis Klētnieks
On Fri, 03 Sep 2021 13:00:55 +0200, "Thomas Schmitt" said: > I could offer bugs of isofs with explanations and patch proposals: > > - isofs: prevent file time rollover after year 2038 > Change the return type of function iso_date() from int to time64_t. The tricky part is, of course, that for

Re: Re[2]: Kernel bug tracker

2021-08-31 Thread Valdis Klētnieks
On Sun, 29 Aug 2021 12:39:28 +0300, Adverg Ebashinskii said: > Hi Anatoly, > Thank you very much for your response. https://bugzilla.kernel.org looks > exactly what I was looking for. Note that the Bugzilla probably *isn't* what you're looking for, if you're looking for small easy patches to

Re: surround complex macros in ()

2021-08-26 Thread Valdis Klētnieks
On Wed, 25 Aug 2021 22:21:44 -0700, daniel watson said: > let me know if this is the right place to ask. > > i recently tried to make a commit adding parentheses around a macro > value. > > https://lore.kernel.org/linux-staging/20210817043038.ga9...@challenge-bot.com/ > > it was rejected as "This

Re: how do you find the subsystem of a file?

2021-08-21 Thread Valdis Klētnieks
On Sat, 21 Aug 2021 16:19:31 -0700, daniel watson said: > On Sat, Aug 21, 2021 at 12:30:27AM -0700, daniel watson wrote: > > Documentation/process/submitting-patches.rst says to see the T: entry > > for the subsystem in MAINTAINERS to find the right tree to base the > > patch on. If there's no

Re: VFS: Cannot open root device "(null)" or unknown-block(0, 0): error -2

2021-08-14 Thread Valdis Klētnieks
On Fri, 13 Aug 2021 18:08:38 -0600, jim.cro...@gmail.com said: > then I added BTRFS_FS, since thats the host fs. > of course it didnt work. > VFS: Cannot open root device "(null)" or unknown-block(0,0): error -2 > Please append a correct "root=" boot option; here are the available > partitions:

Re: LDD 3rd ed. - It was: Re: read() via USB bus

2021-08-12 Thread Valdis Klētnieks
On Thu, 12 Aug 2021 11:45:45 +0200, "Fabio M. De Francesco" said: > I've heard that your book, LDD 3rd edition, has become obsolete a long time > ago and most sample code cannot anymore build. Reading what you wrote above > seems to contradict what I've been told by others... I must admit that

Re: Multi-touch USB weird response

2021-07-29 Thread Valdis Klētnieks
On Thu, 29 Jul 2021 12:57:03 -, Jorge Fernandez Monteagudo said: > Event: time 1627381396.770902, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value > 35023100 > Event: time 1627381396.770902, -- SYN_REPORT > Event: time 1627381396.780891, type 4 (EV_MSC), code 5

Re: [RFC PATCH 3/8] block: Add kernel APIs to create & delete block device LED triggers

2021-07-28 Thread Valdis Klētnieks
On Wed, 28 Jul 2021 20:53:39 -0500, Ian Pilcher said: > * New file - include/linux/blk-ledtrig.h > > Signed-off-by: Ian Pilcher > --- > block/blk-ledtrig.c | 152 > include/linux/blk-ledtrig.h | 19 + > 2 files changed, 171 insertions(+) >

Re: [RFC PATCH 2/8] block: Add block device LED trigger list

2021-07-28 Thread Valdis Klētnieks
On Wed, 28 Jul 2021 20:53:38 -0500, Ian Pilcher said: > * New config option (CONFIG_BLK_LED_TRIGGERS) to enable/disable > block device LED triggers > > * New file - block/blk-ledtrig.c Is this bisect-clean (as in "will it build properly with that config option set after each of the succeeding

Re: [RFC PATCH 1/8] docs: Add block device LED trigger documentation

2021-07-28 Thread Valdis Klētnieks
On Wed, 28 Jul 2021 20:53:37 -0500, Ian Pilcher said: > +Create a new block device LED trigger:: > + > + # echo foo > /sys/class/block/led_trigger_new > + > +The name must be unique among all LED triggers (not just block device LED > +triggers). > + > +Create two more:: > + > + # echo bar

Re: Return value for "impossible" situations

2021-07-25 Thread Valdis Klētnieks
On Sun, 25 Jul 2021 13:07:21 -0500, Ian Pilcher said: > Is there any sort of convention around what to return in the case of an > error in the logic of the code itself, something that will make it as > obvious as possible that the problem is a bug. In general, there's no good way to signal such

Re: Kernel first task

2021-07-12 Thread Valdis Klētnieks
On Sat, 10 Jul 2021 11:22:59 -, Anton Baltser said: > I'm trying to get involved into Kernel Devolopment and confused about where I > can take the first task to complete. There's always low-hanging fruit in drivers/staging. The various drivers there *should* have a TODO. And of course

Re: How to comment or reply to others?

2021-07-08 Thread Valdis Klētnieks
On Thu, 08 Jul 2021 11:49:46 -0600, jim.cro...@gmail.com said: > On Sun, Jul 4, 2021 at 9:36 AM Valdis Klētnieks > wrote: > > > smtpEncryption = ssl > > > smtpServer = smtp.gmail.com > > > smtpUser = my-email-addr...@gmail.com > > > smtpServerPort = 465 > I have tls, and port = 587, and an

Re: How to comment or reply to others?

2021-07-04 Thread Valdis Klētnieks
On Sun, 04 Jul 2021 11:13:08 +0200, Abd-Alrhman Masalkhi said: > I have allready set up the .gitconfig file with following configuration: > > smtpEncryption = ssl > smtpServer = smtp.gmail.com > smtpUser = my-email-addr...@gmail.com > smtpServerPort = 465 Try 'smtpEncryption = tls' instead.

Re: Kernel Compile Issue

2021-06-26 Thread Valdis Klētnieks
On Fri, 25 Jun 2021 16:05:45 -0400, Aruna Hewapathirane said: > Jun 25 10:46:42 debian systemd-modules-load[201]: Failed to find module > 'vmhgfs' > Jun 25 10:46:42 debian systemd[1]: Failed to start Load Kernel Modules. > Jun 25 10:46:42 debian systemd[1]: Unit systemd-modules-load.service

Re: Kernel Compile Issue

2021-06-24 Thread Valdis Klētnieks
On Thu, 24 Jun 2021 19:36:08 -0400, Aruna Hewapathirane said: > but after selecting the new kernel at the GRUB2 menu it hangs at the graphical > login and I am stumped. Does control-alt-F2, -F3, -F4 get you line mode consoles? If so, you should be able to login, and get dmesg, the X server log,

Re: Kernel Compile Issue

2021-06-24 Thread Valdis Klētnieks
On Thu, 24 Jun 2021 14:19:04 -0400, Aruna Hewapathirane said: > Could well be ... but 'locate' shows me this: > > aruna@debian:~$ locate Makefile.normal > /usr/src/open-vm-tools-9.4.6/vmci/Makefile.normal > /var/lib/dkms/open-vm-tools/9.4.6/build/vmci/Makefile.normal Note that 'locate' doesn't

Re: USB sound card issues

2021-06-15 Thread Valdis Klētnieks
On Sat, 12 Jun 2021 16:45:00 +0530, Muni Sekhar said: > > And if it's configurable for multiple formats, was it set for the correct > > one? > Is there a way to verify was it set for the correct one or not? arecord -v gives what it thinks the setup is. > > Does the record die immediately, or

Re: Getting backtrace of a process

2021-06-15 Thread Valdis Klētnieks
On Mon, 14 Jun 2021 20:40:57 +0530, hemanth nandish said: > As per my understanding, the *do_coredump* kills the faulty process inside > *coredump_wait* function before invoking the userspace handler, > This might be the reason the libunwind fails to gather the backtrace as it > uses PTRACE

Re: USB sound card issues

2021-06-11 Thread Valdis Klētnieks
On Tue, 08 Jun 2021 16:20:07 +0530, Muni Sekhar said: > $ arecord --device hw:1,0 --channels 1 --format S16_LE --rate 32000_Hz x.wav > Recording WAVE 'x.wav' : Signed 16 bit Little Endian, Rate 32000 Hz, Mono > arecord: pcm_read:2032: read error: Input/output error Always check the obvious stuff

Re: How to test device driver?

2021-05-18 Thread Valdis Klētnieks
On Tue, 18 May 2021 08:53:58 +0900, Hyeonggon Yoo said: > I recently was tracking syzbot report that is occured in > sound driver. I don't have the device, but was curious about > what the test method is. Depends what the bug was. > well, build tests are useful but it is not enough, we should

Re: Does FreeRTOS works on Linux?

2021-05-10 Thread Valdis Klētnieks
On Sun, 09 May 2021 08:40:56 +0200, lo�c tourlonias said: > related to our architecture. We are working on a ARM Cortex-A7 which > have an isolation between a normal world and a secure world. Linux is > working on the normal world for the UI and FreeRTOS is running on the > secure world. Is

Re: deleting timer that re-registers itself

2021-05-04 Thread Valdis Klētnieks
On Tue, 04 May 2021 12:17:56 -0400, "Valdis KlD tnieks" said: > void __exit timer_exit(void) { > exiting = 1; -ENOCAFFEINE That still needs a few memory barriers. See Documentation/memory_barriers.txt for the gory details. pgp_TgzDbFoJ9.pgp Description: PGP signature

Re: deleting timer that re-registers itself

2021-05-04 Thread Valdis Klētnieks
On Tue, 04 May 2021 23:59:12 +0900, Hyeonggon Yoo said: > Does del_timer work well for timers that re-registers itself? > what if the timer is currently running, and del_timer is called, > and the running timer re-registers itself? Minor nit: while the timer is running, there's no problem. When

Re: high precision timers

2021-05-03 Thread Valdis Klētnieks
On Mon, 03 May 2021 00:56:17 +0900, Hyeonggon Yoo said: > I mean, is there an API that guarantees high precision (non architecture > dependent way) How do you guarantee high precision if you're on hardware that doesn't provide a high precision/resolution timer? pgpdtBPU6HIVO.pgp Description:

Re: [PATCH] drivers: pnp: proc.c: Handle errors while attaching devices

2021-04-28 Thread Valdis Klētnieks
On Tue, 27 Apr 2021 07:26:27 +0300, Leon Romanovsky said: > On Mon, Apr 26, 2021 at 11:20:32PM +0530, bkkarthik wrote: > > These were only intended for a clean-up job, the idea of this function came > > from how PCI handles procfs. > > Maybe those should be changed? > > Probably, the

Re: [PATCH] drivers: pnp: proc.c: Handle errors while attaching devices

2021-04-24 Thread Valdis Klētnieks
On Sun, 25 Apr 2021 01:13:01 +0530, Anupama K Patil said: > Changed sprintf() to the kernel-space function scnprintf() as it returns > the actual number of bytes written. > + if (!bus->procdir) { > + scnprintf(name, 16, "%02x", bus->number); > + scnprintf(name, 16, "%02x",

Re: Importing the Japanese Shift-JIS encoding to the kernel's locale

2021-04-23 Thread Valdis Klētnieks
On Sat, 24 Apr 2021 01:36:13 -0400, HerbalNekoTea said: > Hi, i have kinda found a method a couple years ago to import the Japanese > Shift-JIS encoding from Fedora/CentOS/RHEL/OpenSuse to any other > distribution and i keep forgetting to maintain the sideloading method when > the kernel update

Re: TCP syn flooding protection

2021-04-23 Thread Valdis Klētnieks
On Fri, 23 Apr 2021 15:45:54 +0900, JeongHwan Kim said: > I'm testing packet flooding test with old kernel version 2.6.30. [/usr/src/linux-next] git show v2.6.30 | grep Date Date: Tue Jun 9 20:05:37 2009 -0700 [/usr/src/linux-next] git diff --shortstat v2.6.30..HEAD 82911 files changed,

Re: Is there documentation for what each script in linux/scripts does?

2021-04-20 Thread Valdis Klētnieks
On Tue, 20 Apr 2021 19:56:23 -, Esme Xuan Lim said: > I was wondering since there�s loads of useful stuff in there it seems, but > there's little documented on what goodies there are or what they do Most of them are used by the build process, and are named reasonably self-descriptively, so

Re: Notify special task kill using wait* functions

2021-04-09 Thread Valdis Klētnieks
On Fri, 09 Apr 2021 08:06:21 -0700, Andi Kleen said: > Thinking more about it what I wrote above wasn't quite right. The cache > would only need to be as big as the number of attackable services/suid > binaries. Presumably on many production systems that's rather small, > so a cache (which

Re: Notify special task kill using wait* functions

2021-04-07 Thread Valdis Klētnieks
On Wed, 07 Apr 2021 19:51:51 +0200, John Wood said: > When brute detects a brute force attack through the fork system call > (killing p3) it will mark the binary file executed by p3 as "not allowed". > From now on, any execve that try to run this binary will fail. This way it > is not necessary

Re: Notify special task kill using wait* functions

2021-04-06 Thread Valdis Klētnieks
On Mon, 05 Apr 2021 09:31:47 +0200, John Wood said: > > And how does the kernel know that it's notifying a "real" supervisor > > process, > > and not a process started by the bad guy, who can receive the notification > > and decide to respawn? > > > Well, I think this is not possible to know.

Re: Notify special task kill using wait* functions

2021-04-04 Thread Valdis Klētnieks
On Sun, 04 Apr 2021 11:48:37 +0200, John Wood said: > that exec and the child crashes is mitigated. The only drawback here, as > point Andi, is that a supervisor respawns some process killed. To avoid > this situation he suggest to notify to usersapace via wait* that the > task has been killed by

Re: Notify special task kill using wait* functions

2021-04-03 Thread Valdis Klētnieks
On Sat, 03 Apr 2021 09:02:26 +0200, John Wood said: > Currently, the scenario you propose is fully mitigated :). And notifying to > userspace that all the tasks has been killed by "Brute" not decrease the > security. It adds the possibility that the supervisor adopts the correct > policy. So

Re: Notify special task kill using wait* functions

2021-04-02 Thread Valdis Klētnieks
On Fri, 02 Apr 2021 14:49:32 +0200, John Wood said: > the attack can be started again. So, he suggested that notifying to userspace > (via wait*() functions) that a child task has been killed by the "Brute" LSM, > the supervisor can adopt the correct policy and avoid respawn the killed >

Re: pid start time and new display field in proc pid stat [ race in task->start_boottime , start_time]

2021-04-02 Thread Valdis Klētnieks
On Thu, 01 Apr 2021 20:20:04 +0530, Navin P said: > After printing the task->start_boottime as 53rd field, i found > multiple process containing same value due to a race. The race exists > for p->start_time as well. Well, yeah. There's no existing reason that the kernel shouldn't be able to

Re: Notify special task kill using wait* functions

2021-03-30 Thread Valdis Klētnieks
On Tue, 30 Mar 2021 19:34:59 +0200, John Wood said: > The question is: How can I notify to wait* functions that the task has > been killed by the "Brute" LSM. What wait* functions even *care* that your LSM was what killed it? If you're caring about somehow notifying userspace that it was your

Re: "Invalid signature" issue on dev kernel launch

2021-03-24 Thread Valdis Klētnieks
On Wed, 24 Mar 2021 14:58:05 +0200, you said: > What kind of changes in the kernel require testing with valid signatures ? Pretty much only changes that affect module signing. If your threat model doesn't include "hacker sticks rogue module on your box and gets it loaded to install backdoor",

Re: "Invalid signature" issue on dev kernel launch

2021-03-24 Thread Valdis Klētnieks
On Wed, 24 Mar 2021 09:21:31 -0400, Aruna Hewapathirane said: > > And all of that has to fit in 8K of stack. That's why we warn when things > > have > > a large stack frame entry. > I still don't understand why the 8K barrier ? Why can't we make it say 16K ? The issue is that then you need 4

Re: "Invalid signature" issue on dev kernel launch

2021-03-23 Thread Valdis Klētnieks
On Tue, 23 Mar 2021 22:36:33 -0400, Aruna Hewapathirane said: > I also see: > CC drivers/cpufreq/cpufreq_ondemand.o > drivers/cpufreq/cpufreq_ondemand.c: In function ‘od_set_powersave_bias’: > drivers/cpufreq/cpufreq_ondemand.c:446:1: warning: the frame size of 1032 > bytes is larger

Re: "Invalid signature" issue on dev kernel launch

2021-03-23 Thread Valdis Klētnieks
On Tue, 23 Mar 2021 18:36:58 +0200, Gidi Gal said: > knowledge on this subject), I am now facing "invalid signature" error when > I reboot with my installed dev kernel. When/where exactly are you getting that error? There's three major places where things can go wrong: 1) If you're using secure

Re: How to switch between installed kernel and developed kernel

2021-03-23 Thread Valdis Klētnieks
On Tue, 23 Mar 2021 00:29:10 -0400, Aruna Hewapathirane said: > Use : linux-check-removal That's a debian-specific thing... > > Seriously - if you're not comfortable with that level of sysadmin > > procedures, > > maybe you shouldn't be a kernel hacker... > > > Do not listen to Valdis in this

Re: How to switch between installed kernel and developed kernel

2021-03-23 Thread Valdis Klētnieks
On Tue, 23 Mar 2021 16:37:13 +0200, you said: > I gave up for now and prepared bash script for removing the files, based on > the information in > https://www.cyberciti.biz/faq/debian-redhat-linux-delete-kernel-command/ > (see "A note about custom compiled Linux kernel" section). In my opinion, >

Re: How to switch between installed kernel and developed kernel

2021-03-22 Thread Valdis Klētnieks
On Tue, 23 Mar 2021 00:01:22 +0200, Gidi Gal said: > Many thanks for your reply, Aruna. Is there a way to remove the installed > '5.12.0-rc3-GIDI_DEV+' kernel ? A reverse command for the 'sudo make > modules_install install' command ? I found this link which explains how to > do it manually ( >

Re: How to switch between installed kernel and developed kernel

2021-03-22 Thread Valdis Klētnieks
On Mon, 22 Mar 2021 14:11:58 +0200, Gidi Gal said: > I am new to kernel development, currently working on > https://kernelnewbies.org/FirstKernelPatch. I reached the step "Install > your changes" in "Modifying a driver on native Linux". I would like to > separate my developed kernel and my

Re: picking the first patch

2021-03-21 Thread Valdis Klētnieks
On Sun, 21 Mar 2021 12:03:36 -0400, Harsha Vardhan said: > So far I have spent a lot of time dreaming to be a kernel hacker without > doing much , 1) What Greg said.. :) 2) Go read this: https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.html And yes, *why* you want to

Re: is there an efficient module_is_builtin() test ?

2021-03-09 Thread Valdis Klētnieks
On Tue, 09 Mar 2021 12:55:14 -0700, jim.cro...@gmail.com said: > To use the index, I need _sites[], and that only works > for builtin-module's callsites. For loaded modules, I can/have > added a pointer to the section into module load_info, giving me > the base I will need for the ! builtin

Re: Enquiry

2021-02-10 Thread Valdis Klētnieks
On Wed, 10 Feb 2021 10:10:21 +0530, Abhijit Paul said: > Hello, I am new to kernel development. As a beginner, I don't know which > part I will work on. Can anyone suggest me what I do as a beginner? https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.html Read that, think

Re: Changelog of features / drivers removed from kernel?

2021-02-09 Thread Valdis Klētnieks
On Mon, 08 Feb 2021 09:00:27 -0500, Evan T Mesterhazy said: > Thanks, Greg - good suggestion regarding `git bisect`. I was able to narrow > it down to a change between 5.8 and 5.9, so maybe that's the next logical > thing to do. None of the config options added between those releases seemed >

Re: '-D' 'KBUILD_MODSYM=main - like KBUILD_MODNAME, without the quotes ?

2021-01-28 Thread Valdis Klētnieks
On Thu, 28 Jan 2021 12:11:54 -0700, jim.cro...@gmail.com said: > In my hacking, Im finding this useful. > it adds a version of KBUILD_MODNAME without the quotes OK, I'll bite. When and how is this useful? > KBUILD_MODNAME has the quotes for a reason; Hint: do a "git grep KBUILD_MODNAME",

Re: Doubt on show() function of sysfs attribute

2021-01-26 Thread Valdis Klētnieks
On Tue, 26 Jan 2021 23:07:24 +0530, Mohana Datta Yelugoti said: > Hello everyone, > > I am going through Documentation/filesystems/sysfs.rst. > > It says that sysfs allocates a buffer of size PAGE_SIZE and > passes it to the show/store functions of the attribute. On > read(), the show() method

Re: new module is not compiled

2021-01-26 Thread Valdis Klētnieks
On Tue, 26 Jan 2021 14:24:13 +0100, Dario Pagani said: > What am I doing wrong? > --- a/drivers/hid/Makefile > +++ b/drivers/hid/Makefile > @@ -112,6 +112,7 @@ obj-$(CONFIG_HID_STEELSERIES) += hid-steelseries.o > obj-$(CONFIG_HID_SUNPLUS)+= hid-sunplus.o > obj-$(CONFIG_HID_GREENASIA)

Re: /proc/cpuinfo not showing all info

2021-01-19 Thread Valdis Klētnieks
On Tue, 19 Jan 2021 07:38:13 +, "Pankaj Vinodrao Joshi" said: > i agree each processor type exports different information but i need to pop > up information while i do /proc/cpu also i have observed that almost every > arch > display information w.r.t frequency. Can you suggest how i can add

Re: 回复:How to join other mailing lists

2021-01-14 Thread Valdis Klētnieks
On Fri, 15 Jan 2021 08:16:21 +0800, "‪bigbird2...@163.com‬" said: > Thank you, I'll just look at one list, in order to learn. Which list is > suitable for getting started? That will in very large part depend on why you're interested in the kernel. If you're trying to get a weird USB widget

Re: How to join other mailing lists

2021-01-14 Thread Valdis Klētnieks
On Thu, 14 Jan 2021 09:00:29 +0200, Alexander Kapshuk said: > On Thu, Jan 14, 2021 at 8:14 AM bigbird2...@163.com > wrote: > > I've just added a newbies mailing list, How to join other mailing lists, > > and I'd like to see what other people are communicating with. > Not sure what other lists

Re: [PATCH 0/4] Help to debug spinlocks

2020-12-20 Thread Valdis Klētnieks
On Sun, 20 Dec 2020 12:47:08 +0100, John Wood said: > disable interrupts. Then, the task_free hook was call from an IRQ context > and tried to acquire the same lock in a write state. OK, I'll bite. Why was task_free called from an IRQ context in the first place? That sounds awfully fishy.

Re: [RFC PATCH 2/2] security/brute.c: Protect the stats pointer

2020-12-08 Thread Valdis Klētnieks
On Tue, 08 Dec 2020 11:35:57 +0100, John Wood said: > I think the stats pointer present in the task_struct's security blob > needs to be protected against concurrency for the following reasons. > > 1.- The same process forking at the same time in two different CPUs. > 2.- The same process execve()

  1   2   3   >