Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 464492 - =sys-devel/patch-{2.6.1,2.7.1,2.7.1-r1} - Almost silently ignoring part of a patch
Summary: =sys-devel/patch-{2.6.1,2.7.1,2.7.1-r1} - Almost silently ignoring part of a ...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 23:21 UTC by Scott Bertilson
Modified: 2018-05-14 22:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Bertilson 2013-04-03 23:21:03 UTC
When trying to build net-misc/openssh-6.1p1 with "hpn" enabled part of the HPN patch doesn't apply which results in the built copy of sshd refusing to enable the "none" cipher.
Essentially, patch gets confused part way through one of the patches:
...
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -Nuar --exclude '*.orig' openssh-5.9p1.orig/sshd.c openssh-5.9p1/sshd.c
|--- openssh-5.9p1.orig/sshd.c  2011-06-23 09:45:51.000000000 +0000
|+++ openssh-5.9p1/sshd.c       2011-09-07 06:52:57.697811549 +0000
--------------------------
patching file sshd.c
Using Plan A...
Hunk #1 succeeded at 138.
Hunk #2 succeeded at 423 with fuzz 2 (offset 1 line).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
| 
|@@ -470,6 +473,9 @@
|       }
|       debug("Client protocol version %d.%d; client software version %.100s",
|           remote_major, remote_minor, remote_version);
|+      logit("SSH: Server;Ltype: Version;Remote: %s-%d;Protocol: %d.%d;Client: %.100s",
|+            get_remote_ipaddr(), get_remote_port(),
|+          remote_major, remote_minor, remote_version);
| 
|       compat_datafellows(remote_version);
| 
|@@ -1023,6 +1029,8 @@
|       int ret, listen_sock, on = 1;
|       struct addrinfo *ai;
|       char ntop[NI_MAXHOST], strport[NI_MAXSERV];
|+      int socksize;
|+      int socksizelen = sizeof(int);
...
This can easily be demonstrated clearly by extracting openssh-6.1p1.tar.gz then applying the HPN patch against it.

Reproducible: Always

Steps to Reproduce:
1.tar xzf /usr/portage/distfiles/openssh-6.1p1.tar.gz
2.cd openssh-6.1p1
3.bzcat </usr/portage/distfiles/openssh-6.1p1-hpn13v11.diff.bz2 >/tmp/openssh-6.1p1-hpn13v11.diff
4.patch --verbose --backup -p1 -g0 -E --no-backup-if-mismatch < /tmp/openssh-6.1p1-hpn13v11.diff
Actual Results:  
Note that patch doesn't think it sees the patches beyond the second for sshd.c.  It doesn't apply them and it doesn't leave any rejected patches and it returns a successful exit status.

