Re: Set the ACPI=on on the cmdline, and the OS can not boot.

2015-09-10 Thread Valdis . Kletnieks
On Thu, 10 Sep 2015 17:41:51 +0800, tianlilai said:
>  When I set the ACPI=on on the cmdline,and the OS can not boot(If set
> ACPI=off, The system is OK). The attachmemt file is the booting log. Would
> help me slove this ploblem? Thanks very much.

>  Note:kernel version v2.6.18,and the arch is x86_64.

That's an ancient kernel - 9 years ago.  So you're missing the last 9 years
of ACPI fixes.

Also, problems like this are usually caused by the BIOS having buggy ACPI
tables that don't match the actual hardware - and if you're still on 2.6.18,
your BIOS is probably equally out of date.  And you would need to be a *lot*
more specific about the hardware than "x86_64" - for instance,"Dell Latitude
E6530 laptop with BIOS A16".

Unfortunately for you, I doubt anybody is going to want to give much more
assistance than this for free until you're running a kernel from the
last 2-3 years and the most recent BIOS the manufacturer has released.
(I can think of a number of people that will do this for contract work, but
be prepared to pay US$50/hour and up...)


pgpD7i5oZS2so.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Preceding a method call with (void)

2015-09-10 Thread Valdis . Kletnieks
On Thu, 10 Sep 2015 07:52:49 +0300, Kevin Wilson said:

> (void) myFunc(param1);
>
> I did not encounter such cases in the kernel code that I read, thus far.
>
> On the other hand, I did not saw in the kernel coding style doc
> anything which prohibits such usage.
>
> If I remember, using (void) before the method name is a way to tell
> explicitly that this method does not return any value,
> but I am not sure as for the exact reasons it is used (in userspace).

Well, if the function actually returns nothing, in kernel code we usually
declare it as:

