2019-05-19 13:08:20 +01:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-02 08:35:14 +01:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2012-02-13 03:58:52 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2014-11-07 21:22:25 +08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2023-06-08 19:17:37 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-02 18:02:28 -07:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2014-12-16 15:05:10 +02:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
2015-10-23 00:57:05 -04:00
|
|
|
|
2013-08-16 15:25:00 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-22 16:34:17 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2014-09-22 16:34:17 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
2014-09-22 16:34:17 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
Please do not apply this to mainline directly, instead please re-run the
coccinelle script shown below and apply its output.
For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
preference to ACCESS_ONCE(), and new code is expected to use one of the
former. So far, there's been no reason to change most existing uses of
ACCESS_ONCE(), as these aren't harmful, and changing them results in
churn.
However, for some features, the read/write distinction is critical to
correct operation. To distinguish these cases, separate read/write
accessors must be used. This patch migrates (most) remaining
ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
coccinelle script:
----
// Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
// WRITE_ONCE()
// $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch
virtual patch
@ depends on patch @
expression E1, E2;
@@
- ACCESS_ONCE(E1) = E2
+ WRITE_ONCE(E1, E2)
@ depends on patch @
expression E;
@@
- ACCESS_ONCE(E)
+ READ_ONCE(E)
----
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: davem@davemloft.net
Cc: linux-arch@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: shuah@kernel.org
Cc: snitzer@redhat.com
Cc: thor.thayer@linux.intel.com
Cc: tj@kernel.org
Cc: viro@zeniv.linux.org.uk
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-23 14:07:29 -07:00
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-15 03:46:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-23 22:17:14 +00:00
|
|
|
|
2013-12-15 22:12:06 -08:00
|
|
|
|
2011-11-23 22:17:14 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:38 +00:00
|
|
|
|
2011-11-23 22:17:14 +00:00
|
|
|
|
|
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:38 +00:00
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
|
|
|
|
|
2016-07-15 03:46:30 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
2010-08-04 06:15:59 +00:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2015-06-19 19:47:53 +05:30
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-08-16 15:25:00 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2013-08-16 15:25:00 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
2010-07-21 21:44:31 +00:00
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
2013-08-16 15:25:02 -04:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
2013-08-16 15:25:02 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2015-04-17 15:45:04 +02:00
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
2020-01-08 16:59:03 -05:00
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
|
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
|
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-06 05:58:21 -07:00
|
|
|
|
2020-01-08 16:59:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
|
|
|
|
|
2014-04-29 10:09:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:46 -08:00
|
|
|
|
2014-04-29 10:09:50 -04:00
|
|
|
|
|
|
|
|
|
2015-12-14 11:19:43 -08:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
|
|
|
|
|
2014-04-29 10:09:50 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2013-06-25 16:04:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
2010-07-21 21:44:31 +00:00
|
|
|
|
|
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2013-12-11 13:27:10 -05:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
|
|
|
|
|
2013-02-27 17:04:34 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-02-27 17:04:34 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-27 17:04:34 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2011-10-20 04:29:24 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-04-29 11:01:49 +00:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2015-11-29 20:03:10 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2010-04-29 11:01:49 +00:00
|
|
|
|
|
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2011-10-20 04:27:24 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2011-10-20 04:27:24 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2014-09-22 16:34:17 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2014-09-22 16:34:17 -04:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2017-10-25 00:23:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2019-07-05 20:14:16 +01:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
net: tap_open(): set sk_uid from current_fsuid()
Commit 66b2c338adce initializes the "sk_uid" field in the protocol socket
(struct sock) from the "/dev/tapX" device node's owner UID. Per original
commit 86741ec25462 ("net: core: Add a UID field to struct sock.",
2016-11-04), that's wrong: the idea is to cache the UID of the userspace
process that creates the socket. Commit 86741ec25462 mentions socket() and
accept(); with "tap", the action that creates the socket is
open("/dev/tapX").
Therefore the device node's owner UID is irrelevant. In most cases,
"/dev/tapX" will be owned by root, so in practice, commit 66b2c338adce has
no observable effect:
- before, "sk_uid" would be zero, due to undefined behavior
(CVE-2023-1076),
- after, "sk_uid" would be zero, due to "/dev/tapX" being owned by root.
What matters is the (fs)UID of the process performing the open(), so cache
that in "sk_uid".
Cc: Eric Dumazet <edumazet@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Pietro Borrello <borrello@diag.uniroma1.it>
Cc: netdev@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: 66b2c338adce ("tap: tap_open(): correctly initialize socket uid")
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2173435
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-07-31 18:42:37 +02:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2010-04-29 13:50:48 +03:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2011-10-20 04:26:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2011-10-20 04:26:39 +00:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-10-25 00:23:04 -07:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2017-10-25 00:23:04 -07:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2023-03-07 21:18:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-25 00:23:04 -07:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2014-09-22 16:34:17 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-03 06:39:46 -04:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-05 20:14:16 +01:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2015-11-29 20:03:10 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-01 20:52:54 +00:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2023-08-01 20:52:54 +00:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-27 18:35:35 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2015-02-27 18:35:35 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2018-09-12 11:17:06 +08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2014-06-19 15:36:49 -04:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
2025-02-07 15:10:56 +09:00
|
|
|
|
2012-05-02 11:42:15 +08:00
|
|
|
|
2015-07-23 16:37:43 +02:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2013-07-10 13:43:28 +08:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2017-02-03 18:20:49 -05:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2025-02-07 15:10:56 +09:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2018-09-12 11:17:06 +08:00
|
|
|
|
2014-06-19 15:36:49 -04:00
|
|
|
|
|
|
|
|
|
2025-02-07 15:10:56 +09:00
|
|
|
|
2013-07-10 13:43:28 +08:00
|
|
|
|
2014-06-19 15:36:49 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-18 10:55:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2025-02-07 15:10:56 +09:00
|
|
|
|
2013-07-10 13:43:28 +08:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2012-05-02 11:42:06 +08:00
|
|
|
|
2014-06-19 15:36:49 -04:00
|
|
|
|
2016-11-30 13:17:52 +08:00
|
|
|
|
2014-06-19 15:36:49 -04:00
|
|
|
|
2013-07-18 10:55:16 +08:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-03 02:27:59 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2022-08-03 02:27:59 -04:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
net: Don't set transport offset to invalid value
If the socket was created with socket(AF_PACKET, SOCK_RAW, 0),
skb->protocol will be unset, __skb_flow_dissect() will fail, and
skb_probe_transport_header() will fall back to the offset_hint, making
the resulting skb_transport_offset incorrect.
If, however, there is no transport header in the packet,
transport_header shouldn't be set to an arbitrary value.
Fix it by leaving the transport offset unset if it couldn't be found, to
be explicit rather than to fill it with some wrong value. It changes the
behavior, but if some code relied on the old behavior, it would be
broken anyway, as the old one is incorrect.
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-21 12:39:57 +00:00
|
|
|
|
2013-03-25 20:19:55 +00:00
|
|
|
|
2015-07-23 16:37:43 +02:00
|
|
|
|
2021-01-14 18:32:38 -08:00
|
|
|
|
2023-05-09 13:18:57 +00:00
|
|
|
|
2015-07-23 16:37:43 +02:00
|
|
|
|
|
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2012-05-02 11:42:06 +08:00
|
|
|
|
2021-01-06 14:18:40 -08:00
|
|
|
|
2018-09-12 11:17:06 +08:00
|
|
|
|
|
|
|
|
|
2024-04-19 12:08:39 +01:00
|
|
|
|
2012-05-02 11:42:06 +08:00
|
|
|
|
2016-11-30 13:17:52 +08:00
|
|
|
|
2022-08-03 02:27:59 -04:00
|
|
|
|
2013-06-25 16:04:20 -04:00
|
|
|
|
2011-07-06 12:26:11 +00:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2022-03-04 06:55:05 -08:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2013-06-25 16:04:20 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:20 -04:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2023-03-07 21:18:21 -07:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2023-03-07 21:18:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
2014-11-07 21:22:25 +08:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-06 11:23:01 -04:00
|
|
|
|
2017-02-03 18:20:49 -05:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
2014-11-07 21:22:25 +08:00
|
|
|
|
2013-12-11 13:08:34 +08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2015-01-13 17:13:44 +01:00
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-16 13:36:34 +08:00
|
|
|
|
2015-01-13 17:13:44 +01:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
2013-12-11 13:08:34 +08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2014-11-07 21:22:25 +08:00
|
|
|
|
|
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
|
|
|
|
|
2014-11-07 21:22:25 +08:00
|
|
|
|
|
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-07 21:22:25 +08:00
|
|
|
|
|
|
|
|
|
2012-05-03 22:55:24 +00:00
|
|
|
|
|
|
|
|
|
2013-12-11 13:08:34 +08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2017-05-17 12:14:44 +08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2012-06-06 22:36:27 +00:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-12-01 05:10:38 -05:00
|
|
|
|
2018-09-20 17:37:41 +08:00
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
2017-12-01 05:10:38 -05:00
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
2017-05-17 12:14:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
2013-06-05 23:54:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-09 09:14:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-17 12:14:44 +08:00
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2014-12-01 16:53:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2014-11-07 14:13:53 -05:00
|
|
|
|
2023-03-07 21:18:21 -07:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2023-03-07 21:18:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-11 13:08:34 +08:00
|
|
|
|
2013-12-06 14:16:50 +08:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:36 +00:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-05 23:54:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:36 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:36 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-13 14:23:36 +08:00
|
|
|
|
|
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-07 13:35:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-08-07 15:09:14 +08:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-08-07 15:09:14 +08:00
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2026-05-20 00:57:38 -07:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2014-12-16 15:04:56 +02:00
|
|
|
|
2010-04-29 13:50:48 +03:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:48:17 +00:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
|
|
|
|
|
2014-12-16 15:04:56 +02:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2014-12-16 15:04:56 +02:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2010-02-18 05:45:36 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2013-06-25 16:04:19 -04:00
|
|
|
|
2013-07-16 13:36:33 +08:00
|
|
|
|
2013-06-05 23:54:39 +00:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-18 13:41:09 +03:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-10-30 18:50:11 -04:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2015-09-18 13:41:09 +03:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-07 13:35:55 +02:00
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:04:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-17 10:23:28 -07:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2025-05-21 13:46:16 -07:00
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-21 13:46:16 -07:00
|
|
|
|
2015-05-13 19:19:02 +01:00
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
|
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-21 13:46:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2015-05-11 20:00:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-12 22:52:31 +01:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-11 17:23:00 +02:00
|
|
|
|
2010-01-30 12:24:26 +00:00
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
2025-07-01 09:03:51 +08:00
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-24 10:04:51 -07:00
|
|
|
|
2026-05-21 09:32:31 -07:00
|
|
|
|
2024-07-24 10:04:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-21 09:32:31 -07:00
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-08-02 15:46:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
2025-02-07 15:10:57 +09:00
|
|
|
|
2026-08-02 15:46:12 -07:00
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
2026-08-02 15:46:12 -07:00
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
net: tap: fix wrong transport_header when sending VLAN-tagged frame
In tap_get_user_xdp(), when processing a VLAN-tagged frame (e.g.
ETH_P_8021Q), skb_set_network_header() is called first to advance
network_header past the VLAN tag to the inner protocol header.
skb_probe_transport_header() is then called with skb->protocol still
set to ETH_P_8021Q, while nhoff (derived from skb_network_offset())
already points past the VLAN tag to the inner protocol header.
In __skb_flow_dissect(), proto is initialized to ETH_P_8021Q and nhoff
points past the VLAN tag. When the dissector hits case ETH_P_8021Q, it
reads a struct vlan_hdr at the current nhoff via __skb_header_pointer(),
but that offset contains the inner protocol header (e.g. an IP header).
The bytes are misinterpreted as a VLAN header, yielding a garbage
encapsulated EtherType that matches no known protocol. The dissector
returns false, so skb_probe_transport_header() never calls
skb_set_transport_header(), leaving transport_header at its uninitialized
sentinel value (~0U).
Move skb_set_network_header() to after skb_probe_transport_header(). At
the time skb_probe_transport_header() is called, network_header still
points to the VLAN header (offset ETH_HLEN), so nhoff is correct and the
flow dissector can parse the VLAN header, extract the inner EtherType,
and advance nhoff to the inner protocol header, allowing transport_header
to be set correctly.
Fixes: 8c76e77f9069 ("tap: call skb_probe_transport_header after setting skb->dev")
Assisted-by: WChat:claude-opus-4-8
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260807063405.688780-3-wei.fang@oss.nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-08-07 14:34:05 +08:00
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
2021-01-14 18:32:38 -08:00
|
|
|
|
2023-05-09 13:18:57 +00:00
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
2026-08-02 15:46:12 -07:00
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-27 10:40:39 +01:00
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2018-09-12 11:17:06 +08:00
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:06 +08:00
|
|
|
|
2022-03-03 10:24:40 +08:00
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-12 11:17:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2017-12-01 05:10:38 -05:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-12-01 05:10:38 -05:00
|
|
|
|
2018-09-20 17:37:41 +08:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-12-01 05:10:38 -05:00
|
|
|
|
|
|
|
|
|
2013-12-10 22:06:18 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
|
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2010-02-18 05:46:50 +00:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2017-05-17 12:14:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2017-05-17 12:14:42 +08:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2017-05-17 12:14:42 +08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2017-02-10 16:03:47 -08:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:49 -08:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2024-12-17 13:51:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
2018-01-04 11:14:27 +08:00
|
|
|
|
2016-07-15 03:46:31 -04:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-10 10:05:50 -07:00
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-27 00:00:16 -07:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-27 00:00:16 -07:00
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 16:03:48 -08:00
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
|
|
|
|
|
2023-10-27 14:13:11 -07:00
|
|
|
|
2017-02-10 16:03:51 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-17 10:23:28 -07:00
|
|
|
|