The ebuild for openssh-6.1p1 succeeds, but the non-patched lines in sshd.c prevent the NONE cipher from working.
For some strange reason this problem doesn't seem to apply to openssh-6.0p1 or 5.9 (the NONE cipher works fine for sshd when I build those).
I ran the ebuilds to the point of "install" for 2.7.1 and 2.7.1-r1 and then ran patch from the tree to test those versions.
Comment 1 Scott Bertilson 2013-04-03 23:23:26 UTC
Portage 2.2.0_alpha166 (default/linux/amd64/13.0/desktop, gcc-4.6.3-vanilla, glibc-2.15-r2, 3.7.0-sabayon x86_64)
=================================================================
System uname: Linux-3.7.0-sabayon-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.2
KiB Mem:     3916032 total,    164356 free
KiB Swap:   37007696 total,  36230836 free
Timestamp of tree: Wed, 06 Mar 2013 13:45:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.6.6-r2, 2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2::sabayon-distro
sys-apps/openrc:          0.11.8::sabayon-distro
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.69
sys-devel/automake:       1.10.3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.7, 4.5.4::sabayon-distro, 4.6.3::sabayon-distro
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.4
sys-libs/glibc:           2.15-r2::sabayon-distro
Repositories: gentoo user_defined science barzog-overlay sabayon sabayon-distro sunrise webapp-experimental voip pentoo
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=x86-64 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/entropy /usr/share/config /usr/share/config/kdm /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/skel /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=x86-64 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1,--as-needed"
MAKEOPTS="-j3 -s"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/science /var/lib/layman/barzog-overlay /var/lib/layman/sabayon /var/lib/layman/sabayon-distro /var/lib/layman/sunrise /var/lib/layman/webapps-experimental /var/lib/layman/voip /var/lib/layman/pentoo"
SYNC="rsync://rsync4.ca.gentoo.org/gentoo-portage"
USE="X a52 aac accessibility acl acpi aiglx aim alsa amd64 artswrappersuid audiofile avahi bash-completion berkdb bidi bluetooth bzip2 cairo cdda cddb cdr cjk cli consolekit cpudetection cracklib crypt cups cxx dbus dga dri dts dv dvb dvd dvdr dvdread dvi emboss encode exif fam fame fat ffmpeg firefox flac foomatic-db fortran freetype gcj gdbm gif gimpprint gmp gnutls gphoto2 gpm gsm gtk hfs iconv icq ieee1394 imap inotify ipod ipv6 irc irda jabber jack jfs joystick jpeg kdeenablefinal kdehiddenvisibility kerberos lame lcd lcms ldap libnotify live lm_sensors lzo mad mail matroska mjpeg mmx mng modules mozdevelop mp3 mp3rtp mp4 mpeg msn mudflap multilib musepack musicbrainz ncurses network nls nptl nsplugin ntfs ogg openal openexr opengl openmp pam pango pcmcia pcre pda pdf png policykit ppds pulseaudio qt3support qt4 rar rdesktop readline reiserfs rss scanner sdl session slp speex spell sse sse2 ssl startup-notification stream svg sysfs tcpd theora tiff truetype udev udisks unicode upower usb v4l v4l2 visualization vorbis wifi wmf wxwidgets x264 xcb xfs xine xinerama xml xpm xprint xulrunner xv xvid xvmc yahoo zeroconf zlib" ABI_X86="64" ALSA_CARDS="emu10k1x darla20 darla24 emu10k1 gina20 gina24 hdsp hdspm ice1712 indigo indigoio layla20 layla24 mia mixart mona pcxhr rme32 rme96 sb16 sbawe sscape usbusx2y vx222 usb-usx2y" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="agfa_cl20 casio_qv dimagev dimera3500 kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica_qm150 panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ricoh_g3 sipix_blink sipix_blink2 sipix_web2 sony_dscf1 sony_dscf55 toshiba_pdrm11 adc65 aox barbie canon clicksmart310 digigr8 digita directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 konica largan lg_gsm mars mustek pccam300 pccam600 ptp2 ricoh samsung sierra smal sonix soundvision spca50x sq905 stv0674 stv0680 sx330z template" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US af ar az bg bn br bs ca cs cy da de el en_GB eo es et eu fa fi fr fy ga gl he hi hr hu is it ja kk km ko lt lv mk mn ms nb nds nl nn pa pl pt pt_BR ro ru rw se sk sl sr sr@Latn ss sv ta tg tr uk uz vi zh_CN zh_TW es_AR es_ES fy_NL ga_IE gu gu_IN nb_NO nn_NO pt_PT sv_SE zh" LIRC_DEVICES="audio audio_alsa serial pctv" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev vesa radeonhd" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-02-13 11:50:50 UTC
Is this still an issue with sys-devel/patch-2.7.1-r3?
Comment 3 Scott Bertilson 2014-03-31 18:22:46 UTC
Finally tested this again.  It still does not work properly even with r3.  I'm going to dig into it a little more....make a stripped down case involving just sshd.c and make sure it still happens, then maybe try to get some more debug information out of patch.
Comment 4 Scott Bertilson 2014-03-31 18:23:12 UTC
I could take this upstream if that would be a better option.
Comment 5 SpanKY gentoo-dev 2014-10-19 04:52:40 UTC
(In reply to Scott Bertilson from comment #4)

that would be best.  they have pretty decent response.
https://lists.gnu.org/mailman/listinfo/bug-patch
Comment 6 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2018-05-14 22:06:14 UTC
probably obsolete. re-open if still relevant