void myFunc( int param1)
{
/* yadda yadda yadda *.
}

Given that, what reason is there for casting the return value with (void)?

(And if the function is actually   'int myFunc ( int param1) {...}',
why are you calling it and then ignoring the return value?  That's a clue
that you're abusing the API...)


pgpO8VnIka5RZ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula task 2

2015-09-08 Thread Valdis . Kletnieks
On Tue, 08 Sep 2015 20:08:57 -0600, Yacdaniel Hurtado GarcC-a said:

> atm i get this kernel version: 4.2.0-rc8 i dont know if i am doing
> something wrong.Thanks

You may or may not be doing something wrong.  But you're probably
no longer doing the Eudyptula challenge. :)


pgp7sH4uoAi2S.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to get the dentry value - no path_lookup

2015-09-07 Thread Valdis . Kletnieks
On Mon, 07 Sep 2015 12:10:56 +0530, Pria Mn said:

> return valid dentry value. My requirement is to fetch directory name from
> filepath.

First off, unless this is a class assignment, your *requirement* isn't
to fetch a directory name.

Fetching the directory name is a *solution* you're thinking of using for
a problem you're trying to solve.

So take a step back, and explain what you're trying to do, and why you thought
getting the directory name from filepath was a solution - it's quite
likely that you should be using some other API and approach entirely.

(I'd estimate that 75% of the "I can't get this API to work" questions
on the Linux kernel are because the person should be using a different API)


pgpgBwYJ3aNRJ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem with line discipline in new kernels

2015-08-23 Thread Valdis . Kletnieks
On Sun, 23 Aug 2015 10:14:20 +0300, Ruth Glushkin said:
 On Thu, 22 Aug 2015 00:21:00 -, Valdis Kletnieks said:

  Sounds like a reference counting problem.

 As far as I know, reference counter for line discipline sets to 0 in
 tty_register_ldisc(),

Not for the discipline, for the *MODULE*.

 And please advice how could I transfer data between kernel and user
 space not using filp_open() and filp_close().

Depends on the data.  sysfs, netlink, debugfs, or having userspace open the
file and using that, or any number of other ways to do it.


pgpaHhtLuS_Is.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Oops: Kernel access of bad area, sig: 11 [#1]

2015-08-23 Thread Valdis . Kletnieks
On Sun, 23 Aug 2015 05:51:12 -, Ramon Fried said:

 Unable to handle kernel paging request for data at address 0xffdc

Hmm.. Somebody missed an IS_ERR() macro?  That's a -22, -EINVAL.


pgpmL5yEu0Nbk.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem with line discipline in new kernels

2015-08-21 Thread Valdis . Kletnieks
On Thu, 13 Aug 2015 13:00:58 -, Margarita Glushkin said:
 I have a linux kernel driver for serial device, which uses line discipline
 and char device. Driver works with all old kernels, starting from 3.8 this
 driver still works, but when I unload it and load again to the memory
 (modprobe -r bpsctl_mod, after modprobe bpsctl_mod), it crashes the kernel.
 It can't unregister line discipline, because this line discipline is busy.

Sounds like a reference counting problem.  When your line discipline is busy,
somebody should have a reference on the module so it can't be unloaded.  I don't
see any such reference taking/freeing in your posted code.

Your crash is almost certainly because you're unloading it out from
under active use, which will probably result in somebody overlaying storage.
Frankly, you're probably lucky the system lives long enough for you to
reload it.

Oh, and filp_open() is usually the wrong way to solve whatever problem you
were trying to solve by using it.


pgpP1KhH98aHY.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fwd: is it possible to liimit the softirq re entrance times

2015-08-21 Thread Valdis . Kletnieks
On Fri, 21 Aug 2015 01:12:10 +0800, vichy said:

 if no, isn't it possible to make starvation in above a and b?

Operating systems have to make design choices.

You run with IRQs disabled for too long, you can starve other IRQs waiting
for service.

You run with them mostly enabled, the one handler can get starved by a
screaming interrupt (or a large number of devices all generating interrupts).

Choosing wisely is required - some devices are low-speed with large buffers,
so don't care if it takes a while to service them.  Meanwhile, others are
extremely latency-sensitive.  So in general, each driver gets designed to
fit the device's tolerance for delay.


pgphtxDoR5Np_.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Safety in Kernel Development

2015-08-21 Thread Valdis . Kletnieks
On Tue, 18 Aug 2015 21:58:15 +0800, 慕冬亮 said:

 Since I knew that Linux kernel didn't accept the pax/grsecurity , but wrote
 its own implement, and some linux developers do not have sense of security,
 I think linux security will be a problem in the future.

The fact that a specific security patch that is very invasive and comes with
some large tradeoffs was never submitted in a form suitable for merging is
*not* the same thing as kernel developers not having a sense of security.

Note that large sections of what used to be in the grsecurity patch *have*
been reworked, submitted, and accepted into the kernel.


pgpsbm9wUQ5rI.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Comprehensive Linux API manual by subsystem Required

2015-08-21 Thread Valdis . Kletnieks
On Fri, 21 Aug 2015 00:48:26 -0400, Aruna Hewapathirane said:

  I am developing a user space program which interacts with file system
 https://www.kernel.org/doc/htmldocs/filesystems/index.html

  and cryptography
 https://www.kernel.org/doc/htmldocs/crypto-API/index.html

 The best documentation IS right there in the kernel source :)

And to address why there isn't a comprehensive API manual:

Documentation/stable_api_nonsense.txt

Unless you install the tools and do a 'make kerneldoc' yourself, any manual
of the API will quickly grow out of date. The diffstat from v4.0 to v4.1 was:

 10094 files changed, 454027 insertions(+), 253911 deletions(-)

That's more churn than anybody can document - which is why LDD3, although
an excellent book, is no longer in sync with the source.

Also, some free advice: If this is for production use and not a toy project,
find an actual security/crypto expert and have them do a review.  Even better
if they are onboard during the design phase. Crypto is easy to do, but a total
bitch to do *right*.

If you don't believe me, go look at how many times OpenSSL has been broken
in the past 2 years or so.



pgpIkT0qyUHm9.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: What Next After Char, Block, Serial Parallel Drivers

2015-08-13 Thread Valdis . Kletnieks
On Tue, 11 Aug 2015 17:48:16 -, Sasha Mckinsey said:

 What should be the next steps besides looking for a job.

That's for *you* to decide, not for us to suggest.

Do authors go around asking What sort of book should I write? No - because
unless the author was interested in writing a gothic horror book, or
a romance novel, or steampunk, or what have you, it's going to be crap.
And if they *were* interested in writing a book in a given genre, they'd
not be asking for suggestions.

So go back and look at why you're interested in kernel hacking in the
first place, and base *your* answer on that.


pgphDhLEpp3zc.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel options to boot root over NFS

2015-08-07 Thread Valdis . Kletnieks
On Fri, 07 Aug 2015 22:38:11 -, Nestor Waldyd said:

 but all this *withouth* success.

You really need to be more specific regarding its failure to succeed.

Did you run a tcpdump to see the traffic?

How far did it get?  Did it pxeboot?  Did it successfully DHCP itself
an address, or did it fail?  Was an NFS mount packet received?  Did
it get a ways through there, and then die for some other reason?



pgpzAVwSWlYaO.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: debugging kernel module __init function?

2015-08-04 Thread Valdis . Kletnieks
On Tue, 04 Aug 2015 12:23:18 -0700, Nicholas Murphy said:

 How do I debug the __init function (that is called on module load)?

Is your .init function actually doing so much odd stuff that a few
carefully placed printk() calls aren't sufficient?


pgpAYpKItGKDg.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: can't create lttng-modules

2015-08-03 Thread Valdis . Kletnieks
On Mon, 03 Aug 2015 18:34:05 +0300, Jacob Gonik said:

 For the first time, i activated :
 # bitbake -c compile lttng-modules , and it fetches the source code.

 I would like to have a clue or direction to solve this.

Does the compile step produce any logs/output?  Did you check the output
for error/warning messages?


pgpf6y1mTxSw6.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fwd: USB Driver - Device No Response standard compliant

2015-08-01 Thread Valdis . Kletnieks
On Sun, 02 Aug 2015 00:04:44 -0300, Christian N said:

 I know that the presentation of the message is the responsibility of
 the application (user space), but to do this is necesary an event from
 usb driver (I think it).

A timeout with no activity at all can do it.. That's Userspace C 101 -
select() with a timeout...

  Nowdays when a non responsive device is
 attached, unable to enumerate USB device on port...  is logged a in
 dmesg, but not event is dispatched (by example in usb_uevent).
 Without an event application should poll the log (loading the system
 unnecessarily) searching new not responsive devices.

 To comply with the standard usb driver should be modified?

No, because userspace can detect the condition on its own and tell
a user about it.

 I'm probably confusing responsibilities of user and kernel space. I
 appreciate your opinion/answer.

Yes, you are.  Although I suspect the standard you're quoting is
confusing them as well


pgpLxOaNlXhxg.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: shared memory via /dev/shm?

2015-07-31 Thread Valdis . Kletnieks
On Fri, 31 Jul 2015 16:16:14 -0700, Nicholas Murphy said:
 Hmm…I suppose not.  I’d would still be curious what the right way to do 
 this
 is, though?  I think I can get away with that trick, but I can also imagine
 scenarios where I’d want the kernel module itself to create the file.

In general, the right answer is to do the file handling in userspace. Among
other things, that makes it possible to avoid hard-coding a filename in
kernel code (remember - we try to make the kernel be about mechanism, not
policy).

Among other things, it avoids the effort of opening a file that userspace
never actually does anything with - if you wait for userspace to open it
and notify the kernel, you can be pretty sure that it's about to be used.


pgpd9CbqoFzzE.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: shared memory via /dev/shm?

2015-07-30 Thread Valdis . Kletnieks
On Thu, 30 Jul 2015 16:03:51 -0700, Nicholas Murphy said:

 Yes, I’ve read all the disclaimers against accessing files in the kernel, 
 but
 I want to set up a shared memory segment between a kernel module and one or
 more user processes, and /dev/shm seems like a good way to do that.

Is there a specific reason you aren't letting the userspace program create
an mmap() area and then write the identifying information to a /sys attribute
file (or other means of notifying the kernel of what to use)?


pgptUVVtc9VjG.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: how can I find where is the macro or function deifined

2015-07-28 Thread Valdis . Kletnieks
On Tue, 28 Jul 2015 23:54:36 -, Gnoleba GNOGBO said:
 Can you give a procedure step by step  please to answer please ?

http://www.lmgtfy.com/?q=ctags+vim+tutorial
http://www.lmgtfy.com/?q=ctags+emacs+tutorial


pgpdWdmIZQnYO.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Please do not generate patches purely based on checkpatch.

2015-07-26 Thread Valdis . Kletnieks
On Sun, 26 Jul 2015 13:05:37 +0530, Yogesh Chaudhari said:

 However, is there a place which documents which maintainers(and/or
 sub-systems) accept checkpatch(or other cleanup related) patches and
 who will reject them outright? Wouldn't it be good to have this
 documented, especially given that using the checkpatch is advised in
 Documentation/SubmitChecklist?

Try something like 'git log drivers/net/wireless/whateverdev' (or
whatever part of the tree you're looking at, and see if there have been
previous checkpatch fixes in that part of the tree.


pgpBXwHTTiMcD.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: HOSTAPD Error log

2015-07-23 Thread Valdis . Kletnieks
On Thu, 23 Jul 2015 12:31:18 +0530, Amit Gupta said:

 Configuration file: /etc/hostapd.conf
 [  199.672712] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
 Failed to update rate sets in kernel module
 [  199.687566] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 Using interface wlan0 with hwaddr 00:0e:8e:38:29:e6 and ssid 'test_wifi_2'


 Eventhough I am getting this error log from user space application(hostapd)
 code, my wifi device is working fine. But I want to remove this error log
 and want to know the root cause this error log.

My gut reaction is that hostapd is issuing ioctl() calls in the wrong order
and/or failing to allow a long enough delay or wait for a specific event.

I'd recommend running something like:

# strace -f hostapd -B /etc/hostapd.conf  /tmp/strace.out 21

and go look for what failing call was made just before the write call
that output 'Failed to update'.  Hopefully, tracing the flow of that
call will reveal a  kernel code path that output the 'link is not ready'
message.  Then you'll know what 'if (somecondition)' landed you in that
situation.

Knowing that, it will become a lot easier to figure out what happened.


pgpAHGz8XyhOi.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fuzzing scheduler CFS

2015-07-22 Thread Valdis . Kletnieks
On Wed, 22 Jul 2015 10:30:47 +0300, Meyer Lansky said:
 I would like to improve the code, but has not found a practical method of 
 finding errors.

Bugs in the scheduler almost always manifest in one of two ways:

1) Truly spectacular crashes or hangs where you *know* you've found a bug.

2) Find a workload that it performs poorly (for instance - how does it deal on
a 4-core system with 8 processes that use enough memory that together, they
push the system into thrashing mode, plus 40 or 50 processes that only want
millisecond timeslices - but at a high realtime priority?  Can you find
other mixes that give it indigestion?

You're going to have to learn a lot about process scheduling to find bugs
in that code. And when I say a lot, I mean probably as much as you'd cover in
a full-semester college course




pgpXWzcgkzRSG.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Obfuscate code GPL 2 - The source uses kernel structs and GPL2 API

2015-07-21 Thread Valdis . Kletnieks
On Tue, 21 Jul 2015 15:49:22 -0300, Lucas Tanure said:

 Hi,

 This company released a obfuscated kernel module in GPL 2.
 http://www.incentivespro.com/downloads.html

 So, they didn't release the code at all. This is ok ?
 This against the law ?

We're code hackers here.

If the gpl-violations.org crew was still operating, they'd be a better
resource.  You might find a link somewhere on gnu.org to find somebody
that could offer advice...


pgpys3LGWdTXB.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Obfuscate code GPL 2 - The source uses kernel structs and GPL2 API

2015-07-21 Thread Valdis . Kletnieks
On Tue, 21 Jul 2015 20:13:48 -, Jeff Haran said:
 But it seems to me that if it builds, then they’ve released the code.

No - the GPLv2 says:

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. (yadda yadda)

So unless the engineers *prefer* the obfuscated form, they really haven't
distributed the source code.

(IANAL, I'm a code hacker, and all that. All legal advice is worth what
you paid for it...)


pgpvP2z1ORp_h.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: goto???

2015-07-17 Thread Valdis . Kletnieks
On Fri, 17 Jul 2015 10:48:53 +0200, Martin Knappe said:
 Very easy:

On Fri, 17 Jul 2015 11:40:00 +0200, Martin Knappe said:
 Like so:

On Fri, 17 Jul 2015 11:44:34 +0200, Martin Knappe said:
 Sorry, have to correct my solution. You need to add cleanupState = 0
 just before the finish, like so:

I think the fact we've seen 3 version inside an hour shows that it's
not as Very easy as originally asserted.


pgpg37muLt1ik.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Configuration settings for WM8850 wolfson audio codec

2015-07-15 Thread Valdis . Kletnieks
On Wed, 15 Jul 2015 12:26:29 +0530, bineet said:

 I need to check setting done for WM8850 wolfson audio codec chip. I tried
 browsing linux code, but couldn't find any clue.
 Could someone please help with the same?

Hmm.. are you sure it's an audio codec chip?

WMB8850 appears to be an entire ARM architecture.

[/usr/src/linux-next] git grep WM8850
Documentation/devicetree/bindings/arm/vt8500.txt:Boards with the Wondermedia 
WM8850 SoC shall have the following properties:
Documentation/devicetree/bindings/clock/vt8500.txt: wm,wm8850-pll-clock - 
for a WM8850 PLL clock
Documentation/devicetree/bindings/serial/vt8500-uart.txt:   including 
WM8850/WM8950), or wm,wm8880-uart (for WM8880 and later)
arch/arm/Kconfig.debug:   devices, including VT8500, WM8505, WM8650 and 
WM8850.
arch/arm/boot/dts/wm8850-w70v2.dts: *  - Device tree file for Wondermedia 
WM8850 Tablet
arch/arm/boot/dts/wm8850-w70v2.dts: model = Wondermedia WM8850-W70v2 
Tablet;
arch/arm/boot/dts/wm8850.dtsi: * wm8850.dtsi - Device tree file for Wondermedia 
WM8850 SoC
arch/arm/configs/multi_v7_defconfig:CONFIG_ARCH_WM8850=y
arch/arm/configs/vt8500_v6_v7_defconfig:CONFIG_ARCH_WM8850=y
arch/arm/mach-vt8500/Kconfig:config ARCH_WM8850
arch/arm/mach-vt8500/Kconfig:   bool WonderMedia WM8850
arch/arm/mach-vt8500/Kconfig: Support for WonderMedia WM8850 System-on-Chip.
drivers/clk/clk-vt8500.c:#define PLL_TYPE_WM88503
drivers/clk/clk-vt8500.c:/* Helper macros for PLL_WM8850 */
drivers/clk/clk-vt8500.c:#define WM8850_PLL_MUL(x)  x  16)  0x7F) + 
1) * 2)
drivers/clk/clk-vt8500.c:#define WM8850_PLL_DIV(x)  x  8)  1) + 1) * 
(1  (x  3)))
drivers/clk/clk-vt8500.c:#define WM8850_BITS_TO_FREQ(r, m, d1, d2)  
\
drivers/clk/clk-vt8500.c:#define WM8850_BITS_TO_VAL(m, d1, d2)  
\
drivers/clk/clk-vt8500.c:   case PLL_TYPE_WM8850:
drivers/clk/clk-vt8500.c:   pll_val = WM8850_BITS_TO_VAL(mul, div1, 
div2);
drivers/clk/clk-vt8500.c:   case PLL_TYPE_WM8850:
drivers/clk/clk-vt8500.c:   round_rate = 
WM8850_BITS_TO_FREQ(*prate, mul, div1, div2);
drivers/clk/clk-vt8500.c:   case PLL_TYPE_WM8850:
drivers/clk/clk-vt8500.c:   pll_freq = parent_rate * 
WM8850_PLL_MUL(pll_val);
drivers/clk/clk-vt8500.c:   pll_freq /= WM8850_PLL_DIV(pll_val);
drivers/clk/clk-vt8500.c:   vtwm_pll_clk_init(node, PLL_TYPE_WM8850);
drivers/pinctrl/vt8500/Kconfig:config PINCTRL_WM8850
drivers/pinctrl/vt8500/Kconfig: bool Wondermedia WM8850 pin controller driver
drivers/pinctrl/vt8500/Kconfig: depends on ARCH_WM8850
drivers/pinctrl/vt8500/Kconfig:   Wondermedia WM8850 SoCs.
drivers/pinctrl/vt8500/Makefile:obj-$(CONFIG_PINCTRL_WM8850)+= 
pinctrl-wm8850.o
drivers/pinctrl/vt8500/pinctrl-wm8850.c: * Pinctrl data for Wondermedia WM8850 
SoC
drivers/pinctrl/vt8500/pinctrl-wm8850.c:MODULE_DESCRIPTION(Wondermedia WM8850 
Pincontrol driver);
drivers/video/fbdev/Kconfig:  and WM8850 SoCs.

Hope that helps.


pgpRDMwb9MUsJ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: About Low Hanging Fruits

2015-07-14 Thread Valdis . Kletnieks
On Mon, 13 Jul 2015 13:11:57 -0400, Robert P. J. Day said:

   actually, one area of low-hanging fruit is the Documentation/
 directory, which could always use some attention. documentation is
 always getting out of date, so pick a subsystem and clean up the docs.

Good catch, I'll add it to my standard reply. :)


pgp0fWSRkia_j.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: About Low Hanging Fruits

2015-07-13 Thread Valdis . Kletnieks
On Mon, 13 Jul 2015 12:13:28 +0530, Mayur Patil said:

   I just want to know like other Open source projects is there a thing in
 linux kernel as Low hanging fruits.

The Linux kernel has been worked over by professional programmers for more
than a decade, and as a result the number of things that can be attacked
by a relatively unskilled newcomer is fairly low.

Your best place to start is probably under drivers/staging, where we put
all the stuff that's *not* up to standards yet.  Each driver should have
a TO-DO file describing what needs doing, and Greg HK is always willing to
take checkpatch style fixups for the staging tree (many other maintainers
*don't* want style patches that aren't connected to other work - if there's
other active work, they can introduce merge conflicts, and if nobody's working
on something, it's best to not touch stable code...)


pgpDnI7nl1MyO.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Knowledge of Protocols

2015-07-09 Thread Valdis . Kletnieks
On Thu, 09 Jul 2015 17:56:15 -, Mohit . said:

 I would like to know what do statements like the following mean
- Have knowledge of Protocols such as TCP/IP, IPSec, IPV6 or SSL


 Does it mean to have a theoretical view of the facets which constitute the
 protocol which can be done by reading RFC or does it also mean to have
 implementation knowledge (code understanding) as well.

It usually means understand it from the point of view of the job you're
applying for, and know it well enough to be productive/useful without
extensive training.

If you're applying for a network engineer, it means you understand at
least a bit about BGP and routing, how to use wireshark or other tools
to look at bits on the wire, identifying nodes that are having issues, etc.

If you're applying for a userspace programming job, it means you
know how to use gethostbyname(), send()/recv()/ and friends, and
how to use OpenSSL to connect to a remote system that wants to talk TLS.

If you're doing kernel hacking, it means you understand how all the
stuff under net/ works - and that if it says SSL it's time to go
running screaming into the night. :)


pgpaQLpSqS0bn.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Changel anguage

2015-07-03 Thread Valdis . Kletnieks
On Sat, 27 Jun 2015 10:57:18 -, Gnoleba GNOGBO said:
 I would like to change my language to french please.

Feel free to do so.  However, note that although almost everybody in the kernel
community can manage enough English to make themselves understood, relatively
few are proficient in French.

So you may as well say everything in English the first time around, and
avoid everybody saying Can you repeat that in English please?

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel contributions from organisations and individual privacy

2015-06-14 Thread Valdis . Kletnieks
On Fri, 12 Jun 2015 23:29:51 -, Jeff Haran said:

 Seems like unless there is some monetary sting like a piece of the proceeds
 on the sale of violating products,

You know what's an even bigger monetary sting than having to pay a percentage?

A court order banning the sale of your product entirely until such time as
you get into compliance with the GPL to the plaintiff's and judge's 
satisfaction.

And in fact, that is the single relief usually requested in a GPL violation 
case - a
ban on the offending product's distribution until the company complies. And 
violating
a direct court order like that is something that no company that intends to 
stay in
business wants to even try to get away with - it's a really good way to have 
the judge
have a hissy fit and throw all your top corporate officers in the slammer for
contempt of court.


pgp2t1hQuYWn5.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel contributions from organisations and individual privacy

2015-06-14 Thread Valdis . Kletnieks
On Sun, 14 Jun 2015 17:25:40 -0400, Nicholas Krause said:
 Why are we even trying to prove this,  it seems any intelligent company who 
 has
 a interest in staying in business will comply

The problem is companies that have mixed in their own secret sauce, and
are afraid of said sause becoming non-secret as part of their required GPL
compliance.  If you have a competent legal department, you'll file lots
of motions and so on to delay that final court order as long as you can.

See VMWare for the details - they've got enough legal staff that it took
like 7 years for Hellwig to team up with funded legal support.  And it will
almost certainly be an eventual loss for VMWare - but they can delay that for
months or years.

And VMWare certainly doesn't want to release their code - mostly because
it's almost certainly a creeping horror worthy of mockery.

If you don't believe me, go look at the GPL kernel drivers for VMWare 
Workstation
or Player, which are probably similar to the ESXi code that VMWare
would have to release.  How bad are the WS/Player drivers?  Let's just
say that Greg KH probably wouldn't let them into drivers/staging. :)


pgpxUosUK30zf.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel contributions from organisations and individual privacy

2015-06-14 Thread Valdis . Kletnieks
On Sun, 14 Jun 2015 19:36:23 -0400, nick said:
 a embedded version of Linux called NX OS I believe and its all open to my
 knowledge. Again this is stupidity in my option or companies being lazy by
 hiding there terribly written drivers.

Remember Nick - it's not a technical decision, it's a business decision.
If a company can improve the bottom line by $1M by doing something technically
ugly, something technically ugly *will* be done.

And it's usually no use standing up and fighting it if you work at the
company, because quite frankly, you're expendable.  Unless you're a superstar
who will cost more than $1M in recruiting costs and signing bonuses to
replace, the company will can your ass, recruit a replacement, do the ugly
thing, and *still* come up with more money.

And let's face it - if you're a superstar, why are you working at a company
whose product is so messed up that technically ugly work-arounds are called 
for? :)



pgpEyTQo91a9U.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel contributions from organisations and individual privacy

2015-06-12 Thread Valdis . Kletnieks
On Fri, 12 Jun 2015 00:39:21 -0400, Ruben Safir said:

 those lawsuites would be challenged for law of standing.

I do believe that has *never* been much of a problem for the guys
at gpl-violations.org - it's pretty much a slam dunk:

1) You distributed the kernel without source.

2) The kernel is covered by the GPLv2.

3) I am the author of the following lines of code: drivers/foo/..

Now I, personally, might have trouble establishing standing, because
I don't have *that* many lines of code in the kernel, and they're mostly
2-4 line patches of no large significance - Apple could probably take my
code out, and fix the build failures and so on in some other way, and ship it.

On the other hand, even Apple is going to squirm if they get a letter that
starts Hi, I'm Ted T'so and we seem to have a slight problem (where
Ted's name can be replaced by several hundred others big enough that if
you excise the code they wrote, your kernel has problems).

(For the record, it was Chris Hellwig that ended up filing suit against
VMWare - and the last I heard, VMWare hasn't even *tried* to dismiss the
suit due to lack of standing on Hellwig's part...)


pgpFVtxUM6zbH.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel contributions from organisations and individual privacy

2015-06-11 Thread Valdis . Kletnieks
On Thu, 11 Jun 2015 19:26:23 -0400, Ruben Safir said:

 Lets say Apple decides that are going to take the Linux Kernel and
 alter it extensively, in order for it to work with a new hardware platform
 that they created. And lets say don't return the code base to the public.
 Now who is going to protect the license and sue them?  You have literaly
 thousands of partiticpants who have standing now in this case.  Apple can just
 blow there nose at you if they are willing to put up with the bad publicity.

They can't just blow their nose at actual lawsuits.  Even Apple's pockets aren't
deep enough to survive several thousand contempt of court judgments when
they try to blow off several thousand lawsuits.

And I suspect Apple doesn't want that much bad publicity - the *last* thing
they need is showing up in the news as a bunch of selfish bozos.  Remember that
the Jobs Reality Distortion Field can only reach so far and do so much


pgpZukhXX5wKH.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: About Minimum HDD size for Kernel Compilation

2015-06-05 Thread Valdis . Kletnieks
On Fri, 05 Jun 2015 15:19:54 +0530, Mayur Patil said:

If I have downloaded any kernel from kernel.org site, I want to install it
how much *minimum size of H I require to compile  and install it*?

Well... the kernel I'm running now compiles in only 2.6G of disk space.

The fun is what else is needed - if you use git, that's another 1.2G for
the current git tree.  You'll need a toolchain including compilers etc.

You'll need a userspace.  If you already have one and are just redoing
the kernel, then it's not as big a problem.

   My experience: I have compiled 3.10 kernel on VMware Workstation which had
   taken 40 to 60 GB of Hard Disk,

That's because you had to install a userspace in the virtual machine.
Exactly how much that takes will depend on the distro you select and
install options (full/minimal/devel-tools/funkychicken/poweruser/etc)


pgpG7WG2AEdGo.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Change proc/pid/cmdline to 8k

2015-06-04 Thread Valdis . Kletnieks
On Fri, 05 Jun 2015 07:07:30 +0900, Greg KH said:

 Applications shouldn't be messing around with the kernel command line.

He's looking at /proc/PID/cmdline, which is a different beast.

Presumably, he's looking at 'ps axwww' and still not seeing the
full process commandline, and that irritates him for some reason...



pgp3E2azDpIYn.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Change proc/pid/cmdline to 8k

2015-06-04 Thread Valdis . Kletnieks
On Thu, 04 Jun 2015 21:06:10 +0530, Navin P said:
 have this 3rd party application with deeply mounted dir that runs as a
 testcase more than 5k chars . We can change it , i thought if that was
 the problem ?

So why is a long commandline a problem that needs solving? Are you actually
caring what the command line says?  If so, why?

Hint: There's no guarantee that your commandline contain the actual full
command string.  Consider this on an x86_84 kernel (yes, my $HOME does
need a good cleaning))

