Difference between revisions of "SoC/Ideas"

(Convert more of the Samba 4 IDL to be used in Samba 3)
(Print System Asynchronous Remote Protocol Wireshark Dissectors)
 
(199 intermediate revisions by 22 users not shown)
Line 1: Line 1:
=Google Summer of Code: Suggested Project ideas=
+
= Google Summer of Code: Suggested Project ideas =
  
==Samba 3==
+
The following are the Samba project ideas for Summer of Code.
 +
Of course you are free to come up with ideas not listed here.
 +
Please discuss the your planned project by either joining us on irc://irc.freenode.net/#samba-technical or
 +
by sending email to [https://lists.samba.org/mailman/listinfo/samba-technical samba-technical@lists.samba.org]
  
===SACL VFS Module ===
+
==Samba==
  
Support for file systems SACLs (i.e. file system auditing) on in Samba in a VFS module by utilizing Extended Attributes. This project should ensure that users are able to successfully view and modify auditing settings on files and directories using the Windows Explorer.
+
Some additional possible GSoC topics can be found in Bugzilla in the form of bugs which are marked as "Feature request": [https://bugzilla.samba.org/buglist.cgi?query_format=advanced&short_desc=Feature%20request&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&short_desc_type=allwordssubstr&product=Samba%204.0 here]. Questions regarding complexity and requirements should be directed to the technical mailing list.
  
===Consolidate internal LDAP SASL support ===
+
<!-- Commented out possibly stale proposals
  
Samba has two separate copies of LDAP support routines. One is used to access Active Directories servers when operating as a member server and the other is used for implementing the LDAP passdb backend feature. Applicants should be comfortable with LDAP directories services and SASL mechanisms such as GSS-SPNEGO.
+
===Browsing support in Samba 4===
 +
Samba 4 still needs support for mailslots in general and in particular for the BROWSE mailslot. Should come with tests. Documentation of the BROWSER protocol is available here:
 +
http://msdn.microsoft.com/en-us/library/cc201609(PROT.10).aspx
 +
http://ubiqx.org/cifs/Browsing.html
 +
 
 +
*Difficulty: Hard
 +
*Language(s): C
 +
*Possible mentors: Stefan Metzmacher
 +
 
 +
===Implement login / logout related counter update===
 +
For the moment the attributes related to login and logout are not
 +
updated by Samba4.
 +
The goal of this project is to understand in which case windows update
 +
the counters (ie. most probably during interactive logon but also maybe
 +
with some netlogon calls ?) and to implement counter and timestamp
 +
update is Samba code so that this information can be available.
 +
This project of course includes the development of unit tests.
 +
 
 +
*Difficulty: Easy
 +
*Language(s): C
 +
*Possible mentors: Andrew Bartlett
 +
 
 +
===Improve regedit===
 +
 +
Last year someone has started to write a ncurses based registry editor. The editor could be improved, like put some effort in a better look and feel and adding dcerpc winreg support to remotely connect to the registry.
 +
 
 +
See https://git.samba.org/?p=asn/samba.git;a=shortlog;h=refs/heads/regedit
 +
 
 +
* Difficulty: Medium
 +
* Language(s): C
 +
* Possible mentors: Andreas Schneider, Michael Adam
 +
 
 +
 
 +
===Utilize libsmbclient server-side copy support in file managers===
 +
 
 +
With libsmbclient now supporting server-side copy requests via [https://git.samba.org/?p=samba.git;a=commit;h=f73bcf4934be89f83e86459bc695b7d28348565c cli_splice()], file managers making use of libsmbclient can be changed to utilize server-side copy support for greatly improved remote copy performance. Potential file manager targets include [https://bugzilla.gnome.org/show_bug.cgi?id=771022 GNOME Files/Nautilus (gvfs_smb)], Dolphin (kio_smb) and Kodi's File Manager.
  
[mailto:jerry@samba.org Gerald Carter]
+
*Difficulty: Easy, Medium
 +
*Language(s): C, C++
 +
*Possible mentors: David Disseldorp
  
===Backport EndPointMapper and support for ncacn_ip_tcp===
 
  
Current Samba 3.0 releases only support MS-RPC over SMB named pipes. The SAMBA_4_0 code base has support RPC directory over TCP which could be back ported in some degree to the SAMBA_3_0 tree.  A pre-requisite task may be to backport the events framework first
+
===Windows Search Protocol WSP client library and torture tests===
  
Possible mentors: jelmer
+
The Windows Search Protocol WSP is used to implement remote full filesystem indexing (indexed search) between Windows machines. We would like to support this functionality in Samba, interfacing with existing indexing tools on Unix systems (such as GNOME Tracker).
  
===Alternative configuration backends===
+
This is a DCE/RPC protocol. See http://msdn.microsoft.com/en-us/library/cc251767.aspx .
  
The current smb.conf does not allow the flexible set read and modify individual key/value pairs from within smbd. This project would explore using a registry like backend that would allow more flexibility is managing Samba's configuration settings outside on a simple text editor. The LibElektra project provides a common configuration library with storage plugins. One possibility would be to implement an LDB backend along with a simple command line interpreter/editor.
+
The student should write a (un)marshalling library to push and pull PDUs and an asynchronous client library on top of the Samba raw smb client library.
  
The interaction between this and the registry shares in Samba3 should be carefully considered.
+
The student should write sub-tests for smbtorture which should demonstrate how the protocol works against a Windows server.
 +
The student doesn't have to implement the Samba server code.
 +
Noel Power from SUSE has done some basic server implementation, he should be able to give guidance
  
[mailto:jerry@samba.org Gerald Carter]
+
*Difficulty: Medium, Hard
 +
*Language(s): C, (Python)
 +
*Possible Mentors: Noel Power
  
===Full SAM implementation ===
+
-->
Provide a new database passdb backend that provides both the Unix and Win32 attributes without the use of external commands such as the "add user script".  This could be based around LDB (perhaps with the Samba4/AD layout), TDB, or some other database.
+
=== Print System Asynchronous Remote Protocol Wireshark Dissectors ===
  
Possible Mentors: idra or [mailto:jerry@samba.org Gerald Carter]
+
The Print System Asynchronous Remote Protocol ([https://msdn.microsoft.com/en-us/library/cc238080.aspx MS-PAR]) is a replacement for the synchronous Print System Remote Protocol (MS-RPRN). MS-PAR inherits many message and buffer formats from the old protocol, but allows for asynchronous submission and notification of print jobs. Further details of the protocol can be found in Günther and Andreas' [http://archive.sambaxp.org/fileadmin/user_upload/SambaXP2013-DATA/thu/track2/Guenther_Deschner_Andreas_Schneider-Printing_Samba_4.pdf SambaXP presentation].
  
===SNMP support===
+
The student should write Wireshark dissectors for MS-PAR.
Explore supporting the LANMAN SNMP MIB included with Windows server operating systems in smbd, nmbd, and winbindd.
+
The student should improve existing smbtorture tests, which demonstrate how the protocol works against a Windows server.
  
Possible mentors: [mailto:jerry@samba.org Gerald Carter]
+
*Difficulty: Medium
 +
*Language(s): C
 +
*Possible Mentors: Andreas Schneider (supported by Günther Deschner)
  
===Solve the overabundance of configuration parameters===
+
===dbwrap back-end for Ceph RADOS key-value storage===
(warning: long gloves required?)
 
  
Samba 3.0 includes many config options which are necessary only in extreme circumstances. Only a small percentage of the parameters are required in most installations. The challenge is to remove the more advanced settings from immediate misuse while still providing access to them when absolutely necessary.
+
Ceph offers a highly scalable and fault-tolerant storage system. Samba is already capable of sharing data located on the [https://ceph.com/ceph-storage/file-system/ Ceph Filesystem], however scale-out sharing (the same data exposed by multiple Samba nodes) currently requires the use of [https://ctdb.samba.org/ CTDB] for consistent and coherent state across Samba cluster nodes. In such a setup CTDB provides a clustered database with persistent key-value data storage and locking. Database usage is abstracted out via a generic ''dbwrap'' interface.<br>
  
===Convert more of the Samba 4 IDL to be used in Samba 3===
+
Ceph's librados library provides an API for the storage and retrieval of arbitrary key-value data via the ''omap'' functions. A watch/notify protocol is also provided as a mechanism for synchronising client state (locking). Key-value data stored in the RADOS back-end inherits the same redundancy features as regular objects, making it a potentially good candidate as a replacement for CTDB in scale-out Samba clusters.
3.0.26 will start using more autogenerated DCE/RPC pull/push functions. At the moment, winreg and wkssvc have been converted. The following interfaces still have to be converted (and would ideally also have the related tests from Samba 4 pass against them):
 
  
* srvsvc
+
This task involves the implementation and testing of a new ''dbwrap'' back-end that uses librados for the storage, retrieval and locking of Samba key-value state. Ideally, the candidate would also allow time for benchmarking.
* svcctl (already started)
 
* eventlog (only 1 call left)
 
* ntsvcs (already started)
 
* spoolss (not really feasible at this point, as samba4's idl is incomplete)
 
  
Possible mentors: jelmer
+
*Difficulty: Medium
 +
*Language(s): C
 +
*Possible Mentors: David Disseldorp
  
===Design and Implement a New Printer API for Better CUPS Integration===
 
  
The current internal printing API used to interact with a Unix printing systems (e.g. LPD or CUPS) mirrors the existing "print command" and other parameters from smb.conf.  These were originaly designed to work with LPD and SysV spoolers.  The CUPS library has a much richer interface for interacting with applications such as Samba.  The goal of this project would be to redesign the current print system support to expose these more advanced features in CUPS to Samba administrators and to provide a better user experience when deploying Samba as a print server in mixed Windows/Unix networks.
+
=== Samba binary size reduction ===
  
 +
Samba has grown to quite a bloated beast. This task will focus on some areas where the bloat can easily be reduced, e.g.
 +
* Removal of unused autogenerated librpc code
 +
** RPC client and server code when only serialization functions are used
 +
** optional struct print routines (pidl noprint?)
 +
** Some knowledge of perl would help here (for pidl)
 +
* Add new build options to compile Samba without certain functionality
 +
** Undesired DCE/RPC services
 +
** Printing support
 +
** Legacy SMB/CIFS support (stretch goal)
  
Possible mentors: [mailto:jerry@samba.org Gerald Carter]
 
  
==Samba 4==
+
*Difficulty: easy
 +
*Language(s): Some knowledge of C and python would be helpful
 +
*Possible Mentors: David Disseldorp (supported by Andrew Bartlett)
  
===FRS: File Replication Service===
+
=== Fuzz Samba using [http://lcamtuf.coredump.cx/afl/ American Fuzzy Lop] ===
The protocol used for the File Replication Service in Active Directory is not currently understood. 
 
  
This project would be to document this protocol, and implement a working client as part of our torture suite. An ambitious student could try and implement a server as well, but getting the client done would be enough of a challenge for a SOC project. This project would suit someone who is interested in delving into the intricacies of protocol analysis.  
+
Try to find bugs in the server or client components of Samba using [http://lcamtuf.coredump.cx/afl/ AFL]. This is not the usual AFL scenario where you can fuzz a file format parser. It needs to be a bit smart about it, as the way the SMB protocol works, you need to do a series of steps before reaching arbitrary SMB commands (protocol negotiation, session setup, tree connect, ...). Similarly some checks like packet signing should be worked around to reach the best results from AFL.
  
Possible mentors: tridge, Ronnie Sahlberg, metze
+
Samba code will need to be modified in hackish ways to make this work. I don't expect to be able to merge it back but if some of the modification required could be cleaned up and integrated in would be a bonus.
  
===Compression in the ndr layer===
+
* Difficulty: medium
The DRSUAPI DsGetNCChanges() call uses compression for replicating large chunks of objects.
+
* Language(s): Some knowledge of C
 +
* Possible Mentors: Aurélien Aptel
  
We already have the MSZIP decompression working in samba4 and know the student should
+
===Samba AD DC as the ideal POSIX Directory===
implement the MSZIP compression code used for the server code.
 
  
There's also another unknown compression algorithm "XPRESS" used in windows 2003.
+
Samba is a great Active Directory Domain Controller, but it is not an ideal directory server for a large, passionate and important user base:  Sites with Samba SMB servers, but also general purpose Linux servers.  A smaller subset of these sites also have Linux desktops. These sites may also have Windows servers, but they like the Windows desktops, are not the focus.  
The student should try to research how the XPRESS decompression works and if possible implement
 
it.
 
  
It is assumed that this algorithm is also used between Outlook and Exchange, so this would also
+
These sites often used Samba + OpenLDAP, and are finding the move to Samba's AD DC a bit difficult, because schema extension is hard, some things are not done automatically (like uidNumber allocation), and in general the focus has been around matching Windows not listening to the needs of this part of our user base.  
help the OpenChange team.
 
  
Possible mentors: metze
+
Specific research should be done into what FreeIPA does well in targeting this user segment, and what customisations advanced users of OpenLDAP apply.
  
===ci-skads decoding and implementation===
+
This project would be to propose a number of specific improvements, and to add both tests and an implementation of these improvements to Samba.
  
The ci-skads protocol is used to implement remote full filesystem
+
*Difficulty: Hard
indexing (indexed search) between windows machines. We would like to
+
*Languages(s): C, Python
support this functionality in Samba, interfacing with existing
+
*Possible Mentors: Andrew Bartlett
indexing tools on Unix systems (such as beagle). This would be a very
 
challenging project, suitable for someone experienced with analyzing
 
completely new protocols.
 
  
Possible mentors: tridge, Ronnie Sahlberg
 
  
===Samba4 Domain Member support===
+
===GitLab CI of Samba for non-linux platforms (FreeBSD in particular)===
Samba4 needs various bits of work, to become a useful domain member:
 
Students may wish to take on some or all of the tasks below
 
* Create a [[Samba3]] compatible IDMAP implementation in Samba4
 
* Implement user and group enumeration for nss_winbindd is Samba4
 
* Implement Kerberos handling in Samba4
 
* Research and improve other aspects of domain member support
 
  
Possible Mentors: abartlet, jelmer
+
Samba uses GitLab CI to improve the quality of our patches.  Efforts are currently underway to extend the docker container used from just Ubuntu 14.04 to later versions and other distributions.
  
===LDB ACLs===
+
However, we occasionally have issues ensuring Samba still builds and operates on FreeBSD and other non-linux platforms.
Currently, Samba4 uses a module known as 'kludge_acls' to perform some basic access control on Samba4's database.  This is highly inflexible, and needs to be replaced with real NT ACLs on the elements.
 
  
Possible Mentors: abartlet, tridge, idra.
+
The idea would be to have a docker image and .gitlab-ci.yml code to support it that runs FreeBSD and then builds and runs Samba's testsuite inside that FreeBSD nested VM, while still outputting the results to the normal gitlab-ci.
  
===CIFS POSIX extensions in Samba4===
+
This differs from just running GitLab CI runners on FreeBSD as we need auto-scale, destroy the host and guest at the end of the test and run on Linux docker (such as the free GitLab,com CI runners).  
Samba4 does not implement the CIFS POSIX extensions at this stage.
 
  
A testsuite needs to be written, to prove consistent behavior, and the Samba3 compatible server implemented.  
+
As a stretch goal, being able to run some tests against a specific linux kernel and a raw ext4 filesystem (rather than unionfs) via qemu rather than depending on the docker host configuraiton.
  
Possible mentors: tridge
+
*Difficulty: Medium
 +
*Language(s): Python, shell, YAML
 +
*Possible Mentors: Andrew Bartlett
  
===Implement a Berkeley DB backend for LDB===
+
===Integrate Samba AD DC deployment and management with Cockpit===
(less important now we have transactions in tdb?)
 
  
LDB currently supports both TDB and LDAP backend storage
+
A prototype at https://github.com/abbra/cockpit-app-samba-ad shows how we can integrate Samba AD deployment with Cockpit Linux management console. A goal of this task is to move forward with this prototype to produce a fully working Samba AD management tool for common operations supported by 'samba-tool' command line utility.
mechanisms. Another alternative backend possibility is the Berkeley DB
 
database.
 
  
Possible mentor: idra
+
*Difficulty: Medium
 +
*Language(s): Python, JavaScript (React), CSS, HTML
 +
*Possible Mentors: Alexander Bokovoy
  
===Dbench and Nbench workload generator based on Samba 4===
 
  
Samba 4 has two NTVFS backends (cifs and nbench) which allow to create a CIFS proxy which:
+
<!-- Commented out possibly stale proposals
  
# intercepts CIFS traffic and forwards that to a remote server, and
+
===Make libsmbclient thread-safe for Gnome VFS===
# write down a workload scenario file for Nbench and Dbench tools
 
  
For every connection there is one log file is written. These logs can
+
libsmbclient is currently not thread-safe, even when different threads use different libsmbclient contexts. This has a big impact on use by the Gnome VFS code. The easiest fix is to add a "Big Lock" around all elements of libsmbclient that are not currently thread safe. This is not fine-grained threading support, but would add mutexes to creating and any manipulation of contexts. Locks also need to be added around any calls into the parameter reading/writing subsystems, and many other places within libsmbclient. Success would be to report safe hellgrind usage on test code using multiple libsmbclient contexts to access common files from a single server/share.
later be replayed by nbench/dbench against any file system/server to
 
reproduce the same workload. Implementation of the following things
 
will allow to create a specialized workload generator to test various
 
usage scenarios based on real world applications:
 
  
# Add a functionality to post-process generated logs to create a combined dbench/nbench scenario representing multiple-client access pattern.
+
*Difficulty: Medium, Hard
# Add CIFS Posix Extensions support to both Nbench NTVFS backend and dbench/nbench tools so that Linux applications running against Linux CIFS file system could be profiled.
+
*Language(s): C
# Package resulting solution as simply-installable and configurable application similar to Samba4WINS package
+
*Possible mentors: Jeremy Allison
 +
-->
  
===Re-implement smbclient in ejs===
+
==Linux Kernel SMB Client Improvements==
  
Samba4 now has an embedded javascript interpreter, which is used for
+
The Linux Kernel has a module called cifs.ko which is independent from Samba (it doesn't share code) that allows users to mount remote shares. It supports multiple dialects of SMB (1, 2, 3). The protocol dialects are now officially documented by Microsoft (See [https://msdn.microsoft.com/en-us/library/cc246231.aspx MS-SMB], [https://msdn.microsoft.com/en-us/library/cc246482.aspx MS-SMB2]) so students shouldn't have to worry about reverse engineering to understand them. The [https://www.wireshark.org/ Wireshark] open source network sniffer&dissector is a very good learning tool as well.
both web configuration and for command line tools. The interpreter has
 
access to the extensive internal C library of Samba. We would like
 
smbclient to be rewritten in js, making it much more easily extendable
 
by administrators.
 
  
Possible mentors: tridge
 
  
===GQ replacement using GTK and LDB===
+
Interested students should contact Steve French or the [mailto:linux-cifs@vger.kernel.org linux-cifs mailing list] to discuss possible improvements to the Linux Kernel CIFS VFS client.
  
GQ is a widely used LDAP query tool. Many LDAP administrators would
+
=== Add machine-readable debug & stats /proc file ===
benefit if a similar tool were constructed, in particular with similar
+
* We currently output debug and statistic information under /proc/fs/cifs/ (DebugData, Stats, ...). We need to stop outputing free format text that breaks all parsers out there everytime we add things to it. Clean up the cifsdebug.c file (it is kind of messy). Possibly generate a hierarchy of /proc files (e.g. a dir per tcp connection, subdirs for session, files for tcons) instead of dumping everything in one file.
schema knowledge. Using LDB as a backend could allow easy use of
+
* Make a nice visualizer/dashboard thing to get an overview. This could be console or GUI or...
Samba-supported SASL mechanisms for easier authentication. Likewise,
+
* Language: C for the kernel stuff, Userspace can be C, C++, Python.
an LDB editor in SWAT would be very useful. Building it with
+
* Difficulty: Low
interactive functionality would make it a very powerful way to manage
 
Samba4's LDB databases.
 
  
Possible mentors: jelmer
+
=== Add additional ftrace (trace-cmd) tracepoints and better GUI ===
 +
* Add more dynamic tracepoints to cifs.ko for commonly needed user scenarios, and add GUI (and/or CLI) tool to make it easier to enable/disable cifs.ko dynamic trace points (See /sys/kernel/debug/tracing/events/cifs/ for the pseudo-files that are currently configured manually for tracing or via trace-cmd) Make a nice native/console/web UI for it.
 +
* Language: C (any kernel changes) and userspace C, C++ or Python
 +
* Difficulty: Low
  
===Browsing support in Samba 4===
+
=== Add performance analysis cli tools ===
Samba 4 still needs support for mailslots in general and in particular for the BROWSE mailslot. Should come with tests.
+
* Add more perf tools for SMB3 client (similar to iostat or nfsstat) that leverage (and possibly extend what is captured) in /proc/fs/cifs/Stats but make it easier to analyze performance of a cifs mount
 +
* Language: C, C++ or Python
 +
* Difficulty: Low
 +
 
 +
=== Write the One-True-Tool to unify probe/setup/configuration cifs.ko properly ===
 +
* There are too many knobs in different places at the moment: request-keys, idmap, cifscreds, /proc stuff. This goal of this project would be to write one CLI tool that would wrap everything under a common interface. It could handle getting/setting ACL as well.
 +
* This would be a userspace project.
 +
* The implementation shouldn't too hard but the student will need to learn about the existing configuration ways and usecases which can be long.
 +
* Language: C, C++, Python
 +
* Difficulty: Medium
  
Possible mentors: jelmer
+
=== Add support for DAC (Claims Based ACLs) to the smb3 kernel module and tools ===
 +
* Similar to what was done to extend the Apache access control model to allow richer ACL semantics,
 +
* SMB3's access control model was extended (at least in Windows).  See e.g. [https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/dynamic-access-control Dynamic Access Control].
 +
* Add support to the SMB3 kernel module and user space tools (or create new ones) to allow viewing and managing claims based ACLs (DAC) from the client.
 +
* Difficulty: Medium
 +
* Language: C (kernel), C/C++/Python (user space tools)
  
===Extension of the GTK+ frontends===
+
=== Add support for ODX (T10) Copy Offload to the smb3 kernel module ===
There are a couple of GTK+ frontends for Samba4 (see [[SambaGtk]]). These are very limited at the moment but you could work on expanding them and further integrating them with GNOME.
+
* Windows, and various NAS servers support ODX copy offload (e.g. [https://docs.netapp.com/ontap-9/index.jsp?topic=%2Fcom.netapp.doc.cdot-famg-cifs%2FGUID-1323806A-F37B-46AF-B123-E40FCD362B33.html NetApp]),
 +
* to allow much faster server side copy.
 +
* Add support to the kernel client for this and integration with existing or new copy offload tools to make it easy to use.
 +
* For more information see [https://msdn.microsoft.com/en-us/library/cc246482.aspx MS-SMB2] and [https://www.slideshare.net/gordonross/smb3-offload-data-transfer-odx SMB3 offload data transfer] and [https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/offloaded-data-transfers Offloaded data transfers] and references at bottom of [[Server-Side_Copy]].
 +
* Language: C
 +
* Difficulty: Medium/High
  
Possible mentors: jelmer
+
===VFS change notification support in cifs.ko ===
 +
* The kernel provides a file/dir notification API (inotify, dnotify). The SMB protocol also provides a way to get notified of file changes. This project would be about implementing the inotify API for cifs.ko by making use of the SMB notification mechanism.
 +
* Difficulty: Hard
 +
* Language: C
  
==Miscellaneous==
+
===Failover/Continuous Availability and HA improvements (Witness protocol)===
 +
* Benefits: Improved reliability, data integrity - may also allow planned migrations (moving data from one server to another). 
 +
* Challenges: Complexity, requires additional RPC infrastructure in client.  There is a Samba user space prototype of the Witness protocol that could be reused (since we only need the client part of the RPC calls).
 +
* Language: C
 +
* Difficulty: High
  
===Linux Kernel CIFS client improvements===
+
<!-- Commenting out stale proposals
Interested students should contact Steve French and discuss possible improvements to the Linux Kernel CIFS VFS client. Here are some ideas to get you started:
 
  
* improved async/vectored i/o support (improves performance)
+
===File Copy Offload: T10 operations, and improved tools for using CopyChunk===
* CIFS->Samba DFS extensions
+
* Benefits: Improved performance.  Copy offload is useful for quickly replicating large files, and for backup and for virtualization. Good news is that one copy offload mechanism (CopyChunk) already works.  Windows 2012 introduced a [https://msdn.microsoft.com/en-us/library/windows/desktop/hh848056(v=vs.85).aspx second mechanism] and also see pages 33 to 42 of [http://www.snia.org/sites/default/files/SNIA_SMB3_final.pdf SNIA SMB3]).  May be even more useful if TRIM/DISCARD support also added.  This is also very timely given the recent support in the linux kernel vfs being added for the copy_range API.
* prototype SMB2 client
+
* Challenges: Ensuring semantics match what is being used in the new copy_range Linux kernel interface, and if not either emulate the alternate semantics, enhance copy_range or provide additional private ioctls to handle the SMB3 copy offload semantics (CopyChunk vs. ODX)
* more generic uid mapping facility (when server supports Unix extensions but different uid space)
+
* Language: C
* finish up of POSIX->NT ACL mapping
+
* Difficulty: Low / moderate
* integration of cifs client with Dave Howell's fscache (for offline caching)
+
* Possible Mentors: Steve French
* cifs->Samba automated test facility (build verification)
 
  
Possible mentors: Steve French
+
===Multiadapter support===
 +
* Benefits: Big performance advantage for some common cases (e.g. RSS capable adapters, and also two adapter scenarios) and prepares for RDMA in the future which will help cifs.ko in even more workloads.
 +
* Challenges: Testing may require more physical hardware (two, dual adapter machines to demonstrate performance improvements).
 +
* Language: C
 +
* Difficulty: Moderate
 +
* Possible Mentors: Steve French
  
===Static and dynamic code analysis===
+
===Directory oplocks===
We regularly use tools such as the IBM Checker, and Valgrind to work over our codebase.
+
* Benefits: Will reduce network load a lot in some workloads, and improve performance as well. Works with recent Windows servers (Windows 2012 and later e.g.).
 +
* Challenges: Samba does not support it yet (although this might help drive changes to the Server and Linux VFS eventually, if we have client support).
 +
* Language: C
 +
* Difficulty: Moderate
 +
* Possible Mentors: Steve French
  
These produce many warnings, and in particular the IBM Checker has found many 'unfixed' issues in the code baseMany are false positives, but many are also very serious issuesStudents will need to work with the team and the upstream developers to resolve as many of these as possible. To see the current IBM Checker output look at the build farm output for the host 'snab' at http://build.samba.org/
+
=== Support for SELinux ===
 +
* Mac Security Label support is important for virtualization and useful for improved security some workloads.  Support for setting/getting these labels over the wire was investigated in the NFS version 4 workgroupAdding support to the CIFS Unix Extensions (Linux kernel client and Samba server) should be possible, especially if this is just a new class of extended attributeThe goal would be to support this feature of SELinux to allow KVM and other applications to take advantage of security labels. Some of the background requirements are loosely related to the (nfs equivalent of) what is mentioned in:  [http://tools.ietf.org/html/draft-quigley-nfsv4-sec-label-01 NFSv4]
 +
* Language: C
 +
* Difficulty: Hard
 +
* Possible Mentors: Steve French
  
Possible mentors: tridge
+
===Create GUI or command-line tools for displaying /proc/fs/cifs statistics and and mount/session status===
 +
* Might also involve some cleanup of the in-kernel stats / status output.
 +
* A mostly complete [http://oss.sgi.com/archives/pcp/2013-08/msg00090.html cifs.ko Performance Co-Pilot (PCP) monitoring agent] was implemented in 2013.
 +
* Language: some C (for kernel code), something else for GUI?
 +
* Difficulty: Easy
 +
* Possible Mentors: Steve French
  
===Windows GUI Testing===
+
===Create a common uid mapping mechanism for Linux nfs and cifs vfs clients===
With GUI automation tools, test the behaviour of windows applications against [[Samba3]] and [[Samba4]].  This needs to be integrated into the existing Windows testing code.
+
* or maybe just figure out a way to hook cifs up to rpc.idmapd
 +
* add a way for the client to remap the uids returned by the server to uids which would be valid on the client (or to a default if such uid does not exist).
 +
* This is helpful especially when the server supports the CIFS Unix Extensions and has different uids and gids mapping than the client
 +
* Difficulty: Hard
 +
* Possible Mentors: Steve French
  
Last year we had a very successful summer of code project which added automated windows testing to Samba. This tested only command line tools. We would like to expand this to include testing of GUI applications.
+
===Support for retrieving snapshots, encrypted files, or compressed files from Windows===
 +
* Difficulty: Medium
 +
* Possible Mentors: Steve French
  
Possible mentors: tridge
+
===cifs->Samba automated test facility===
 +
* Do build verification similar to what we can now do with the Samba server and tools in the Samba build farm.  Mounts from the Linux SMB3, SMB2 and CIFS kernel clients could be tested with posix file i/o tests which might include modified versions of the "connectathon" and xfstest test suites and others.  The goal is to quickly identify problems with newly integrated patches by running automatically against a variety of cifs/smb2/smb3 mounts (and mount options) to ensure that regressions aren't introduced.
 +
* xfstests support for CIFS was added as part of [[SoC/2014]].
 +
* Difficulty: Medium
 +
* Possible Mentors: Steve French
  
===Packaging ldb/tdb/talloc===
+
===Other Random Ideas===
Samba includes a number of very useful general purpose libraries, in particular talloc, tdb and ldb. We would love to see these libraries packaged properly, so this project would suit someone who likes working with building good packages and pushing them into distros.
+
* Ideas aren't limited to these, feel free to propose something else:
 +
** Improve integration between cifs.ko and userspace Samba tools and libraries.  Allow userspace Samba libraries to use an existing CIFS mount if it exists by passing requests (via an ioctl or other user->kernel IPC) to cifs.ko.  This could improve performance but also more naturally allow use of the same credentials for a user across file and management operations (e.g. listing shares via smbclient and mounting that share).
 +
** Create a GUI for creating and managing Linux cifs mounts, and more easily configuring the many complex cifs mount options, statistics (/proc/fs/cifs)
 +
** Support for alternate transport protocols (other than TCP sockets).  Adding support for SCTP to cifs/smb2 kernel clients and Samba server or perhaps more interesting add support for Linux's "virtio" transport to the cifs/smb2 kernel clients and Samba server (to allow optimized mounts and zero-copy transfer of data from virtualized guests to hosts on the same box)
 +
** Support for features (such as directory delegations) which NFS version 4.1 has but which current CIFS even with the most current CIFS->Samba protocol extensions (CIFS Unix Extensions) do not have -- will probably need server support too.
 +
** Add additional library support or modify Samba client libraries so they can use existing kernel cifs functions (such as sending SMBs on negotiated sessions when the kernel client already has a session to the server).  With the addition of library to access cifs's pipe (in kernel), Samba client libraries or other dce/rpc code could use cifs kernel sessions for management of and over cifs mounts.
 +
** Add libraries and utilities to manage acls (cifs kernel client has an extended attribute for setting/getting "raw" cifs acls but userspace posix acl tools obviously can't be used to manage cifs specific acl features).
 +
*Difficulty: Low
 +
*Language(s): C
 +
*Possible mentors: Steve French
  
Possible mentors: tridge, jelmer, tpot
+
==Build Farm==
  
===multi-smbd testing===
+
The [[http://build.samba.org/ Build Farm]] is a set of machines with different configuration that regularly rebuild the latest snapshots of Samba and other projects on different platforms, to catch portability issues. It has a web interface and sends out emails.
The current test infrastructure in Samba3 and Samba4 only starts one copy of smbd.  
 
  
Many aspects of Samba cannot be properly tested with just a single smbd. For example, we would like to test NBT browse membership, WINS interactions and domain member support. To make this happen requires some significant changes to our test infrastructure, and perhaps extensions to out socket wrapper virtual network testing code.
+
===Improve Build Farm look and Feel===
 +
Samba's [http://build.samba.org build farm] still hasn't adopt the new Samba graphical chart and the look and feel is not very good.
 +
With this submission we propose to address this with the following objectives:
  
===Wireshark PIDL expansion===
+
*Main ideas:
Wireshark (nee Ethereal) uses PIDL to generate dissectors. However to create the best output, our IDL needs annotation and correction.
+
** Adopt the new samba style
 +
** Improve reporting (ie. present which are the build that can't be built and which are not, daily emails, ...)
 +
** Make test errors quickly accessible, in this [http://build.samba.org/build.cgi/build/d72e624c4a62a62e8d34b0c54efc2a97c0493aa9 example], user has to scroll a long time before meeting the errors
 +
** Add the capacity to manage flaky tests, reduce emails alerts (ie. need 2 consecutive builds with the same flacky test to trigger a real error)
 +
** Improve page loading speed (ajax ?)
 +
*Difficulty: Easy to Medium
 +
*Language(s): HTML, CSS, Python
 +
*Possible mentors: Matthieu Patou
 +
-->
  
We also need to do the work to decode more RPC pipes with PIDL, rather than with the hand-written decoder. The problem is, the hand-written code currently produces nicer, and more user friendly output.  This project will involve adding IDL extensions to support the necessary annotation inside the IDL file, and modifications to the pidl IDL compiler to produce wireshark modules from IDL which take advantage of these extensions.
+
== Wireshark ==
 +
Wireshark has 2 SMB dissectors: "smb" for SMB1, "smb2" for SMB2 and above. It also has a DCE/RPC ([https://en.wikipedia.org/wiki/Microsoft_RPC MSRPC]) dissector that is generated from Samba IDL files.
  
Possible mentors: tpot, Ronnie Sahlberg, jelmer
+
=== Improve smbcmp, the capture diff tool ===
 +
* [https://github.com/aaptel/smbcmp smbcmp] is a simple CLI tool that uses Wireshark CLI version (tshark) to dump and diff traces. It currently uses the plain text output format of tshark but tshark also has a proper XML output. The goal of this project would be to use or combine current tshark output with the XML output to do better and deeper diffs (ignoring indentation differences, adding ways to let users add ignore rules, etc).
 +
* Make smbcmp highlight diffs from the packet summary listing (currently it only diffs the "detail packet" output).
 +
* These are just ideas, students are free to propose and work on their own ideas.
 +
* Language: Python (a rewrite in something else is OK too)
 +
* Difficulty: Low
 +
* Possible Mentors: Aurélien Aptel

Latest revision as of 09:10, 15 March 2019

Google Summer of Code: Suggested Project ideas

The following are the Samba project ideas for Summer of Code. Of course you are free to come up with ideas not listed here. Please discuss the your planned project by either joining us on irc://irc.freenode.net/#samba-technical or by sending email to samba-technical@lists.samba.org

Samba

Some additional possible GSoC topics can be found in Bugzilla in the form of bugs which are marked as "Feature request": here. Questions regarding complexity and requirements should be directed to the technical mailing list.

Print System Asynchronous Remote Protocol Wireshark Dissectors

The Print System Asynchronous Remote Protocol (MS-PAR) is a replacement for the synchronous Print System Remote Protocol (MS-RPRN). MS-PAR inherits many message and buffer formats from the old protocol, but allows for asynchronous submission and notification of print jobs. Further details of the protocol can be found in Günther and Andreas' SambaXP presentation.

The student should write Wireshark dissectors for MS-PAR. The student should improve existing smbtorture tests, which demonstrate how the protocol works against a Windows server.

  • Difficulty: Medium
  • Language(s): C
  • Possible Mentors: Andreas Schneider (supported by Günther Deschner)

dbwrap back-end for Ceph RADOS key-value storage

Ceph offers a highly scalable and fault-tolerant storage system. Samba is already capable of sharing data located on the Ceph Filesystem, however scale-out sharing (the same data exposed by multiple Samba nodes) currently requires the use of CTDB for consistent and coherent state across Samba cluster nodes. In such a setup CTDB provides a clustered database with persistent key-value data storage and locking. Database usage is abstracted out via a generic dbwrap interface.

Ceph's librados library provides an API for the storage and retrieval of arbitrary key-value data via the omap functions. A watch/notify protocol is also provided as a mechanism for synchronising client state (locking). Key-value data stored in the RADOS back-end inherits the same redundancy features as regular objects, making it a potentially good candidate as a replacement for CTDB in scale-out Samba clusters.

This task involves the implementation and testing of a new dbwrap back-end that uses librados for the storage, retrieval and locking of Samba key-value state. Ideally, the candidate would also allow time for benchmarking.

  • Difficulty: Medium
  • Language(s): C
  • Possible Mentors: David Disseldorp


Samba binary size reduction

Samba has grown to quite a bloated beast. This task will focus on some areas where the bloat can easily be reduced, e.g.

  • Removal of unused autogenerated librpc code
    • RPC client and server code when only serialization functions are used
    • optional struct print routines (pidl noprint?)
    • Some knowledge of perl would help here (for pidl)
  • Add new build options to compile Samba without certain functionality
    • Undesired DCE/RPC services
    • Printing support
    • Legacy SMB/CIFS support (stretch goal)


  • Difficulty: easy
  • Language(s): Some knowledge of C and python would be helpful
  • Possible Mentors: David Disseldorp (supported by Andrew Bartlett)

Fuzz Samba using American Fuzzy Lop

Try to find bugs in the server or client components of Samba using AFL. This is not the usual AFL scenario where you can fuzz a file format parser. It needs to be a bit smart about it, as the way the SMB protocol works, you need to do a series of steps before reaching arbitrary SMB commands (protocol negotiation, session setup, tree connect, ...). Similarly some checks like packet signing should be worked around to reach the best results from AFL.

Samba code will need to be modified in hackish ways to make this work. I don't expect to be able to merge it back but if some of the modification required could be cleaned up and integrated in would be a bonus.

  • Difficulty: medium
  • Language(s): Some knowledge of C
  • Possible Mentors: Aurélien Aptel

Samba AD DC as the ideal POSIX Directory

Samba is a great Active Directory Domain Controller, but it is not an ideal directory server for a large, passionate and important user base: Sites with Samba SMB servers, but also general purpose Linux servers. A smaller subset of these sites also have Linux desktops. These sites may also have Windows servers, but they like the Windows desktops, are not the focus.

These sites often used Samba + OpenLDAP, and are finding the move to Samba's AD DC a bit difficult, because schema extension is hard, some things are not done automatically (like uidNumber allocation), and in general the focus has been around matching Windows not listening to the needs of this part of our user base.

Specific research should be done into what FreeIPA does well in targeting this user segment, and what customisations advanced users of OpenLDAP apply.

This project would be to propose a number of specific improvements, and to add both tests and an implementation of these improvements to Samba.

  • Difficulty: Hard
  • Languages(s): C, Python
  • Possible Mentors: Andrew Bartlett


GitLab CI of Samba for non-linux platforms (FreeBSD in particular)

Samba uses GitLab CI to improve the quality of our patches. Efforts are currently underway to extend the docker container used from just Ubuntu 14.04 to later versions and other distributions.

However, we occasionally have issues ensuring Samba still builds and operates on FreeBSD and other non-linux platforms.

The idea would be to have a docker image and .gitlab-ci.yml code to support it that runs FreeBSD and then builds and runs Samba's testsuite inside that FreeBSD nested VM, while still outputting the results to the normal gitlab-ci.

This differs from just running GitLab CI runners on FreeBSD as we need auto-scale, destroy the host and guest at the end of the test and run on Linux docker (such as the free GitLab,com CI runners).

As a stretch goal, being able to run some tests against a specific linux kernel and a raw ext4 filesystem (rather than unionfs) via qemu rather than depending on the docker host configuraiton.

  • Difficulty: Medium
  • Language(s): Python, shell, YAML
  • Possible Mentors: Andrew Bartlett

Integrate Samba AD DC deployment and management with Cockpit

A prototype at https://github.com/abbra/cockpit-app-samba-ad shows how we can integrate Samba AD deployment with Cockpit Linux management console. A goal of this task is to move forward with this prototype to produce a fully working Samba AD management tool for common operations supported by 'samba-tool' command line utility.

  • Difficulty: Medium
  • Language(s): Python, JavaScript (React), CSS, HTML
  • Possible Mentors: Alexander Bokovoy


Linux Kernel SMB Client Improvements

The Linux Kernel has a module called cifs.ko which is independent from Samba (it doesn't share code) that allows users to mount remote shares. It supports multiple dialects of SMB (1, 2, 3). The protocol dialects are now officially documented by Microsoft (See MS-SMB, MS-SMB2) so students shouldn't have to worry about reverse engineering to understand them. The Wireshark open source network sniffer&dissector is a very good learning tool as well.


Interested students should contact Steve French or the linux-cifs mailing list to discuss possible improvements to the Linux Kernel CIFS VFS client.

Add machine-readable debug & stats /proc file

  • We currently output debug and statistic information under /proc/fs/cifs/ (DebugData, Stats, ...). We need to stop outputing free format text that breaks all parsers out there everytime we add things to it. Clean up the cifsdebug.c file (it is kind of messy). Possibly generate a hierarchy of /proc files (e.g. a dir per tcp connection, subdirs for session, files for tcons) instead of dumping everything in one file.
  • Make a nice visualizer/dashboard thing to get an overview. This could be console or GUI or...
  • Language: C for the kernel stuff, Userspace can be C, C++, Python.
  • Difficulty: Low

Add additional ftrace (trace-cmd) tracepoints and better GUI

  • Add more dynamic tracepoints to cifs.ko for commonly needed user scenarios, and add GUI (and/or CLI) tool to make it easier to enable/disable cifs.ko dynamic trace points (See /sys/kernel/debug/tracing/events/cifs/ for the pseudo-files that are currently configured manually for tracing or via trace-cmd) Make a nice native/console/web UI for it.
  • Language: C (any kernel changes) and userspace C, C++ or Python
  • Difficulty: Low

Add performance analysis cli tools

  • Add more perf tools for SMB3 client (similar to iostat or nfsstat) that leverage (and possibly extend what is captured) in /proc/fs/cifs/Stats but make it easier to analyze performance of a cifs mount
  • Language: C, C++ or Python
  • Difficulty: Low

Write the One-True-Tool to unify probe/setup/configuration cifs.ko properly

  • There are too many knobs in different places at the moment: request-keys, idmap, cifscreds, /proc stuff. This goal of this project would be to write one CLI tool that would wrap everything under a common interface. It could handle getting/setting ACL as well.
  • This would be a userspace project.
  • The implementation shouldn't too hard but the student will need to learn about the existing configuration ways and usecases which can be long.
  • Language: C, C++, Python
  • Difficulty: Medium

Add support for DAC (Claims Based ACLs) to the smb3 kernel module and tools

  • Similar to what was done to extend the Apache access control model to allow richer ACL semantics,
  • SMB3's access control model was extended (at least in Windows). See e.g. Dynamic Access Control.
  • Add support to the SMB3 kernel module and user space tools (or create new ones) to allow viewing and managing claims based ACLs (DAC) from the client.
  • Difficulty: Medium
  • Language: C (kernel), C/C++/Python (user space tools)

Add support for ODX (T10) Copy Offload to the smb3 kernel module

  • Windows, and various NAS servers support ODX copy offload (e.g. NetApp),
  • to allow much faster server side copy.
  • Add support to the kernel client for this and integration with existing or new copy offload tools to make it easy to use.
  • For more information see MS-SMB2 and SMB3 offload data transfer and Offloaded data transfers and references at bottom of Server-Side_Copy.
  • Language: C
  • Difficulty: Medium/High

VFS change notification support in cifs.ko

  • The kernel provides a file/dir notification API (inotify, dnotify). The SMB protocol also provides a way to get notified of file changes. This project would be about implementing the inotify API for cifs.ko by making use of the SMB notification mechanism.
  • Difficulty: Hard
  • Language: C

Failover/Continuous Availability and HA improvements (Witness protocol)

  • Benefits: Improved reliability, data integrity - may also allow planned migrations (moving data from one server to another).
  • Challenges: Complexity, requires additional RPC infrastructure in client. There is a Samba user space prototype of the Witness protocol that could be reused (since we only need the client part of the RPC calls).
  • Language: C
  • Difficulty: High


Wireshark

Wireshark has 2 SMB dissectors: "smb" for SMB1, "smb2" for SMB2 and above. It also has a DCE/RPC (MSRPC) dissector that is generated from Samba IDL files.

Improve smbcmp, the capture diff tool

  • smbcmp is a simple CLI tool that uses Wireshark CLI version (tshark) to dump and diff traces. It currently uses the plain text output format of tshark but tshark also has a proper XML output. The goal of this project would be to use or combine current tshark output with the XML output to do better and deeper diffs (ignoring indentation differences, adding ways to let users add ignore rules, etc).
  • Make smbcmp highlight diffs from the packet summary listing (currently it only diffs the "detail packet" output).
  • These are just ideas, students are free to propose and work on their own ideas.
  • Language: Python (a rewrite in something else is OK too)
  • Difficulty: Low
  • Possible Mentors: Aurélien Aptel