10 Oct, 2016

1 commit

  • Move blackfin gptimers-example to samples and remove it from Documentation
    Makefile. Update samples Kconfig and Makefile to build gptimers-example.

    blackfin is the last CONFIG_BUILD_DOCSRC target in Documentation/Makefile.
    Hence this patch also includes changes to remove CONFIG_BUILD_DOCSRC from
    Makefile and lib/Kconfig.debug and updates VIDEO_PCI_SKELETON dependency
    on BUILD_DOCSRC.

    Documentation/Makefile is not deleted to avoid braking make htmldocs and
    make distclean.

    Acked-by: Michal Marek
    Acked-by: Jonathan Corbet
    Reviewed-by: Kees Cook
    Reported-by: Valentin Rothberg
    Reported-by: Paul Gortmaker
    Signed-off-by: Shuah Khan

    Shuah Khan
     

30 Jul, 2016

1 commit

  • Pull security subsystem updates from James Morris:
    "Highlights:

    - TPM core and driver updates/fixes
    - IPv6 security labeling (CALIPSO)
    - Lots of Apparmor fixes
    - Seccomp: remove 2-phase API, close hole where ptrace can change
    syscall #"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (156 commits)
    apparmor: fix SECURITY_APPARMOR_HASH_DEFAULT parameter handling
    tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family)
    tpm: Factor out common startup code
    tpm: use devm_add_action_or_reset
    tpm2_i2c_nuvoton: add irq validity check
    tpm: read burstcount from TPM_STS in one 32-bit transaction
    tpm: fix byte-order for the value read by tpm2_get_tpm_pt
    tpm_tis_core: convert max timeouts from msec to jiffies
    apparmor: fix arg_size computation for when setprocattr is null terminated
    apparmor: fix oops, validate buffer size in apparmor_setprocattr()
    apparmor: do not expose kernel stack
    apparmor: fix module parameters can be changed after policy is locked
    apparmor: fix oops in profile_unpack() when policy_db is not present
    apparmor: don't check for vmalloc_addr if kvzalloc() failed
    apparmor: add missing id bounds check on dfa verification
    apparmor: allow SYS_CAP_RESOURCE to be sufficient to prlimit another task
    apparmor: use list_next_entry instead of list_entry_next
    apparmor: fix refcount race when finding a child profile
    apparmor: fix ref count leak when profile sha1 hash is read
    apparmor: check that xindex is in trans_table bounds
    ...

    Linus Torvalds
     

08 Jul, 2016

1 commit

  • Add a separate Kconfig option for SAMPLES_SECCOMP.

    Main reason for this is that, just like other samples, it's forced to
    be a module.

    Without this, since the sample is a target only controlled by
    CONFIG_SECCOMP_FILTER, the samples will be built before include files are
    put in place properly. For example, from an arm64 allmodconfig built with
    "make -sk -j 32" (without specific target), the following happens:

    samples/seccomp/bpf-fancy.c:13:27: fatal error: linux/seccomp.h: No such file or directory
    samples/seccomp/bpf-helper.h:20:50: fatal error: linux/seccomp.h: No such file or directory
    samples/seccomp/dropper.c:20:27: fatal error: linux/seccomp.h: No such file or directory
    samples/seccomp/bpf-direct.c:21:27: fatal error: linux/seccomp.h: No such file or directory

    So, just stick to the same format as other samples.

    Signed-off-by: Olof Johansson
    Signed-off-by: Kees Cook

    Olof Johansson
     

20 Jun, 2016

1 commit

  • Add sample code to test trace_printk(). The trace_printk() functions should
    never be used in production code. This makes testing it a bit more
    difficult. Having a sample module that can test use cases of trace_printk()
    can help out.

    Currently it just tests trace_printk() where it will be converted into:

    trace_bputs()
    trace_puts()
    trace_bprintk()

    as well as staying as the normal _trace_printk().

    It also tests its use in interrupt context as that will test the auxilery
    buffers.

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

28 Apr, 2016

1 commit

  • A small bug with the new autoksyms support showed that there are
    two kernel modules in the Documentation directory that qualify
    as samples, while all other samples are in the samples/ directory.

    This patch was originally meant as a workaround for that bug, but
    it has now been solved in a different way. However, I still think
    it makes sense as a cleanup to consolidate all sample code in
    one place.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jonathan Corbet

    Arnd Bergmann
     

14 Oct, 2015

1 commit

  • Remove the old show_attribute and store_attribute methods and update
    the documentation. Also replace the two C samples with a single new
    one in the proper samples directory where people expect to find it.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

04 Feb, 2015

1 commit


22 Dec, 2014

1 commit


26 Jan, 2013

