Andy Whitcroft [Tue, 6 Jan 2015 11:05:22 +0000 (11:05 +0000)]
UBUNTU: [Debian] uploadnum should be the remainder of the version
The uploadnum variable in debian/rules is somewhat confusingly named,
it should be the "remainder of the version after <version>-<abinum>", not
just the uploadnum itself. This version is only used for identification
in uname -v and there it is completely appropriate for this to be complete
with backport versions etc.
Andy Whitcroft [Fri, 3 Oct 2014 16:43:13 +0000 (17:43 +0100)]
UBUNTU: [Debian] linux-image-extra postrm is not needed on purge
Signed-off-by: Andy Whitcroft <apw@canonical.com>
(cherry picked from commit 920e8acdb5b860086618e436f572717b631e65ec) Signed-off-by: Andy Whitcroft <apw@canonical.com>
Andy Whitcroft [Thu, 2 Oct 2014 10:00:45 +0000 (11:00 +0100)]
UBUNTU: [Debian] linux-image-extra is additive to linux-image
linux-image-extra is special, it is only additive to linux-image, this
means really cannot use the standard kernel postinst/postrm for this
package. As it also depends on linux-image we know that linux-image will
have been installed before it, and will be removed after it. On change
(installation/update/removal) of linux-image-extra we want to run the
kernel postinst to rebuilt the initramfs and update the bootloader
as necessary. To this end switch to package specific postinst/postrm
which trigger the /etc/kernel/postinst.d hooks. We need to do it this
way to get the specially parameterised incantations of update-initramfs,
to ensure we trigger the correct build rather than mearly dpkg triggering
a rebuild of the running kernel.
dann frazier [Wed, 30 Jul 2014 16:57:11 +0000 (10:57 -0600)]
UBUNTU: [Debian] Fix 'printchanges' to work with versions containing '+'
I maintain several topic kernel branches/builds where I like to use version
strings that contain a '+' character. Today this means I can't use targets
like printchanges and insertchanges because '+' characters aren't escaped.
Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Andy Whitcroft [Wed, 5 Nov 2014 10:28:29 +0000 (10:28 +0000)]
UBUNTU: [Debian] basic hook support
Add the infrastructure for Makefile macro overrides. This
is primarily used by LTS backport branches to supersede master
branch settings such as do_tools_common, etc.
Tim Gardner [Mon, 27 Oct 2014 20:14:08 +0000 (14:14 -0600)]
UBUNTU: [Debian] Fix linux-doc dangling symlinks
BugLink: https://bugs.launchpad.net/bugs/661306 Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Acked-by: Stefan Bader <stefan.bader@canonical.com> Acked-by: Chris J Arges <chris.j.arges@canonical.com>
Tim Gardner [Fri, 26 Sep 2014 19:30:28 +0000 (13:30 -0600)]
UBUNTU: [Debian] Don't fail if a symlink already exists
A restarted build (dpkg-buildpackage -nc) currently fails if the linux-tools
symlinks remain from a previous build. Use ln -sf to allow the build to
continue by overwriting any existing links.
Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
dann frazier [Fri, 15 Aug 2014 19:40:08 +0000 (13:40 -0600)]
UBUNTU: [debian] Fix regression with ABI subversions and backport
Tim pointed out that 443b5814ee77f8c9083079ce0e6a0806e087630f broke the parsing
of backport versions, such as 8.13~14.10+ppa.1. This should fix it. I used the
following script to validate the regular expressions:
dannf@fluid:~$ cat test.sh
set -e
splitver() {
local ver="$1"
local abinum="$(echo $ver | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$/\1/')"
local uploadnum="$(echo $ver | sed -r -e 's/[^\+~]*\.([^\.~]+)(~.*)?(\+.*)?$/\1/')"
echo "$abinum $uploadnum"
}
do_test() {
local ver="$1"
local expected="$2"
local actual="$(splitver $ver)"
if [ "$actual" = "$expected" ]; then
echo "PASS: $ver"
return 0
fi
echo "FAIL: $ver split as $actual"
return 1
}
dann frazier [Mon, 11 Aug 2014 19:50:02 +0000 (13:50 -0600)]
UBUNTU: [debian] Allow for package revisions condusive for branching
TLDR; This changes the way that version strings are parsed in the packaging to
make it easier for me to maintain topic branches/PPA builds. There should
be no changes to how things work today for standard Ubuntu kernels. But,
it allows for topic-branch maintainers to add an optional ".X" in the ABI
name, for reasons described below.
<Regression Testing>
------------------
Old Parsing:
= abinum =
$ echo "33.58" | sed -e 's/\..*//'
33
= uploadnum =
$ echo "33.58" | sed -e 's/.*\.//'
58
= abi =
$ echo "33.58" | gawk -F. '{print $1}'
33
New Parsing:
= abinum =
$ echo "33.58" | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/'
33
= uploadnum =
$ echo "33.58" | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/'
58
= abi =
$ echo "33.58" | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/'
33
</Regression Testing>
When maintaining topic customizations that track Ubuntu kernel releases, it
is nice have the following features:
1) Ability to decipher the base Ubuntu kernel revision used from the topic
kernel's revision number
2) Use a version that dpkg sorts > the base Ubuntu version
3) Use a version that dpkg sorts < the next expected Ubuntu version
4) Ability to retains the same ABI as the base Ubuntu version when the
ABI has indeed not changed. This helps with e.g. d-i compatibility.
5) Make use of ABI tracking facilities (vs. just disabling them)
This is difficult to do with the current version scheme, which encodes the
ABI number in the version string:
<upstream-version>-<abi>.<rev>
I can tack a "+topic.<N>" to the end of rev, we can solve 1-3, but only as
long as as the ABI is the same. Once the ABI changes, I don't have a good way
to bump it. If I increment the ABI, we'll overlap with the next Ubuntu ABI
(breaking #4). If we jump to a huge ABI number (e.g. x100 to go from 32 to
3200), we'll have a package revision that will never again upgrade to an Ubuntu
version (breaking #3), and never get back to the Ubuntu ABI (again breaking #4).
I can of course use a linux-meta package to e.g. transition from a 3200 ABI back
to a 32 ABI at the packaging level, but the bootloader will still consider
3200 to be newer and therefore the default.
I've therefore started using the following scheme:
Andy Whitcroft [Thu, 5 Dec 2013 18:14:04 +0000 (18:14 +0000)]
UBUNTU: [Debian] Improve tools version message
BugLink: http://bugs.launchpad.net/bugs/1257715 Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Tim Gardner [Tue, 26 Nov 2013 17:35:47 +0000 (10:35 -0700)]
UBUNTU: [Debian] Re-sign modules after debug objcopy
BugLink: http://bugs.launchpad.net/bugs/1253155
Adding a GNU debug link to a module ELF destroys the
module signature, so re-sign the module file after the objcopy.
When the symlinks are made we attempt to use relative links if that
would work. However this relies on the file we are making the link to to
actually exist. When it does not we fall back to absolute. This impacts
the initrd links which are made before we make the initrd itself.
When the caller has asked us to use a specific handle file and that file
does not yet exist, see if there are any other files we can use in that
directory. In the common case this will be a version specific file and
highly unique.
Andy Whitcroft [Sat, 22 Jun 2013 11:52:29 +0000 (12:52 +0100)]
UBUNTU: [Debian] autopkgtest: switch Depends: to build-essential
autopkgtest control Depends: as empty now seems to be an error, we want
to say 'install nothing' so switch it to depend on packages which by
definition are always installed.
Andy Whitcroft [Wed, 31 Jul 2013 12:41:32 +0000 (13:41 +0100)]
UBUNTU: [Debian] supply perf with appropriate prefix to ensure use of local config
If we do not supply an installation prefix when we are building perf
it will assume it is designed to run relative to the builders HOME.
This means that as built on a buildd we will check for the system
configuration relative to the buildd users home rather than in /etc.
This implies a local user could use this to compromise other users _if_
there is a buildd user installed on the system and they have access to it.
Stefan Bader [Tue, 9 Apr 2013 17:18:46 +0000 (19:18 +0200)]
UBUNTU: (debian) Abort build on unresolved symbols
When splitting the flavours of a module into the extras and base
package, we already run depmod. Unfortunately this only produces
warnings when modules in the base package have unresolved depen-
dencies.
This change will abort the build in that case, so we can fix things.
Kamal Mostafa [Wed, 13 Mar 2013 22:20:04 +0000 (15:20 -0700)]
UBUNTU: [debian] do not use ../.$(series)-env file
Trying to use a file from ../ outside the tree seems like a bad idea, and
the series="oneiric" value here is stale by three releases now. Kill this
apparently unused "feature".
Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Tim Gardner [Fri, 22 Mar 2013 12:53:48 +0000 (06:53 -0600)]
UBUNTU: [debian] Build extras package only for specific arches
An unwanted side effect of renaming arm omap4 to generic is that
the default rule is to create an extras package for flavours named 'generic'.
Furthermore, We stupidly tied the extras package logic to the flavour name 'generic'.
Defeat this side effect by specifying which architectures get an extras package
split, e.g., x86_64 and i386 in the arch specific make file.
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Paolo Pisati [Wed, 9 Jan 2013 10:27:47 +0000 (10:27 +0000)]
UBUNTU: [debian] DTB: add support for multiple DTBs
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Andy Whitcroft <andy.whitcroft@canonical.com> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Andy Whitcroft [Wed, 21 Nov 2012 11:13:50 +0000 (11:13 +0000)]
UBUNTU: [debian] add an autopkgtest rebuild test
The plan here is for linux, gcc, binutils, and eglibc to all depends on
each other and to all have a rebuild test. That way the entire set is
rebuild tested for any one in the set being uploaded.
Andy Whitcroft [Wed, 21 Nov 2012 11:01:09 +0000 (11:01 +0000)]
UBUNTU: [debian] move build tests out of the way
The new Debian autopkgtest system takes ownership of the debian/tests
directory, in such a way that is incompatible with our usage. Move our
tests to debian/tests-build as they are build tests.
Andy Whitcroft [Wed, 21 Nov 2012 10:00:25 +0000 (10:00 +0000)]
UBUNTU: [debian] add rebuild-test support for autopkgtest
Add support for the DEB_BUILD_OPTIONS rebuild-test which indicates this is
not a full build but a quick smoke test. For us short circuit the build
and only make the first flavour on the assumption it is representative
of the others.
Ben Collins [Fri, 9 Nov 2012 19:17:12 +0000 (14:17 -0500)]
UBUNTU: [debian] Use SRCPKGNAME as prefix for indep linux headers package
[apw@canonical.com: forward ported to new cleaned up indep stack.] Signed-off-by: Ben Collins <ben.c@servergy.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Ben Collins [Thu, 8 Nov 2012 20:01:31 +0000 (15:01 -0500)]
UBUNTU: [debian] Add custom_override rule to allow for alternate kernel file/install
On PowerPC, the flavours have different make targets and installable
images. For example, e500/e500mc use a target of uImage, since that is
the native format for U-Boot systems.
Signed-off-by: Ben Collins <ben.c@servergy.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Andy Whitcroft [Thu, 20 Sep 2012 18:49:03 +0000 (19:49 +0100)]
UBUNTU: [debian] add custom upload for the kernel binary package
Pick out the kernel binaries and add them to a custom upload. This upload
will trigger signing of the contained files which will later be pulled
into linux-*-signed packages.
Only include amd64 kernels as we only support EFI signed packages there.
Also ensure the kernel has a high enough interface version >= 0x020b
otherwise we may end up with an unsafe kernel loaded.
Al Viro [Sun, 19 Feb 2017 07:15:27 +0000 (07:15 +0000)]
Fix missing sanity check in /dev/sg
What happens is that a write to /dev/sg is given a request with non-zero
->iovec_count combined with zero ->dxfer_len. Or with ->dxferp pointing
to an array full of empty iovecs.
Having write permission to /dev/sg shouldn't be equivalent to the
ability to trigger BUG_ON() while holding spinlocks...
Found by Dmitry Vyukov and syzkaller.
[ The BUG_ON() got changed to a WARN_ON_ONCE(), but this fixes the
underlying issue. - Linus ]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Reported-by: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Don't crash the machine just because of an empty transfer. Use WARN_ON()
combined with returning an error.
Found by Dmitry Vyukov and syzkaller.
[ Changed to "WARN_ON_ONCE()". Al has a patch that should fix the root
cause, but a BUG_ON() is not acceptable in any case, and a WARN_ON()
might still be a cause of excessive log spamming.
NOTE! If this warning ever triggers, we may end up leaking resources,
since this doesn't bother to try to clean the command up. So this
WARN_ON_ONCE() triggering does imply real problems. But BUG_ON() is
much worse.
People really need to stop using BUG_ON() for "this shouldn't ever
happen". It makes pretty much any bug worse. - Linus ]
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: James Bottomley <jejb@linux.vnet.ibm.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Willem de Bruijn [Sun, 19 Feb 2017 00:00:45 +0000 (19:00 -0500)]
ipv6: release dst on error in ip6_dst_lookup_tail
If ip6_dst_lookup_tail has acquired a dst and fails the IPv4-mapped
check, release the dst before returning an error.
Fixes: ec5e3b0a1d41 ("ipv6: Inhibit IPv4-mapped src address on the wire.") Signed-off-by: Willem de Bruijn <willemb@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Sun, 19 Feb 2017 01:38:09 +0000 (17:38 -0800)]
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC fixes from Arnd Bergmann:
"Two more bugfixes that came in during this week:
- a defconfig change to enable a vital driver used on some Qualcomm
based phones. This was already queued for 4.11, but the maintainer
asked to have it in 4.10 after all.
- a regression fix for the reset controller framework, this got
broken by a typo in the 4.10 merge window"
* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: multi_v7_defconfig: enable Qualcomm RPMCC
reset: fix shared reset triggered_count decrement on error
Linus Torvalds [Sun, 19 Feb 2017 01:33:17 +0000 (17:33 -0800)]
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Thomas Gleixner:
"Move the futex init function to core initcall so user mode helper does
not run into an uninitialized futex syscall"
* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
futex: Move futex_init() to core_initcall
Linus Torvalds [Sun, 19 Feb 2017 01:30:36 +0000 (17:30 -0800)]
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner:
"Two small fixes::
- Prevent deadlock on the tick broadcast lock. Found and fixed by
Mike.
- Stop using printk() in the timekeeping debug code to prevent a
deadlock against the scheduler"
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timekeeping: Use deferred printk() in debug code
tick/broadcast: Prevent deadlock on tick_broadcast_lock
1) Fix leak in dpaa_eth error paths, from Dan Carpenter.
2) Use after free when using IPV6_RECVPKTINFO, from Andrey Konovalov.
3) fanout_release() cannot be invoked from atomic contexts, from Anoob
Soman.
4) Fix bogus attempt at lockdep annotation in IRDA.
5) dev_fill_metadata_dst() can OOP on a NULL dst cache pointer, from
Paolo Abeni.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
irda: Fix lockdep annotations in hashbin_delete().
vxlan: fix oops in dev_fill_metadata_dst
dccp: fix freeing skb too early for IPV6_RECVPKTINFO
dpaa_eth: small leak on error
packet: Do not call fanout_release from atomic contexts
This RCU warning, however, is suppressed by lockdep_off() in printk().
lockdep_off() increments the ->lockdep_recursion counter and thus
disables RCU_LOCKDEP_WARN() and debug_lockdep_rcu_enabled(), which want
lockdep to be enabled "current->lockdep_recursion == 0".
Link: http://lkml.kernel.org/r/20170217015932.11898-1-sergey.senozhatsky@gmail.com Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Reported-by: Tony Lindgren <tony@atomide.com> Tested-by: Tony Lindgren <tony@atomide.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Lindgren <tony@atomide.com> Cc: Russell King <rmk@armlinux.org.uk> Cc: <stable@vger.kernel.org> [3.4+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Paolo Abeni [Fri, 17 Feb 2017 18:14:27 +0000 (19:14 +0100)]
vxlan: fix oops in dev_fill_metadata_dst
Since the commit 0c1d70af924b ("net: use dst_cache for vxlan device")
vxlan_fill_metadata_dst() calls vxlan_get_route() passing a NULL
dst_cache pointer, so the latter should explicitly check for
valid dst_cache ptr. Unfortunately the commit d71785ffc7e7 ("net: add
dst_cache to ovs vxlan lwtunnel") removed said check.
As a result is possible to trigger a null pointer access calling
vxlan_fill_metadata_dst(), e.g. with:
This commit addresses the issue passing to vxlan_get_route() the
dst_cache already available into the lwt info processed by
vxlan_fill_metadata_dst().
Fixes: d71785ffc7e7 ("net: add dst_cache to ovs vxlan lwtunnel") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Acked-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Andrey Konovalov [Thu, 16 Feb 2017 16:22:46 +0000 (17:22 +0100)]
dccp: fix freeing skb too early for IPV6_RECVPKTINFO
In the current DCCP implementation an skb for a DCCP_PKT_REQUEST packet
is forcibly freed via __kfree_skb in dccp_rcv_state_process if
dccp_v6_conn_request successfully returns.
However, if IPV6_RECVPKTINFO is set on a socket, the address of the skb
is saved to ireq->pktopts and the ref count for skb is incremented in
dccp_v6_conn_request, so skb is still in use. Nevertheless, it gets freed
in dccp_rcv_state_process.
Fix by calling consume_skb instead of doing goto discard and therefore
calling __kfree_skb.
Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Fri, 17 Feb 2017 17:51:05 +0000 (09:51 -0800)]
Merge tag 'ntb-4.10-bugfixes' of git://github.com/jonmason/ntb
Pull NTB bugfixes frfom Jon Mason:
"NTB bug fixes to address a crash when unloading the ntb module, a DMA
engine unmap leak, allowing the proper queue choice, and clearing the
SKX irq bit"
* tag 'ntb-4.10-bugfixes' of git://github.com/jonmason/ntb:
ntb: ntb_hw_intel: link_poll isn't clearing the pending status properly
ntb_transport: Pick an unused queue
ntb: ntb_perf missing dmaengine_unmap_put
NTB: ntb_transport: fix debugfs_remove_recursive
Dan Carpenter [Thu, 16 Feb 2017 09:56:10 +0000 (12:56 +0300)]
dpaa_eth: small leak on error
This should be >= instead of > here. It means that we don't increment
the free count enough so it becomes off by one.
Fixes: 9ad1a3749333 ("dpaa_eth: add support for DPAA Ethernet") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Arnd Bergmann [Fri, 17 Feb 2017 16:25:15 +0000 (17:25 +0100)]
Merge tag 'reset-for-4.10-fixes' of https://git.pengutronix.de/git/pza/linux into fixes
Pull "Reset controller fixes for v4.10" from Philipp Zabel:
- Remove erroneous negation of the error check of the reset function
to decrement trigger_count in the error case, not on success. This
fixes shared resets to actually only trigger once, as intended.
* tag 'reset-for-4.10-fixes' of https://git.pengutronix.de/git/pza/linux:
reset: fix shared reset triggered_count decrement on error
3. calling dev_remove_pack(&fanout->prot_hook), from inside
spin_lock(&po->bind_lock) or rcu_read-side critical-section. dev_remove_pack()
-> synchronize_net(), which might sleep.
4. fanout_release() races with calls from different CPU.
To fix the above problems, remove the call to fanout_release() under
rcu_read_lock(). Instead, call __dev_remove_pack(&fanout->prot_hook) and
netdev_run_todo will be happy that &dev->ptype_specific list is empty. In order
to achieve this, I moved dev_{add,remove}_pack() out of fanout_{add,release} to
__fanout_{link,unlink}. So, call to {,__}unregister_prot_hook() will make sure
fanout->prot_hook is removed as well.
Fixes: 6664498280cf ("packet: call fanout_release, while UNREGISTERING a netdev") Reported-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Anoob Soman <anoob.soman@citrix.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>