% /bin/echo * | wc
  11884   25797

1,884 parameters in argv[], totalling some 24K of data.  Which means that
20k isn't displayable.  And extending it to 64k won't fix the problem, as
demonstrated by looking at a rather large mail folder I have:

% /bin/echo ietf/* | wc
  1   62257  673721

OK, how far can we take this?

%  echo | xargs --show-limits echo
Your environment variables take up 1918 bytes
POSIX upper limit on argument length (this system): 2093186
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2091268
Size of command buffer we are actually using: 131072

Apparently, up to 2M or so...

So what problem are you trying to solve, and why?


pgpP4dWlyHl0m.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: unlocking the recv

2015-06-03 Thread Valdis . Kletnieks
On Wed, 03 Jun 2015 12:42:28 +0200, Grzegorz Dwornicki said:

 Server callend the recv function and waits for the data from client
 soo its blocked in wait_queue. The socket is in nonblocking state. Can
 this proces/thread be unblocked on demand?

Umm... according to the manpage for 'man 2 recv':

   If no messages are available at the socket, the receive calls  wait  for 
 a  message  to  arrive,
   unless  the  socket is nonblocking (see fcntl(2)), in which case the 
value -1 is returned and the
   external variable errno is set to EAGAIN or EWOULDBLOCK.  The receive 
calls normally  return  any
   data  available,  up  to the requested amount, rather than waiting for 
receipt of the full amount
   requested.

So if the socket really *is* nonblocking, I'm not seeing how it would end
up blocked.  If it sits in that state for long enough, you might want to do
a 'cat /proc/NNN/stack' to see where in the kernel it is.

But first, I'd double check that the socket is in fact non-blocking. Did
you remember to do something like this:

rc = socket(AF_INET,SOCK_whatever|SOCK_NONBLOCK,protocol);
if (rc  0) { /* whine about failure */ };

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: idle task check

2015-06-02 Thread Valdis . Kletnieks
On Tue, 02 Jun 2015 23:38:48 +0200, Mustafa Hussain said:

  /*Check if the pointer pointing to the idle class is equal to prev's
  sched_class*/
  if(prev-sched_class == idle)
  After this condition you can just:
  printk(KERN_INFO Prev is equal to idle_sched_class,now running the idle
  sched_class\n);

Hopefully, you didn't take Nick's advice without thinking about it

As I type this, powertop tells me:

Summary: 821.8 wakeups/second,  0.0 GPU ops/seconds, 0.0 VFS ops/sec and 18.8% 
CPU use

That printk is going to spam your dmesg pretty hard.

A better question is:

If prev is about to go idle, *what do you want to do*?  (Hint: newer
kernels already do a bunch of stuff when a cpu/core goes idle, you
probably want to make sure you're not working against something here...)


pgpnS4LOIIfVE.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Stop usbhid from claiming usb device on hotplug

2015-06-01 Thread Valdis . Kletnieks
On Sun, 31 May 2015 21:31:20 -0400, Nicholas Krause said:

  Your right, questions about eucalyptus based tasks should be asked off list
 to avoid people getting easy answers through.

No, the rules are to do it *on your own*, without asking anybody, on or off
list.

 However I think a lot of this could be avoided if we taught people how to do
 kernel programming research better.

Well, why don't you make suggestions from your own experience how we can improve
that?


pgp0i4CrkkELP.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Stop usbhid from claiming usb device on hotplug

2015-05-31 Thread Valdis . Kletnieks
On Sun, 31 May 2015 20:39:06 -0400, Nicholas Krause said:

 If you send your complete code to the list I can try and see if there are 
 other issues but that's the most likely.

Actually, he shouldn't send it to the list.  It smells too much of
eucalyptus


pgp53YP95B7DJ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Stop usbhid from claiming usb device on hotplug

2015-05-30 Thread Valdis . Kletnieks
On Sat, 30 May 2015 04:07:08 -0400, Armin Moradi said:

 had done, but while I was reading LDD 3rd ed., I also wanted to get
 probing to work which is done after the driver is already loaded.

If it's a dummy driver, what device is it going to probe?


pgpjCAtYiBnL6.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Will make modules_install replace old kernel modules?

2015-05-27 Thread Valdis . Kletnieks
On Thu, 28 May 2015 11:26:02 +0800, Gao Peng said:

 I am not sure if I boot from the old kernel,will the old kernel load the
 new-installed modules or keep it's own modules.

If you did it properly, then you should have 2 kernels, each with a
distinct value for uname -r, and 2 directories under /lib/modules, one
for each kernel.  Each kernel then proceeds to load modules from
/lib/modules/`uname -r`.

So if you have a 3.19.0 kernel, and a 4.0.1 kernel, they'll both be
sitting in /boot (each with its own initramfs, probably), and
the 3.19.0 will load from /lib/modules/3.19.0 and the 4.0.1 will load
from /lib/modules/4.0.1

And, of course, you hopefully have grub/grub2/whatever configured to allow
you to select a kernel by having multiple definition stanzas, one per
kernel...

Extreme example (I keep a *lot* of kernels around because I keep breaking them):

[~] ls /boot/vmlinuz-[34]*
/boot/vmlinuz-3.17.0-0.rc6.git2.1.fc22.x86_64  
/boot/vmlinuz-4.0.0-rc3-next-20150310-dirty
/boot/vmlinuz-3.18.0-0.rc3.git0.1.fc22.x86_64  
/boot/vmlinuz-4.0.0-rc5-next-20150324
/boot/vmlinuz-3.19.0-0.rc3.git2.1.fc22.x86_64  
/boot/vmlinuz-4.0.0-rc6-next-20150331
/boot/vmlinuz-4.0.0-next-20150421  
/boot/vmlinuz-4.1.0-rc1-next-20150428
/boot/vmlinuz-4.0.0-rc1-next-20150224  
/boot/vmlinuz-4.1.0-rc2-next-20150506
/boot/vmlinuz-4.0.0-rc1-next-20150226-dirty
/boot/vmlinuz-4.1.0-rc4-next-20150521
/boot/vmlinuz-4.0.0-rc1-next-20150303-dirty
/boot/vmlinuz-4.1.0-rc5-next-20150526
/boot/vmlinuz-4.0.0-rc2-next-20150306-dirty
[~] ls /boot/initramfs-[34]*
/boot/initramfs-3.17.0-0.rc6.git2.1.fc22.x86_64.img  
/boot/initramfs-4.0.0-rc3-next-20150310-dirty.img
/boot/initramfs-3.18.0-0.rc3.git0.1.fc22.x86_64.img  
/boot/initramfs-4.0.0-rc5-next-20150324.img
/boot/initramfs-3.19.0-0.rc3.git2.1.fc22.x86_64.img  
/boot/initramfs-4.0.0-rc6-next-20150331.img
/boot/initramfs-4.0.0-next-20150421.img  
/boot/initramfs-4.1.0-rc1-next-20150428.img
/boot/initramfs-4.0.0-rc1-next-20150224.img  
/boot/initramfs-4.1.0-rc2-next-20150506.img
/boot/initramfs-4.0.0-rc1-next-20150226-dirty.img
/boot/initramfs-4.1.0-rc4-next-20150521.img
/boot/initramfs-4.0.0-rc1-next-20150303-dirty.img
/boot/initramfs-4.1.0-rc5-next-20150526.img
/boot/initramfs-4.0.0-rc2-next-20150306-dirty.img
[~] ls /lib/modules
3.17.0-0.rc6.git2.1.fc22.x86_64  4.0.0-rc1-next-20150224
4.0.0-rc3-next-20150310-dirty  4.1.0-rc2-next-20150506
3.18.0-0.rc3.git0.1.fc22.x86_64  4.0.0-rc1-next-20150226-dirty  
4.0.0-rc5-next-201503244.1.0-rc4-next-20150521
3.19.0-0.rc3.git2.1.fc22.x86_64  4.0.0-rc1-next-20150303-dirty  
4.0.0-rc6-next-201503314.1.0-rc5-next-20150526
4.0.0-next-20150421  4.0.0-rc2-next-20150306-dirty  
4.1.0-rc1-next-20150428

Hope that helps it make sense...

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: when I subscribe linux-kernel mailing list , There is not any resposes! Why?

2015-05-20 Thread Valdis . Kletnieks
On Wed, 20 May 2015 08:44:03 +0800, sizel said:
  when I subscribe linux-kernel mailing list , There is not any  resposes! Why?

I believe that the mailing list management software is set up to require
a confirmation - you should have received a Click here to confirm mail
in response to your request.  Check your spam folder, it may be there



pgpsdW2A0N3Ja.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Documentation for usbmouse.c

2015-04-29 Thread Valdis . Kletnieks
On Thu, 30 Apr 2015 09:56:23 +0530, Ronit Halder said:

 Where do i get documentation for usb mouse ( usbmouse.c ).I was reading
 /home/roni/linux/drivers/hid/usbhid/usbmouse,c and i am unable to
 understand some part of it.So,i need help.

Which parts *specifically* are you confused about and what exactly do you
not understand?


pgp6IPny7FiY_.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: 4.1-rc1 fails with O3 optimization

2015-04-28 Thread Valdis . Kletnieks
On Tue, 28 Apr 2015 01:41:07 -0400, Andev said:

 Look here: http://www.spinics.net/lists/kernel/msg1962561.html

I may have blinked - did you happen to mention what gcc release you are
using?


pgpjBkGi3Bqyw.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: 4.1-rc1 fails with O3 optimization

2015-04-28 Thread Valdis . Kletnieks
On Tue, 28 Apr 2015 17:17:37 -0400, Andev said:
 On Tue, Apr 28, 2015 at 4:29 PM,  valdis.kletni...@vt.edu wrote:
  On Tue, 28 Apr 2015 01:41:07 -0400, Andev said:
 
  Look here: http://www.spinics.net/lists/kernel/msg1962561.html
 
  I may have blinked - did you happen to mention what gcc release you are
  using?

 $ gcc --version
 gcc-4.9.real (Ubuntu 4.9.2-0ubuntu1~14.04) 4.9.2

 I should indeed try with a 4.8 version too.

And 5.1.


pgpt8BBHbzug7.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to get kernel header from my kernel source tree?

2015-04-27 Thread Valdis . Kletnieks
On Mon, 27 Apr 2015 17:40:11 +0800, tianlilai said:
 Hi,Everyone:
 I have updated the kernel from v2.6.32 to v2.6.36

Do yourself and your developers a great service, and do the
following:

1) Upgrade to v4.0 (recently released). 2.6.36 is almost 5 years old.

2) Get your driver module in-tree. This has several benefits:

a) You don't have to worry anymore about figuring out what kernel
APIs changed when you upgrade kernels - the person who changed the API
will fix your code for you.

b) You can get out of the software distribution business totally. Just
ship the device, put a Works with Linux 4.1 and later! on the box, and
you don't need to worry about providing the driver, the user will get it
from their Linux distributor.

c) I'm sure Greg KH has a few other good reasons I can't remember because
I haven't had my morning caffeine.

Greg KH is the person to talk to about how to get your driver in-tree


pgpBeqKPBhRTJ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to traverse all file struct

2015-04-27 Thread Valdis . Kletnieks
On Tue, 28 Apr 2015 00:58:47 -, cmqycmqy said:
 (Again, depending I just want to print process info whitch have open a
 specific file£¨inode£©. Then if i want to delete a file in use,i can just kill
 the process one by one.

No kernel hacking needed for that, you can do it in userspace.

# lsof | grep /your/file/here
# kill -9 ` lsof | grep /your/file/here | awk '{print $2} |uniq '`


pgpXOYGER8q9G.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to traverse all file struct

2015-04-27 Thread Valdis . Kletnieks
On Mon, 27 Apr 2015 15:41:31 -, cmqycmqy said:
 I want to travese(find out) all opened file struct

Actually, no, you don't.

 i want to find out all process that have open that file.

Hint: There's probably a faster way to do it than checking *all* open files.

You can probably do even better if you explain *why* you want to find
all processes.  If you find them, what do you intend to do?  (Again, depending
on what you're trying to do, there's probably an easier way).


pgpW7hOulN8PI.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: task deactivation

2015-04-26 Thread Valdis . Kletnieks
On Sat, 25 Apr 2015 19:17:13 +0200, Mustafa Hussain said:

 what the function deactivate_task() exactly do ?
 thanks in advance.

void deactivate_task(struct rq *rq, struct task_struct *p, int flags)
{
if (task_contributes_to_load(p))
rq-nr_uninterruptible++;

dequeue_task(rq, p, flags);
}

Which part do you not understand?


pgpBqvuaZDwpX.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Structure declaration without its members variables

2015-04-26 Thread Valdis . Kletnieks
On Mon, 27 Apr 2015 00:16:59 +0530, harshkdev said:

 struct kvm;
 struct kvm_vcpu;

 Generally we declare structure and its member at same place.

It's a forward declaration.

Consider two structures that have pointers to each other:

struct a {
  int b, c, d;
  struct *b b_ptr;
}

struct b {
int foo, bar, baz;
struct *a a_ptr;
}

Now, the struct *b in the first structure won't compile because it hasn't
seen b yet.  So we stick a 'struct b;' in front both of them so struct a can
compile successfully.


pgpWOmom2ZFKV.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Basic question about malloc

2015-04-22 Thread Valdis . Kletnieks
On Thu, 23 Apr 2015 09:52:56 +0800, 慕冬亮 said:

  I'm looking for that whether the object allocated by malloc is the
 multiple of certain bytes!
  Or how does the malloc allocate dynamic memory ??
  I does an experiment in my computer!

1) malloc() is a userspace function, not kernel.

2) There are multiple malloc() implementations out there - the one you're
using is *probably* glibc's, but there are others (including debugging
memory allocators that return strictly the number of bytes allocated, with
canaries on either end to trap misuse of memory).

 But the result has no feature about a ,b ,c!

What do you mean by no feature, and what were you expecting? When I run it, I
get:

% ./a.out
a = f35010
b = f35040
c = f35070

which tells me that malloc() returned 3 pointers that are 48 bytes
apart (which is *not* the same thing as there are 48 bytes safe to use).


pgpPsXB9b1Jmr.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Achieve multi-threading in MIPS assembly

2015-04-20 Thread Valdis . Kletnieks
On Tue, 21 Apr 2015 01:05:19 -, Chaturvedi, Akash said:

 I am writing MIPS assembly code for a 'Word guessing game'.

Why?

gcc -O2 will almost certainly generate faster code than you can (unless you're
*really* good at MIPS assembler, in which case you wouldn't have posted).


pgpZg8LtzZDUL.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How do _you_ read the linux source?

2015-04-20 Thread Valdis . Kletnieks
On Mon, 20 Apr 2015 07:45:37 +0200, Christoffer Holmstedt said:

 Thank you Nick, I'm just getting started with linux kernel development
 and have been looking around for books both more general and specific
 to networking. One thing in common several books I've found have is
 that they are based on the 2.6 version of the kernel (or older). Some
 parts have changed but are entire chapters in the above mentioned
 books too old to make sense when working on version linux kernel 4.1
 and beyond?

The details have changed.  The basic concepts haven't.  In fact, the *basic*
concepts change so slowly that reading Bach's book on the SYSV kernel or
McKusic  Liefler on the BSD kernel will teach you a lot.

In fact, I'll go out on a limb and say that reading how *other* systems have
solved the same issues is a Good Thing. Knowing just Linux solved it this way
is one thing, but knowing Linux solved it this way, but BSD took a different
approach because X, and IBM's VM/SP did Y instead to avoid the issue entirely
is a whole different level of understanding.


pgpZdxlJanny8.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel thread scheduling

2015-04-16 Thread Valdis . Kletnieks
On Thu, 16 Apr 2015 14:28:59 -0400, Ruben Safir said:

  Others may come to different conclusions. I use www.google.com on a 
  regular basis even though I can't download it.

 That is not even a good analogy.

We're comparing closed Coverty-as-a-service with closed Google-as-a-service.
Seems like a good analogy to me.

I'm failing to see the moral difference between using Google SaaS to look
to see if anybody else has reported a particular kernel error and using Coverty
SaaS to examine kernel code.

As you yourself said:

 If everyone depended on this Software as a Service then you would have a
 nice walled garden to the Kernel Code.

Why do you object to Coverty when Google is almost certainly more depended
on by kernel developers?


pgpTD697fDT0c.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Heap Management Problem

2015-04-15 Thread Valdis . Kletnieks
On Wed, 15 Apr 2015 12:28:06 +0800, 慕冬亮 said:

 Can you give a detail of what you want to prove?
 I am not familiar with heap management , so I ask for the details!

As I said - heap management is usually mostly done in userspace.  The way the
standard glibc malloc() call does things is almost certainly different from the
way other C libraries such as uClibc or klibc or dietlibc do it.  Then there's
a number of debugging malloc() packages, and so on.

The only way the kernel gets involved is when the userspace malloc() library
decides to call brk(), sbrk(), or mmap().



pgpAbr7kUXRes.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Heap Management Problem

2015-04-14 Thread Valdis . Kletnieks
On Tue, 14 Apr 2015 23:01:58 +0800, 慕冬亮 said:

 Hello Everyone:
   What's the rule about heap management? Especially what's the function
 of do_brk?

Who says there's a rule about it? Some userspace heap managers don't
even *use* brk() or sbrk(), but instead use mmap() of an anonymous area.


pgpkKOjntbFRY.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: RT process priority Interrupts ?

2015-04-09 Thread Valdis . Kletnieks
On Thu, 09 Apr 2015 15:30:42 +0900, manty kuma said:
 A missed IRQ is not considered fatal but where as missing the upper time

Are you *sure* that ignoring an IRQ for an arbitrarily long time is non-fatal?

(Hint - it may not be fatal to the *kernel*. Think bigger)

 limit for an RT process will be considered fatal. Hence I think, as a
 simple solution, the process should not be preempted.

What does missing an IRQ mean for the following:

1) Hardware that's spewing IRQs on a constant basis (think data acquisition
where you have a A/D converter handing you 4K of data every millisecond, whether
you're ready or not). If userspace decides to go compute-bound for 2ms in
an RT thread (bad idea but sometimes it happens), how many blocks of data
do you lose?

2) What does missing an IRQ do to the latency of a *different* RT thread
that's waiting for I/O completion?



pgpFY8HKejbor.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: pci devices

2015-04-09 Thread Valdis . Kletnieks
On Wed, 08 Apr 2015 22:18:46 -0700, A B said:

 One of my pci device is not showing up in /proc/pci/bus/devices. I'm using
 2.6.36 kernel. which part of code i can look to troubleshoot, i'm looking
 at drivers/pci/probe.c. Any pointers / tips will be helpful

Wow.  If the device isn't even showing up at all in /sys/bus/pci/devices, my
first question is Convince me that your PCI device is in fact functional and
plugged in all the way.  If it can't even get its slot/function number
and vendor/card codes right, it's most likely either mis-seated or dead. I
can't remember the last time I saw this caused by a software problem - even
devices that don't *have* a driver will at least show up as an unknown PCI
device.


pgpK8oIqXdIas.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: RT process priority Interrupts ?

2015-04-08 Thread Valdis . Kletnieks
On Thu, 09 Apr 2015 10:59:20 +0900, manty kuma said:
 In Linux, when a real time process is executing and an interrupt comes,
 will the RT process be preempted?

 Is RT process considered superior to interrupts?

Think it through - that would imply that RT processes effectively run with
interrupts disabled (or ignored, which amounts to the same thing).  What would
be the result of that? How would the system behave?  Consider in particular
that RT processes want a hard maximum on latency (and usually as low latency as
you can get).  Remember to consider the case of more than one RT process on a
system

For bonus points, work it out for both hard and soft IRQs.


pgphC1hGaUq9n.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: VFS/driver core overhead

2015-04-07 Thread Valdis . Kletnieks
On Mon, 06 Apr 2015 23:12:34 -0400, nick said:

(Replying mostly for the edification of those who can learn learn without
having to be spoon-fed)

 After reading through the code for the usb and vfs core infrastructure, I was 
 wondering if
 after reading it if I am correct in my notion of there being very little 
 overhead or none
 at all int these areas of the kernel. This is due to be noticing most drivers 
 and file
 systems wrap around the core/vfs and therefore the overhead is very little 
 and no need
 to worry about it like the overhead of the kernel's process structures based 
 off task_struct

For bonus points, go learn the difference between latency and throughput, and
who cares about excessive overhead on each, and under what conditions, and
what solutions have already been tried to address the issue.

 .Honestly, I could benchmark this area of the kernel but it's hard to remove 
 the file
 system/drivers interfering with my benchmarks due to me not knowing of any 
 one way to do that.
 If someone either points me to a benchmark for me to test this or answers it 
 that would be
 very helpful.

Step -1: Go back and re-read the recent postings about diagnosing slow kernel
builds, because you apparently didn't actually learn anything from them.

Step 0: Learn enough about proper benchmarking and the thing you're
benchmarking to be able to ask a meaningful, answerable question.

Step 1: Go find the proper tool for testing your question.

Step 2: Do the measurement needed to answer your question.


pgpbkx0OJihUa.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Learning things

2015-04-06 Thread Valdis . Kletnieks
On Mon, 06 Apr 2015 10:43:46 -0700, Joris Bolsens said:

 I'm working on trying to teach myself C and was wondering if you had any
 kernel specific recommendations.

Don't bother trying until you have an actual good working knowledge of C.

Work in userspace where your screw-ups just take the process out, not
the entire system, until stuff like a SIGSEGV becomes a rarity. *THEN*
start considering kernel work.


pgpyCUaExIqBu.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Reading kernel code

2015-04-05 Thread Valdis . Kletnieks
On Sat, 04 Apr 2015 23:30:49 -0400, Nicholas Krause said:
 Greetings All,
 I  am interested someone testing me

If you have to ask, the answer is No, you don't understand it.

And you missed the *other* important part - why would anybody else
be interested in doing said testing? What's in it for them?


pgp5Wq8rVorzw.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Help learning from my mistakes

2015-04-04 Thread Valdis . Kletnieks
On Sat, 04 Apr 2015 15:28:23 -0400, Nicholas Krause said:

 After reading this it seems that the issue is my lack of effort not my 
 abilities.

Being able to realize that the find|xargs grep solution was actually
less work, with quicker results, is *itself* an ability.


pgpTzoxe1Hx1g.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Help learning from my mistakes

2015-04-04 Thread Valdis . Kletnieks
On Sat, 04 Apr 2015 19:00:42 -0400, Nicholas Krause said:
  are now slower by up to 3 times,

So what debugging did you already do to try to narrow this down?

Did you even run 'top' or 'vmstat' or anything else like that?
Did you check to make sure you didn't replace a stripped down
custom config with a 'make allmodconfig'?  Did you compare the current
.config with the previous one to make sure enabling lock debugging
was the only change?  Did you reboot back into a known-good kernel
and test build a known-good kernel tree with a known-good .config (if
that was still slow, I'd start checking the system hardware to make sure
you haven't lost a 4G memory DIMM or other similar issue).

(Replying mostly for the archives, and the edification of others)


pgpcnHGxnXwXO.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Help learning from my mistakes

2015-04-03 Thread Valdis . Kletnieks
On Fri, 03 Apr 2015 17:23:04 -0400, Nicholas Krause said:
 Greetings All,
 I am wondering if there are any stupid mistakes in my attempts at kernel 
 programming I am still making.

See the find|grep command I posted yesterday that you should have done
before posting.


pgper1mrydybG.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Function Pointer Question

2015-04-02 Thread Valdis . Kletnieks
On Thu, 02 Apr 2015 06:54:42 -0400, Nicholas Krause said:

 I looked in to it and the kernel seems to be one of the few places where this
 is done along with in line functions.  Why do we need function pointers in the
 kernel, outside of device drivers is my real question and is there any way to
 do the code using them without function pointers at all, I am assuming no.

Geez Nick, you didn't look very hard at all, did you?

[/usr/src/linux-next] find include -type f | xargs egrep '^struct .*_op.*{$' | 
sort

There's 391 of them (at least in yesterday's linux-next tree).

You should *at least* know and understand 'struct file_operations',
'struct dentry_operations', 'struct inode_operations', and 'struct 
super_operations
if you plan to have any realistic hope of understanding the VFS - which should
be important to you, as I seem to recall you were interested in btrfs2.

See include/linux/fs.h for the details.




pgplJnWdv5T1Q.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: mmap text file

2015-03-31 Thread Valdis . Kletnieks
On Tue, 31 Mar 2015 17:11:33 +0530, Ssagarr Patil said:
 Hi,

 while (loop) {
         /* get the current file size of output file */
         filesize = lseek(outfd, 0, SEEK_END);

         /* Increase file size */
         ftruncate(outfd, (off_t)filesize + (off_t)buf.size


Are you sure you want to do these two *every time* through the loop?

             /* mmap destination file */
             if((dest = mmap(0, buf.size, PROT_WRITE, MAP_SHARED, outfd, 
 filesize)) == (void *) -1) {

Similarly here - usually the *entire* file gets mmap'ed.

Also, what did perror() output? (probably nothing, since you stuck a printf
in front of it, which probably reset errno on you).

     memcpy(dest, src, size);
     munmap(dest);

You're not going to achieve faster throughput by adding to the syscall
overhead.

 }


pgpW0yMQEhesw.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Questions about the zoned page frame allocator and fix mapped addresses

2015-03-30 Thread Valdis . Kletnieks
On Mon, 30 Mar 2015 20:25:38 +0530, Sunny Shah said:

- The book says, about releasing page frames to the per CPU cache - no
page frame is ever released to the cold cache: the kernel always assumes
the freed page frame is hot with respect to the hardware cache. What is
the reason for this decision ?

What can go wrong if the page is cold but the kernel assumes it's hot?

What can go wrong if the kernel assumes it's cold but it's actually hot?

(Hint - in which cases will it do a cache flush?  In which cases is a
cache flush needed? What happens in each case if the kernel guesses wrong?)


pgpdwJDgWfM42.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Can add new module without upgrade the kernel?

2015-03-30 Thread Valdis . Kletnieks
On Mon, 30 Mar 2015 22:58:12 +0800, Woody Wu said:

 FFC3 3.1.0-ffc3mb-00050-g5874787 # pwd

Wow.  Git bisect gone incredibly wrong?  How did you end up running *that*
kernel?


pgpBRMNZFGE_x.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Writing driver for a net device which does not support interrupt

2015-03-23 Thread Valdis . Kletnieks
On Mon, 23 Mar 2015 18:51:51 +0800, Freeman Zhang said:
 I'm writing a net device driver for my final project in college. But the
 half-finished device doesn't support interrupt yet(those hardware guys...)

 So I'm wondering if there is some way to poll the device for its status
 and events.

As a realistic datapoint - if it still doesn't support interrupts, the *rest*
of it is probably still so buggy that trying to write a driver isn't worth
the effort.

It's doable if you are working with a group of talented and experienced
engineers - but if the hardware is also being done as a final project,
you're in for naught but misery.

You *could* do something like this:

  while (waiting) {
  status = read_status_bits(your_device);
  if (status  DATA_AVAIL_MASK) break;
  msleep(100);
  }

But having seen enough student hardware design projects in my life, I estimate
that if it still can't signal interrupts, the status bits probably aren't valid
either. (Think about it - a bog-simple implementation of interrupts would be
to just feed a transition-high on the appropriate status bit to the interrupt
pin, and use a read from the chip to clear the pin).

Good luck - I suspect you're going to need it


pgpt2DvWdwX8v.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Is RCU not safe enough to protect dcache hlist?

2015-03-16 Thread Valdis . Kletnieks
On Mon, 16 Mar 2015 10:06:37 +0800, Lee said:

 I am studying the dcache in VFS recently . I found that hlist of dcache
 is already protected by RCU in
   __d_lookup.Is it necessary  for the function -- d_lookup using
 sequence lock to protect the hlist again?

RCU is useful when you can tolerate a bit of latency in other users
finding out about updated values and/or slightly stale values.  That's
not an option for d_lookup(), which has to check the most recent value
in order to avoid race conditions.



pgpoWrsfuZAN2.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: confusing code....whats the point of this construct ?

2015-03-12 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 17:46:56 +0100, Nicholas Mc Guire said:

 ret = ({ long __ret = (5*250);
 do { _cond_resched(); } while (0);
   if (!({
   bool __cond = (({

Gaak.

 ret = wait_event_timeout(mgr-tx_waitq,
  check_txmsg_state(mgr, txmsg),
  (4 * HZ));

-EGADS - use of macro as a function violates the Principle of Least Surprise

I have to wonder how many other places we've got bugs waiting to happen
because of this


pgpKXlKzWxjks.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: I am new here

2015-03-12 Thread Valdis . Kletnieks
On Thu, 12 Mar 2015 13:27:21 -0300, Leonardo Ariel Carreras Rodríguez said:

 I am new here, and I want to know how to get started, maybe with the
 simplest way available.

Something the others haven't addressed - do you have an understanding of
*why* you are here?  As the how to get started will be different for
different answers...

Are you here because you're a professional programmer who's done a
lot of userspace work, and your company just re-assigned you to write
an FPGA driver for a new product?

Are you here because you got a project assignment from a professor?

Are you here because you just bought a Brand X laptop and the sound
card is supposedly supported, but it plays everything in reverse?

Are you here because you have a device that has no driver in Linux?

Are you here because you're a troll?

Are you here because you think kernel hacking is a good way to improve
your resume?

Are you here because you've been using Linux, and you want to give back
but have no idea how?

We've seen all of the above here - and each of these should probably
be heading in a different direction.  There isn't really a one size
fits all best way to get started.


pgpxYUlWcGQtg.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: confusing code....whats the point of this construct ?

2015-03-11 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 18:37:32 -, Jeff Haran said:

 I don't understand the problem here. The caller passes in a condition to be
 evaluated in a loop. Many times that condition is quite simple (e.g. a counter
 being non-zero). If it was a function the caller would have to pass in a
 pointer to a function that does the evaluation, as in:

We do pointers to callback functions all the time.  We try *really* hard
to avoid anonymous lambda functions (which is basically what we have here).

The problem here is that there's about 3 zillion ways to screw up the inline
version, starting with the compiler optimizing the control variable into a
hoisted load outside the loop and causing the test to always fail - note that
the macro does *not* use any barriers or volatile or anything like that.



pgp3aFNq2myUk.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel Locking Question

2015-03-11 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 19:03:33 -0400, Nicholas Krause said:

 was wondering of how this would improve file system scalability and
 reliability if implemented in file system code for btrfs worker threads.

Step 1: Figure out what locks are contended in actual systems.
Step 2: Determine if the scope of a contended lock can be reduced.
Step 3: ???
Step 4: Profit!

Note that improving scalability will often cause reliability issues,
because as you decompose locks into sets of smaller locks, you increase
the number of ways you can get it wrong.  The BKL, for all its uglyness,
was pretty hard to screw up.  On the other hand, we probably would never
have gotten rid of it if somebody hadn't put lockdep into the kernel.  It
was painful enough even with automated testing tools


pgp54C1WDIDsf.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Tracing allocators of virtual memory and main memory

2015-03-11 Thread Valdis . Kletnieks
On Thu, 12 Mar 2015 07:09:32 +0530, SAHIL said:

 Yeah right, pidstat which read /proc gives me VSZ ans RSS but i need to
 backtrace when VSZ/RSS is high which indicates process is allocating memory
 which it is not even using.

Do you mean pages it isn't *currently* using, or has *never* used?

Also, note that VSZ refers to the virtual size, which may include
pages currently out on swap, while RSS refers to actually resident pages.

And then there's the other great bugaboo, shared pages that are mapped by more
than one process.

What exactly are you trying to do?


pgpulN5XSF2vj.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: confusing code....whats the point of this construct ?

2015-03-11 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 15:17:44 +0100, Nicholas Mc Guire said:

 So the wait_event_timeout condition here ends up being (empty || skip)
 but what is the point of puting this code into the parameter list of
 wait_event_timeout() ?

 Would it not be equivalent to:

   bool empty;
   ...

   spin_lock_bh(ar-htt.tx_lock);
   empty = (ar-htt.num_pending_tx == 0);
   spin_unlock_bh(ar-htt.tx_lock);

   skip = (ar-state == ATH10K_STATE_WEDGED) ||
   test_bit(ATH10K_FLAG_CRASH_FLUSH,
   ar-dev_flags);

   ret = wait_event_timeout(ar-htt.empty_tx_wq, (empty || skip),
ATH10K_FLUSH_TIMEOUT_HZ);

 What am I missing here ?

Umm... a Signed-off-by: and formatting it as an actual patch? :)

Seriously - you're right, it's ugly code that needs fixing...


pgpwpqWJn4iCd.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Question on mutex code

2015-03-10 Thread Valdis . Kletnieks
On Tue, 10 Mar 2015 14:03:59 +0100, Yann Droneaud said:

  Consider the following sequence of events:
  
  0. Suppose a mutex is locked by task A and has no waiters.
  
  1. Task B calls mutex_trylock().
  
  2. mutex_trylock() calls the architecture-specific
  __mutex_fastpath_trylock(), with __mutex_trylock_slowpath() as
  fail_fn.
  
  3. According to the description of __mutex_fastpath_trylock() (for
  example in include/asm-generic/mutex-dec.h), if the architecture
  has no effective trylock variant, it should call the fail_fn
  spinlock-based trylock variant unconditionally. So
  __mutex_fastpath_trylock() may now call __mutex_trylock_slowpath().
  
  4. Task A releases the mutex.
  
  5. Task B, in __mutex_trylock_slowpath, executes:
  
   /* No need to trylock if the mutex is locked. */
   if (mutex_is_locked(lock))
   return 0;
  
  Since the mutex is no longer locked, the function continues.
  
  6. Task C, which runs on a different cpu than task B, locks the mutex
  again.
  
  7. Task B, in __mutex_trylock_slowpath(), continues:
  
   spin_lock_mutex(lock-wait_lock, flags);

B will spin here until C releases the lock.

When that spin exits, C no longer holds the lock.  Re-do the analysis
from this point.


pgp3NSpsOv4iX.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Get local CPU id

2015-03-09 Thread Valdis . Kletnieks
On Mon, 09 Mar 2015 13:42:04 -0400, Nick Krause said:
 He can just limit the dmesg output by using console_limit I believe.

Won't fly.

Hint:

How high to you have to set that limit to get through boot?

What happens if the message is logged to a console?


pgpTbC7mxUDBH.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: getting interrupt number

2015-03-08 Thread Valdis . Kletnieks
On Mon, 09 Mar 2015 07:55:10 +0530, Ronit Halder said:
 How to get the interrupt number of a device.I know it's device id and
 the bus number.
 The device is a usb mouse.

In that case, you won't find an interrupt number for the mouse, you'll find
one for the USB controller the mouse is attached to.  Make note that the same
USB controller will catch interrupts for *all* devices on that USB bus.


pgpr_fhAR7NUC.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Get local CPU id

2015-03-08 Thread Valdis . Kletnieks
On Sun, 08 Mar 2015 22:49:00 +0100, Maxime Ripard said:

 On Sun, Mar 08, 2015 at 10:06:23PM +0300, Matwey V. Kornilov wrote:

  I would like to somehow obtain local CPU core ID in the interrupt
  handler function. I want to see how my interruptions are distributed
  among different CPU cores under different conditions.

  How should I do that?

 To answer strictly your question, like Nick said, smp_processor_id()
 will work fine.

 However, you can do exactly what you want be reading /proc/interrupts,
 that already provide the informations you are looking for.

Clarification:  /proc/interrupts will give userspace that information.
It is *not* recommended you try to read it from kernel space, much less
from an interrupt context... :)


pgpfEwWd1vHSh.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to check if a file is a present in a directory(directly/indirectly)

2015-03-06 Thread Valdis . Kletnieks
On Fri, 06 Mar 2015 20:38:46 +0530, noyb noybee said:
 I am building a LKM in which I need to check whether a file is inside
 a particular directory(directly or inside sub-directories). Is there a
 function for this? Do I need to use the lookup function in
 inode_operations for this or is there a better method?

Inside subdirectories is an intractable problem, even from userspace.  You
basically need to walk *all* the inodes:

find /mounpoint -inum file_inode_number | grep /mountpoint/directory/to/check

If the filesystem is large, that can take a while.

Also, a file can be in more than one subdirectory at once:

[~] cd /tmp
[/tmp] mkdir z9
[/tmp] cd z9
[/tmp/z9] mkdir a b
[/tmp/z9] mkdir a/c
[/tmp/z9] touch a/c/d
[/tmp/z9] ln a/c/d a/first
[/tmp/z9] ln a/c/d b/second
[/tmp/z9] ln a/c/d third
[/tmp/z9] ls -lR
/tmp/z9] ls -liR
.:  
total 0 
62326 drwxr-xr-x. 3 valdis valdis 80 Mar  6 12:13 a
62327 drwxr-xr-x. 2 valdis valdis 60 Mar  6 12:13 b
62388 -rw-r--r--. 4 valdis valdis  0 Mar  6 12:13 third

./a:
total 0 
63471 drwxr-xr-x. 2 valdis valdis 60 Mar  6 12:13 c
62388 -rw-r--r--. 4 valdis valdis  0 Mar  6 12:13 first

./a/c:
total 0
62388 -rw-r--r--. 4 valdis valdis 0 Mar  6 12:13 d

./b:
total 0
62388 -rw-r--r--. 4 valdis valdis 0 Mar  6 12:13 second

So which directory is it under?  And can this sort of stunt be
exploited with a race condition on a large filesystem? (Hint -there's
a *reason* that SELinux and Smack both use file labels instead of
pathnames...)

I think you need to stop and think about what you're *actually*
trying to accomplish here.  I suspect that what you *think* you are
checking isn't what you should *actually* be checking


pgpvWCj_AOjak.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: I want to remove my current kernel after upgradtion of new kernel

2015-03-03 Thread Valdis . Kletnieks
On Tue, 03 Mar 2015 17:12:44 +0530, Anurudh Tiwari said:

 I have to remove my current kernel(which is going to be old kernel in next
 reboot) after up-gradation because i don't want to get prompt to choose the
 kernel at booting time.

Protip:

You *really* want to keep at least one extra known-working kernel on your /boot
just in case you find a bug in the one you installed. If you don't like getting
prompted, set up grub or grub2 or whatever to boot a default kernel, with a
timeout of 1 second or so, so that if you ignore it, it boots into your default
kernel, but if things go sideways you can boot the old kernel.

And remember - it doesn't have to be a *kernel* bug - if  something decidess to
rebuild your initrd/initramfs, and botches it, you're going to havea bad time
at the next reboot. So you really want a known-bootable kernel/initrd pair
or two on /boot just in case...



pgpXw9p3T7_B_.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Port Newer Kernel to Android Device

2015-02-23 Thread Valdis . Kletnieks
On Mon, 23 Feb 2015 11:50:52 -0500, Nick Krause said:
 I was curious if this is possible. As other distros like
 Red Hat are very hard to port the patches to from the
 main line kernel.

Forward porting the patches isn't much trouble - the Rawhide guys seem to be
able to do that almost *every single day*, since they build against a
near-nightly pull from Linus's git tree.

What's difficult is beating patches into a condition that can be merged
upstream - often the patch is one that the upstream maintainer doesn't want to
accept (for instance, of the 60 patches in today's Rawhide kernel
(kernel-3.20.0-0.rc0.git10.1.fc23.src.rpm), we have things like:

die-floppy-die.patch - removes the PNP alias for floppy drives.  Not
suitable for upstream until we finally get disgustipated enough to
throw floppy.c overboard.

silence-fbcon-logo.patch - suppresses the framebuffer CPU icons at boot,
and not suitable for upstream because it only exists to support Plymouth.

hibernate-Disable-in-a-signed-modules-environment.patch - another one-liner
that there's considerable room to disagree whether it should be upstream.
Yes, it enhances security.  However, it also puts a significant crimp in
usability.

Most of the Android patches are in a similar boat - they're probably not
that hard to drag along release to release, but they're almost impossible
to upstream due to philosophical differences.


pgpnrI5OkEcXe.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sat, 21 Feb 2015 23:52:06 -0500, nick said:
 Greetings Fellow Kernel Developers,
 I was wondering if there is any way to port a newer kernel to my device 
 without
 breaking the android user space.

Yes. There is a way.


pgpzS9yZaZKc6.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sun, 22 Feb 2015 08:40:59 -0500, Nicholas Krause said:
 Validis,
 If that is the case , would you mind telling me how to  do  it.

Step 1: Get good enough at kernel hacking to forward-port all the
Android-specific patches.  Those should be available to you from Samsung
as they are GPL.

Step 2: Forward-port the patches.

Step 3: Build and install your new kernel.


pgp0BU_vKDtoS.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sun, 22 Feb 2015 20:02:14 -0500, nick said:
 This is just a idea for now I haven't have the idea to look at making the
 porting patch(es) yet.

Then it really doesn't matter how long it will take, because it's not
likely to actually happen.  So why you bothering to ask?



pgpAmvwShZCA0.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Identify true error value for kernel API's like kmalloc() and ioremap()

2015-02-22 Thread Valdis . Kletnieks
On Mon, 23 Feb 2015 15:37:52 +0900, manty kuma said:

 If the call fails, the return value is NULL. So, how do I know what caused
 the failure? I have looked at examples in the kernel code. They are
 returning a hard-coded value of -ENOMEM if kmalloc() fails.

Well.. say you call kmalloc() and it fails.  Does it *matter* what caused
the failure?  What are the chances that there is (a) more than one reason
for it to fail, and (b) the error is recoverable in one case but not in
another?

Similarly for ioremap() - under what conditions will the *reason* make a
difference?

Unless you plan to take different action and manage to recover based on
the reason, *it doesn't matter*.  And given the semantics of kmalloc()
and ioremap() specifically, if your code's action will differ based on
the reason, you're probably using the wrong API.


pgp1t7ek4QQln.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sun, 22 Feb 2015 13:19:40 -0500, Nicholas Krause said:
 Validis,
 That was my concern.  How much forward porting is required.

That will depend on your actual skill level.  That which is a long weekend's
work for a master kernel hacker will be several week's work for a journeyman,
a summer's project for a beginner, and impossible for a neophyte.

But I will go out on a limb and say that if you've already gotten the
patch, looked at it, and still can't make even an estimate of how long it would
take you, you're probably not going to be able to do the porting.


pgpuJJ8XwbiZ_.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: sk_wait_data

2015-02-19 Thread Valdis . Kletnieks
On Thu, 19 Feb 2015 23:45:44 +0100, Grzegorz Dwornicki said:

 How does the kernel know when to unblock the process? Function name:
 sk_wait_data and macro name: sk_wait_event tells me that there should
 be some queue checning from time to time...

No need to check the queue from time to time.  Just wait - and *when data
arrives*, poke the queue to wake it up (or when the timeout hits).


pgp28hyKO7Uqf.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: executing insmod hangs the entire os

2015-02-18 Thread Valdis . Kletnieks
On Wed, 18 Feb 2015 12:33:57 +0530, noyb noybee said:

 Wasn't that implemented from version 3 and not 2.6?

Another problem is you're developing against 2.6. ducks :)


pgp226XpWyz1H.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: unlikely compiler flag propagation

2015-02-18 Thread Valdis . Kletnieks
On Wed, 18 Feb 2015 19:38:01 +0100, Nicholas Mc Guire said:
 On Wed, 18 Feb 2015, Greg KH wrote:

 interesting - would you have a reference to some talk/paper/data/... ?

Test for yourself :)

config PROFILE_ANNOTATED_BRANCHES
bool Trace likely/unlikely profiler
select TRACE_BRANCH_PROFILING
help
  This tracer profiles all likely and unlikely macros
  in the kernel. It will display the results in:

  /sys/kernel/debug/tracing/trace_stat/branch_annotated

  Note: this will add a significant overhead; only turn this
  on if you need to profile the system's use of these macros.





pgpzty4xsb1Ji.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: executing insmod hangs the entire os

2015-02-17 Thread Valdis . Kletnieks
On Tue, 17 Feb 2015 21:46:00 +0530, noyb noybee said:

 am on a VM running CentOS 6.6 with kernel version 2.6.32-504.

Which probably has kernel relocation and ASLR enabled.

 unsigned long *syscall_table = (unsigned long *)0x81600560;

So that isn't pointing at the syscall table in the running kernel.

 syscall_table[__NR_chroot] = new_chroot;

So you just trashed an essentially random location in memory.

You explained in a private email what you were trying to do here - and
I'll point out that it essentially changes the kernel API in unexpected
and undocumented ways.  It even introduces some security holes and bugs (hint -
if you close all file descriptors, what happens to programs that were expecting
stdin/stdout/stderr to be open?  In particular, programs that open, say,
/dev/log so they have syslog output, and then chroot.  Or programs that
open a socket, then chroot and drop permissions (like openssh's sshd for
privilege separation).

You're really not doing yourself a favor with this whack-a-mole approach
to security.  You *really* need to sit down and think about what problem
you're trying to solve here.




pgpTfNw81uOvV.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: error: missing syscalls when compiling kernel module

2015-02-16 Thread Valdis . Kletnieks
On Mon, 16 Feb 2015 12:14:59 +0530, noyb noybee said:
 Hi all. This is the error that I am getting when I try to compile a
 loadable module(it tries to intercept a system call by directly
 editing the sys_call_table in the memory):-

In general, that's a *really* bad idea, for numerous reasons.  What problem
are you trying to solve by intercepting a system call?



pgpIcODKn6tMl.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fwd: Fwd: Getting path in inode_permission

2015-02-12 Thread Valdis . Kletnieks
On Thu, 12 Feb 2015 23:41:18 +0530, noyb noybee said:
 On Thu, Feb 12, 2015 at 3:44 AM,  valdis.kletni...@vt.edu wrote:

  How about you concentrate on how were they able to access files outside
  the chroot in the first place?
 So, closing all open file descriptors that are outside the new root
 directory + changing the CWD + blocking any mounts.

That's a good start.

Now, for bonus points - explain why you wanted something inside a chroot
to be able to access something outside the chroot.

(Hint - why can't you just bind-mount it into the chroot hierarchy before
launching the chroot'ed program?)


pgpap7EJBbfSB.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fwd: Fwd: Getting path in inode_permission

2015-02-11 Thread Valdis . Kletnieks
On Thu, 12 Feb 2015 00:31:45 +0530, noyb noybee said:

 I was planning that the calling process would call the new system call
 which would return a pseudo-random key that is used as the
 pass-phrase.

So what prevents malicious code from doing a fork and then calling the
new syscall to get its own pseudo-random key to use as a passphrase?

Like I said, this is a lot harder to make secure than it looks.



pgp3dqx8rZBrk.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fwd: Fwd: Getting path in inode_permission

2015-02-11 Thread Valdis . Kletnieks
On Thu, 12 Feb 2015 03:19:46 +0530, noyb noybee said:

 Well, any program which has root credentials is still allowed to call
 chroot(it needs to get a new passphrase before) but not any program
 with root credentials can exit it.

Well see... now you have a problem.

If you don't allow that chroot program to fork() or exec(), you now have
the passphrase sitting in memory someplace (since you need to pass it back),
and exploit code can find it in memory.

If you allow fork/exec into other programs, it gets worse - now you need to
pass that passphrase to children.

And if you're using the passphrase for the chroot() call *itself*, you
have an even bigger problem - whatever access that passphrase adds is now
available *anywhere inside the chroot*.

So all I need to do is find a way to exploit the chroot, and now I have
access to resources outside the chroot.  At which point your security
scheme is *totally* broken.

Instead of your original:

 I am trying to prevent access to files outside the jail unless they specify
 a specific passsphrase.

You've just handed unfettered access to the files to the exploit.

How about you concentrate on how were they able to access files outside
the chroot in the first place?

 Once a passphrase is used for a chroot system call, it is never
 returned(pseudo-random) again.

Or so you hope. :)

It's easy to design security schemes that work if code follows the rules.
The fun is designing code that withstands attempts to break the rules.
Consider abuse of inherited file descriptors - say stderr is open to a
logfile.  My exploit code closes fd 2.  What happens the next time somebody
opens a file, and then something does fprintf(stderr,)?

What happens if code trawls the process image and finds the magic key?

What happens if somebody forks? Or double/triple forks?

What happens if somebody sets LD_PRELOAD and then causes an exec()?

What happens if somebody manages to attach a child process to your process
and then triggers an unexpected SIGCHLD?  (Hint - it's *trivial* to actually
do that - see if you can guess how before reading the link below...)

Henry Spencer, a long time ago, wrote a good set of things to worry about when
writing set-UID programs - most of which also apply to chroot code.  Note that
this is *not* a complete list, it's *just* the low-hanging fruit.

http://www.daemon-systems.org/man/setuid.7.html

Now, can you explain what problem you're trying to solve with this security
scheme?


pgpZ8i9VhqapB.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fwd: Fwd: Getting path in inode_permission

2015-02-10 Thread Valdis . Kletnieks
On Wed, 11 Feb 2015 03:42:50 +0530, noyb noybee said:
 Apologies for the late reply.


  Plus the whole passphrase thing is probably equally easy to defeat.  (Hint -
  how does the passphrase get passed to the kernel in the first place?)

 I am planning to create a new system call for that and I am not sure
 how that would be insecure. Please correct me if I am wrong.

You missed the point.  How does the process *securely* get the passphrase
that will be passed into the syscall? (Hint - a keystroke logger is only
the *start* of your problems.  Think about why the kernel module signing
code uses public-key crypto instead of symmetric private keys...)

 What you're saying is definitely simpler than my approach but it
 probably violates some POSIX standards(including chdir in chroot)
 which I don't want to. Also, I aim for my tool to be just a simple
 addendum to the traditional system call rather than adding a
 completely new call to handle the entire process.

The problem with simple addendum is that it's *really* hard to get it right.


pgp2hIwoOgw5H.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


<    1   2   3   4   5   6   7   8   9   10   >