1 commit

  • The tracepoint sample code was used to teach developers how to
    create their own tracepoints. But now the trace_events have been
    added as a higher level that is used directly by developers today.

    Only the trace_event code should use the tracepoint interface
    directly and no new tracepoints should be added.

    Besides, the example had a race condition with the use of the
    ->d_name.name dentry field, as pointed out by Al Viro.

    Best just to remove the code so it wont be used by other developers.

    Link: http://lkml.kernel.org/r/20130123225523.GY4939@ZenIV.linux.org.uk

    Cc: Al Viro
    Acked-by: Mathieu Desnoyers
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

09 Feb, 2012

1 commit

  • Add an rpmsg driver sample, which demonstrates how to communicate with
    an AMP-configured remote processor over the rpmsg bus.

    Note how once probed, the driver can immediately start sending messages
    using the rpmsg_send() API, without having to worry about creating endpoints
    or allocating rpmsg addresses: all that work is done by the rpmsg bus,
    and the required information is already embedded in the rpmsg channel
    that the driver is probed with.

    In this sample, the driver simply sends a "Hello World!" message to the remote
    processor repeatedly.

    Designed with Brian Swetland .

    Signed-off-by: Ohad Ben-Cohen
    Cc: Brian Swetland
    Cc: Arnd Bergmann
    Cc: Grant Likely
    Cc: Tony Lindgren
    Cc: Russell King
    Cc: Rusty Russell
    Cc: Andrew Morton
    Cc: Greg KH
    Cc: Stephen Boyd

    Ohad Ben-Cohen
     

01 Nov, 2011

1 commit


23 May, 2011

1 commit


21 Apr, 2011

1 commit

  • samples/hid-example.o needs some Kconfig and Makefile additions in order
    to build. It should use headers from the build tree, so use
    HEADERS_CHECK to require that those header files be present.

    Change the kconfig symbol from tristate to bool since userspace cannot be
    built as loadable modules.

    However, I don't understand why the userspace header files are not present
    as reported in Andrew's build log, since it builds OK on x86_64 without
    any of these changes.

    Signed-off-by: Randy Dunlap
    Cc: Alan Ott
    Cc: Jiri Kosina
    Signed-off-by: Andrew Morton
    Signed-off-by: Jiri Kosina

    Randy Dunlap
     

31 Mar, 2011

1 commit


22 Mar, 2011

1 commit


30 Oct, 2010

1 commit


11 Aug, 2010

1 commit

  • Add four examples to the kernel sample directory.

    It shows how to handle:
    - a byte stream fifo
    - a integer type fifo
    - a dynamic record sized fifo
    - the fifo DMA functions

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Stefani Seibold
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     

08 Dec, 2009

1 commit


09 Nov, 2009

1 commit


18 Oct, 2009

1 commit


19 Sep, 2009

1 commit

  • Now that the last users of markers have migrated to the event
    tracer we can kill off the (now orphan) support code.

    Signed-off-by: Christoph Hellwig
    Acked-by: Mathieu Desnoyers
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Christoph Hellwig
     

17 Jun, 2009

1 commit

  • Conflicts:
    arch/x86/Kconfig
    arch/x86/kernel/traps.c
    arch/x86/power/cpu.c
    arch/x86/power/cpu_32.c
    kernel/Makefile

    Semantic conflict:
    arch/x86/kernel/hw_breakpoint.c

    Merge reason: Resolve the conflicts, move from put_cpu_no_sched() to
    put_cpu() in arch/x86/kernel/hw_breakpoint.c.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

16 Jun, 2009

1 commit


03 Jun, 2009

1 commit


06 May, 2009

1 commit

  • Normally a config should be default to n. This patch also makes the
    sample module-only, like SAMPLE_MARKERS and SAMPLE_TRACEPOINTS.

    [ Impact: don't build trace event sample by default ]

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    Acked-by: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     

15 Apr, 2009

1 commit


14 Oct, 2008

1 commit


05 Mar, 2008

1 commit

  • Move kprobes examples from Documentation/kprobes.txt to under samples/.
    Patch originally by Randy Dunlap.

    o Updated the patch to apply on 2.6.25-rc3
    o Modified examples code to build on multiple architectures. Currently,
    the kprobe and jprobe examples code works for x86 and powerpc
    o Cleaned up unneeded #includes
    o Cleaned up Kconfig per Sam Ravnborg's suggestions to fix build break
    on archs that don't have kretprobes
    o Implemented suggestions by Mathieu Desnoyers on CONFIG_KRETPROBES
    o Included Andrew Morton's cleanup based on x86-git
    o Modified kretprobe_example to act as a arch-agnostic module to
    determine routine execution times:
    Use 'modprobe kretprobe_example func=' to determine
    execution time of func_name in nanoseconds.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Ananth N Mavinakayanahalli
    Acked-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli
     

25 Jan, 2008

1 commit


20 Oct, 2007

2 commits

  • Module example showing how to use the Linux Kernel Markers.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Begin infrastructure for kernel code samples in the samples/ directory.
    Add its Kconfig and Kbuild files.
    Source its Kconfig file in all arch/ Kconfigs.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers