LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-22-2010, 07:06 AM   #31
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135

Quote:
Originally Posted by GazL View Post
Yep a patched 33.4 in both stable and current!

Interesting choice and definitely not one I would have chosen. Especially in current where stability (in the non-changing sense of the word) isn't necessary.
I, for one, am glad to install the new, patched kernel. It fixes a known vulnerability. That's good.

Quote:
I'm more convinced than ever that if you're going to run a secure slackware box, you absolutely have to run your own custom kernel build and keep up to date with a branch that is still maintained upstream.

The linux kernel devs are well known for their policy of treating security bugs just as any other bug and not highlighting them specifically as security concerns. If all Pat has done is apply the patches necessary to fix these latest 64-to-32bit-syscall-compat holes then there's bound to be other issues still lurking in his patched 33.4 that have been silently fixed upstream in later kernel branches.
Why are they silently fixed upstream? Shouldn't that stuff be visible in a changelog somewhere?

Quote:
The bigger distros (especially the commercial ones) have their own kernel dev teams that can follow these things in detail and back-port security fixes they identify to their own 'stable' series kernels. I doubt Pat either has the time or the in-depth kernel knowledge necessary to do that.
This sounds like a perfect volunteer opportunity for somebody to build a slackkernels.org web site hosting custom, backported stable kernels. Then, after a few years of being useful, the site could become an official unofficial Slackware site mentioned in Slackware 15's RELEASE_NOTES.
 
Old 09-22-2010, 09:47 AM   #32
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by Lufbery View Post
I, Why are they silently fixed upstream? Shouldn't that stuff be visible in a changelog somewhere?
If I remember rightly, Linus' argument is that security bugs are just bugs no different than any other bugs and the kernel devs will treat them just like other bugs, with no special treatment. The rationale is that by highlighting them as 'security' bugs, they're actually helping the script-kiddies and exploit writers to identify the holes. However, the opposite side of the coin is that by not highlighting them they also make it difficult for distro maintainers to identify the necessary patches.

That's fair enough so long as everyone is running the latest upstream kernel, but as we see here, distros tend to hang back for 'stability' reasons. The next question is obviously why do the distros hang back then, and the simple answer to that is that kernel.org 'stable' kernels aren't always that stable (in either sense of the word).

And that brings us back to my view on the subject.
Unless you're willing/able to put the effort into having your own in-house kernel team who can maintain their own kernel, then in order to remain secure you either need to follow the latest long term support kernel branch (currently 2.6.32) or you follow the leading edge (currently 2.6.35). I honestly don't think any other choice makes sense with the way kernel development is done upstream.

Slackware currently finds itself in the awkward situation of running a unmaintained branch of the kernel 2.6.33. It's simply not a good situation to be in, and as I've said before IMO it was a mistake not to go with 2.6.32 when Slackware 13.1 was released.

If I were Pat, which of course I'm not. I would provide 2 kernel choices. The latest of whatever the current kernel.org long-term support branch is, and the latest of whatever the most recent stable branch is.

Obviously, the situation is easily rectified by building your own kernel at whatever version you feel comfortable with, but that's something novices might find a little intimidating.

Well, that's how I see things anyway. Everyone else is of course free to disagree.

Last edited by GazL; 09-22-2010 at 09:52 AM.
 
1 members found this post helpful.
Old 09-22-2010, 06:47 PM   #33
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
If I were Pat, which of course I'm not. I would provide 2 kernel choices. The latest of whatever the current kernel.org long-term support branch is, and the latest of whatever the most recent stable branch is.

Obviously, the situation is easily rectified by building your own kernel at whatever version you feel comfortable with, but that's something novices might find a little intimidating.

Well, that's how I see things anyway. Everyone else is of course free to disagree.
I really like your suggestion for 2 kernel choices: it actually sounds like a great one for any distribution.

As for intimidation, I was pleasantly surprised at how easy making the kernel was (I haven't done it in a few years).

Code:
# check out the stable branch from kernel.org
cd /usr/src
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.35.y.git
mv linux-2.6.35.y linux-stable

# OR, if you cloned before, pull the head of the branch
cd /usr/src/linux-stable
git pull

# import a config file, unless you want to manually configure
cd /usr/src/linux-stable
cp /boot/config-huge-old-version ./.config
make oldconfig
make
su -
make modules_install
# your arch may vary:
cp ./arch/x86_64/boot/bzImage /boot/image_name
cd /boot
# the version should be, of course, the current one:
mkinitrd -o initrd_name -k 2.6.35.4
add to /etc/lilo.conf

Code:
image = /boot/image_name
initrd = /boot/initrd_name
# your device may differ:
root = /dev/sda1
label = slackware
At last,
Code:
lilo
sync
sync
init 6
Hmmm, may be I should write a scripty for this?

Last edited by qweasd; 09-22-2010 at 07:17 PM. Reason: typo
 
Old 09-22-2010, 07:45 PM   #34
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by qweasd View Post
Hmmm, may be I should write a scripty for this?
That's what I did.

I wrote a wrapper script to automate package builds of my kernels. I just type

VERSION=2.6.35.5 ./kernel.SlackBuild

and 5-10 minutes later kernel-generic, kernel-modules and kernel-firmware packages are sitting in /tmp.


It's a bit rough and ready and it could be done a lot better (using the make O= approach to the build), and it could definitely do with a little extra error checking but it's been serving me well so far.

kernel.SlackBuild:
Code:
#!/bin/sh
#
#  Build Slackware kernel packages
#
#  Usage:  
#    "VERSION=2.6.33.nn ./kernel.SlackBuild"
#        where nn is the patch number.
#

VERSION=${VERSION:-2.6.33}
MAJOR_V=$( echo $VERSION | cut -f 1-3 -d '.' )
MINOR_V=$( echo $VERSION | cut -f 4 -d '.' )

if [ -n "$CONFIG" ] ; then
  CONFIG=$(readlink -f "$CONFIG")  #  Cannonicalise
fi

# BASEDIR:  Directory containing this script.
BASEDIR=$(readlink -f $(dirname $0))

# DISTFILES:  Directory containing kernel source tarballs
#             and patch files.
DISTFILES=${DISTFILES:-${BASEDIR}/distfiles}  
DISTFILES=$(readlink -f "$DISTFILES")  #  Cannonicalise

# FTP_SITE:  Site to pull kernel source and patch files from if no
#            local copy is found.
FTP_SITE="ftp://ftp.eu.kernel.org/pub/linux/kernel/v2.6"

#  Test for existence of source distribution files and get them if necessary
#

cd $DISTFILES || exit 1

test -f "linux-${MAJOR_V}.tar.bz2" || \
   lftp -c "mget $FTP_SITE/linux-$MAJOR_V.tar.bz2*"

gpg --verify "$DISTFILES/linux-$MAJOR_V.tar.bz2.sign" || exit 1

if [ "$MINOR_V" != "" ] ; then
   test -f "patch-${VERSION}.bz2" || \
   lftp -c "mget $FTP_SITE/patch-$VERSION.bz2*"

   gpg --verify "$DISTFILES/patch-$VERSION.bz2.sign" || exit 1
fi 

#  Clear Source tree
#

if [ "$MINOR_V" != "" ] ; then
  rm -rf "/usr/src/linux-${VERSION}"
fi

rm -rf "/usr/src/linux-${MAJOR_V}"

#  Unpack Kernel source
#

cd /usr/src || exit 1
tar -jxf "$DISTFILES/linux-${MAJOR_V}.tar.bz2" || exit 1

if [ "$MINOR_V" != "" ] ; then
  mv "linux-${MAJOR_V}" "linux-${VERSION}" || exit 1
  cd "linux-${VERSION}" || exit 1
  bzip2 -dc "$DISTFILES/patch-${VERSION}.bz2" | patch -p1 || exit 1
fi

#  Build Kernel 
#

cd "/usr/src/linux-${VERSION}" || exit 1

make mrproper
if [ "$CONFIG" != "" ] ; then
  cat "$CONFIG" > .config || exit 1
else
  zcat /proc/config.gz > .config || exit 1
fi
make oldconfig
make -j3 bzImage modules || exit 1
make modules_install || exit 1

#  Build kernel packages
#

export VERSION  #  make VERSION available to following slackbuild scripts

cd ${BASEDIR}/kernel-generic && \
   echo 'continue' | ./kernel-generic.SlackBuild || exit 1

cd ${BASEDIR}/kernel-modules && \
   ./kernel-modules.SlackBuild || exit 1

cd ${BASEDIR}/kernel-firmware && \
   ./kernel-firmware.SlackBuild || exit 1

## end.
The 3 Slackbuild directories at the bottom are direct lifts from the slackware sources. (One of them I had to change to use $VERSION correctly because it had the version number hard coded in it - can't remember which one)
 
Old 09-23-2010, 12:30 PM   #35
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135
GazL,

That's a pretty cool script. Given that it uses the oldconfig, it seems best for updating the stock Slackware kernels. Is there a way to set up the script to use the interactive menu config and then continue on to make the packages?

Regards,
 
Old 09-23-2010, 01:10 PM   #36
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Original Poster
Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
it should be enough to add after "make oldconfig" a "make menuconfig".
 
Old 09-23-2010, 01:51 PM   #37
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Yep if you throw a make menuconfig in there then it'll give you the chance to change things when it runs.
I wrote it because I found that I was typing the same commands each time a new kernel came out, I never really intended it for a wider audience, so if you decide to use it be a little wary of it.

I normally do the menuconfig manually outside of the script and copy the config file into my configs subdirectory and then use the CONFIG= variable

FYI, the directory structure I run it in looks like this:
Code:
/home/build/kernel
/home/build/kernel/distfiles
/home/build/kernel/distfiles/patch-2.6.35.5.bz2
/home/build/kernel/distfiles/linux-2.6.35.tar.bz2.sign
/home/build/kernel/distfiles/linux-2.6.35.tar.bz2
/home/build/kernel/distfiles/patch-2.6.35.5.bz2.sign
/home/build/kernel/config
/home/build/kernel/config/2.6.35.config
/home/build/kernel/kernel-firmware
/home/build/kernel/kernel-firmware/kernel-firmware.SlackBuild
/home/build/kernel/kernel-firmware/slack-desc
/home/build/kernel/kernel-generic
/home/build/kernel/kernel-generic/kernel-generic.SlackBuild
/home/build/kernel/kernel-generic/slack-desc
/home/build/kernel/packages
/home/build/kernel/packages/archive
/home/build/kernel/packages/archive/kernel-generic-2.6.35.4-x86_64-1.txz
/home/build/kernel/packages/archive/kernel-firmware-2.6.35.4-noarch-1.txz
/home/build/kernel/packages/archive/kernel-modules-2.6.35.4-x86_64-1.txz
/home/build/kernel/packages/kernel-generic-2.6.35.5-x86_64-1.txz
/home/build/kernel/packages/kernel-firmware-2.6.35.5-noarch-1.txz
/home/build/kernel/packages/kernel-modules-2.6.35.5-x86_64-1.txz
/home/build/kernel/kernel.SlackBuild
/home/build/kernel/kernel-modules
/home/build/kernel/kernel-modules/kernel-modules.SlackBuild
/home/build/kernel/kernel-modules/slack-desc
/home/build/kernel/kernel-modules/rc.modules.new

Last edited by GazL; 09-23-2010 at 01:52 PM. Reason: typo
 
Old 09-24-2010, 12:26 PM   #38
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Rep: Reputation: 56
Just curious... any benefits to packaging up the kernel instead of manually copying the new kernel's bits to their designated locations? I have to admit, that script is pretty neat!
 
Old 09-24-2010, 12:49 PM   #39
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
The way Pat has written his kernel.Slackbuilds, which my script wraps around, he basically puts all the bits in place and then packages them up from their installed location (well, for modules anyway) so the only advantage you have in using the packages is that you end up with some packages laying around, and of course, all the files get registered in /var/log/packages so it's nice and easy to remove them (not that it's hard to remove them if you don't).

The packages come in handy if you ever want to install on more than one box or need to reinstall though.

Last edited by GazL; 09-24-2010 at 12:53 PM.
 
1 members found this post helpful.
  


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: Root exploit for Linux kernel published LXer Syndicated Linux News 0 07-17-2009 07:30 PM
LXer: Kernel Update to Fix Local Root Exploit LXer Syndicated Linux News 0 02-13-2008 06:10 PM
Linux Kernel 2.6 Local Root Exploit by vmsplice? Inuit-Uprising Slackware 9 02-13-2008 09:41 AM
How to run faillog on 32-bit compatibility mode? Sellina Linux - Newbie 0 10-22-2007 02:34 AM
i need PATCH that protect against local root exploit for kernel 2.2.19 Slackware veenrak Linux - Security 2 10-09-2002 09:23 PM

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

All times are GMT -5. The time now is 07:31 PM.

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