LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-26-2014, 08:04 AM   #1
avian
Member
 
Registered: Aug 2014
Posts: 184

Rep: Reputation: Disabled
kernel compilation with stack protector


Currently running 14.1, and have a question that may be bizzare, but would love an answer.

The default kernel that is installed in 14.1 seems to support the __stack_chk_fail symbol (according to /proc/kallsyms). When I try to compile my own kernel, the Makefile seems to add the -fno-stack-protector option to CFLAGS (after doing a "ifndef CONFIG_CC_STACKPROTECTOR_"). So obviously my resultant kernel does include support for the __stack_chk_fail symbol.

To cut a long story short, if I try to override the makefile by changing -fno-stack-protector to -fstack-protector, the compilation doesnt complete, with errors along the lines of "init/build-in.o: In function `name_to_dev_t': undefined reference to `__stack_chk_fail'", and so forth.

So my question is. Is it possible to copmile a kernel on 14.1 with support for the __stack_chk_fail symbol, and if so, how would one go about it?
 
Old 08-26-2014, 12:20 PM   #2
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 249

Rep: Reputation: Disabled
This is mine
Code:
cat /proc/kallsyms | grep stack_chk
ffffffff81077240 T __stack_chk_fail

uname -r
3.15.7-1

Last edited by tuxbg; 08-26-2014 at 12:21 PM.
 
Old 08-26-2014, 12:41 PM   #3
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Don't ever fiddle with the kernel makefiles when there is an option to do what you want to do.

Go into 'make menuconfig'
Go to "Processor type and features"
Go down to "Enable -fstack-protector buffer overflow detection" (towards the bottom, immediately above the timer frequency)
Enable it, save, and build.

Last edited by 55020; 08-26-2014 at 12:42 PM.
 
2 members found this post helpful.
Old 08-26-2014, 12:56 PM   #4
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
welcome avian hope you find many answers you may need here.
 
1 members found this post helpful.
Old 08-26-2014, 07:58 PM   #5
avian
Member
 
Registered: Aug 2014
Posts: 184

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 55020 View Post
Don't ever fiddle with the kernel makefiles when there is an option to do what you want to do.

Go into 'make menuconfig'
Go to "Processor type and features"
Go down to "Enable -fstack-protector buffer overflow detection" (towards the bottom, immediately above the timer frequency)
Enable it, save, and build.
Thank you so much. You wont believe how many times I went through the config and missed that option.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: AMD To Open-Source Its Linux Execution & Compilation Stack LXer Syndicated Linux News 0 06-20-2012 11:10 PM
Compilation with SSP (Stack smash protection) PlatinumX Linux - Security 3 11-14-2008 05:57 PM
Difference b/t Kernel stack and User stack hazzyb Linux - Software 2 09-29-2008 07:40 PM
Problem compiling BlueZ stack on ARM ( cross compilation from linux x86) shilpates Linux - Wireless Networking 1 08-20-2008 03:02 AM
Virtual Machine kernel stack fault in kernel mode virtical Linux - Software 0 07-14-2003 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration