summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* protocol/client: unchecked return valueShwetha Acharya2018-11-201-1/+6
| | | | | | | | | | | | | | Problem: In client_process_response_v2, value returned from function client_post_common_dict is not checked for errors before being used. Solution: Added a check condition to resolve the issue. CID: 1390020 Change-Id: I4d297f33c8dd332ae5f6f21667a4871133b2b570 updates: bz#789278 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* snapview-server: close the gfapi handle present in a forgotten inodeRaghavendra Bhat2018-11-201-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the snapdaemon can reach the lru limit of the inode table and start sending forgets on the inodes that are least recently used. snapview-server maintains the mapping between the domain of the snapdaemon and the gfapi instance which it uses to access the snapshots via a handle that is stored in the inode context of snapdaemon's inode. The handle is glfs_h_object structure which itself points to the actual inode present in the gfapi world. But, when snapview-server receives forget on a inode, it deleted the inode context without actually closing the handle it had obtained to map the inode from snapdaemon to the inode in gfapi world. So, this change makes sure that, the handle is closed as part of the inode forget. And this closure of the handle will result in gfapi world receiving forget and unref on its corresponding inode. But care must be taken to ensure before the closure to ensure that the gfapi instance from which the handle came from, is still valid and not destroyed. Otherwise, sending a forget downward to the gfapi world might result in the access of freed pointers. Hence, the snapview-server xlator first checks whether that gfapi instance is still there or not and then proceeds with closure of the handle. Change-Id: Ia7bb45112d0c651cc95f2e54d33d925dbd6955b0 fixes: bz#1646728 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* core: Resolve memory leak at the time of graph initMohit Agrawal2018-11-201-4/+0
| | | | | | | | | | | Problem: Memory leak when graph init fails as during volfile exchange between brick and glusterd Solution: Fix the error code path in glusterfs_graph_init Change-Id: If62bee61283fccb7fd60abc6ea217cfac12358fa fixes: bz#1651431 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* core: Retrieving the value of "client.ssl" option, before SSL is set up, failsSheetal Pamecha2018-11-201-0/+2
| | | | | | | | Added a default value "off" for (client|server).ssl fixes: bz#1651059 Change-Id: I3d9c80093ac471d9d770fbd6c67f945491cf726e Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* core: fix strncpy, coverity annotationKaleb S. KEITHLEY2018-11-191-1/+6
| | | | | | | | | | | | For added fun, coverity is not smart enough to detect that the strncpy() is safe, and for extra laughs, using coverity annotations doesn't do anything either; but we're adding them anyway, along with marking the BUFFER_SIZE_WARNINGS as false positives on scan.coverity.com. Change-Id: If7fa157eca565842109f32fee0399ac183b19ec7 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* features/locks: Move logging outside of a locked regionVijay Bellur2018-11-191-3/+3
| | | | | | | | | | | | In pl_metalk(), logging was being done in a synchronized region. Moving the log out of the synchronized region to avoid other threads from being blocked on the lock. Thanks to Yaniv Kaul for pointing this out. Change-Id: I0cb39fb23ae7c798ca9c42c390500491aa8e622b updates: bz#1644758 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* cluster/dht: sync brick root perms on add brickN Balachandran2018-11-191-16/+9
| | | | | | | | | | | | | | | | | If a single brick is added to the volume and the newly added brick is the first to respond to a dht_revalidate call, its stbuf will not be merged into local->stbuf as the brick does not yet have a layout. The is_permission_different check therefore fails to detect that an attr heal is required as it only considers the stbuf values from existing bricks. To fix this, merge all stbuf values into local->stbuf and use local->prebuf to store the correct directory attributes. Change-Id: Ic9e8b04a1ab9ed1248b6b056e3450bbafe32e1bc fixes: bz#1648298 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* glusterd/mux: Optimize brick disconnect handler codeMohammed Rafi KC2018-11-184-140/+85
| | | | | | | | | Removed unnecessary iteration during brick disconnect handler when multiplex is enabled. Change-Id: I62dd3337b7e7da085da5d76aaae206e0b0edff9f fixes: bz#1650115 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* lease: Treat unlk request as noop if lease not foundSoumya Koduri2018-11-171-2/+14
| | | | | | | | | | | | | | | | When the glusterfs server recalls the lease, it expects client to flush data and unlock the lease. If not it sets a timer (starting from the time it sends RECALL request) and post timeout, it revokes it. Here we could have a race where in client did send UNLK lease request but because of network delay it may have reached after server revokes it. To handle such situations, treat such requests as noop and return sucesss. Change-Id: I166402d10273f4f115ff04030ecbc14676a01663 updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* leases: Fix incorrect inode_ref/unrefsSoumya Koduri2018-11-172-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From testing & code-reading, found couple of places where we incorrectly unref the inode resulting in use_after_free crash or ref leaks. This patch addresses couple of them. a) When we try to grant the very first lease for a inode, inode_ref is taken in __add_lease. This ref should be active till all the leases granted to that inode are released (i.e, till lease_cnt > 0). In addition even after lease_cnt becomes '0', the inode should be active till all the blocked fops are resumed. Hence release this ref, after resuming all those fops. To avoid granting new leases while resuming those fops, defined a new boolean (blocked_fops_resuming) to flag it in the lease_ctx. b) 'new_lease_inode' which creates new lease_inode_entry and takes ref on inode, is used while adding that entry to client_list and recall_list. Use its counter function '__destroy_lease_inode' which does unref while removing those entries from those lists. c) inode ref is also taken when added to timer->data. Unref the same after processing timer->data. Change-Id: Ie77c78ff4a971e0d9a66178597fb34faf39205fb updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* glusterd: fix Resource leak coverity issueMohit Agrawal2018-11-161-2/+10
| | | | | | | | | | | | Problem: In commit bcf1e8b07491b48c5372924dbbbad5b8391c6d81 code was missed to free path return by function search_brick_path_from_proc This patch fixes CID: 1396668: Resource leak Change-Id: I4888c071c1058023c7e138a8bcb94ec97305fadf fixes: bz#1646892 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* cli: cluster.server-quorum-type help text is missingShwetha Acharya2018-11-161-4/+8
| | | | | | | | Added a default value "none" and additional description. Change-Id: I3a5c06f8ec1e502fc399860e4b5cb835102cd71d Updates: bz#1608512 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* afr: open_ftruncate_cbk should read fd from local->cont.open structSoumya Koduri2018-11-151-2/+2
| | | | | | | | | | | | afr_open stores the fd as part of its local->cont.open struct but when it calls ftruncate (if open flags contain O_TRUNC), the corresponding cbk function (afr_ open_ftruncate_cbk) is incorrectly referencing uninitialized local->fd. This patch fixes the same. Change-Id: Icbdedbd1b8cfea11d8f41b6e5c4cb4b44d989aba updates: bz#1648687 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* core: fix strncpy warningsKaleb S. KEITHLE2018-11-157-44/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings about buggy use of strncpy. Most uses that gcc warns about in our sources are exactly backwards; the 'limit' or len is the strlen/size of the _source param_, giving exactly zero protection against overruns. (Which was, after all, one of the points of using strncpy in the first place.) IOW, many warnings are about uses that look approximately like this: ... char dest[8]; char src[] = "this is a string longer than eight chars"; ... strncpy (dest, src, sizeof(src)); /* boom */ ... The len/limit should be sizeof(dest). Note: the above example has a definite over-run. In our source the overrun is typically only theoretical (but possibly exploitable.) Also strncpy doesn't null-terminate on truncation; snprintf does; prefer snprintf over strncpy. Mildly surprising that coverity doesn't warn/isn't warning about this. Change-Id: I022d5c6346a751e181ad44d9a099531c1172626e updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLE <kkeithle@redhat.com>
* core: fix strncpy warningsKaleb S. KEITHLE2018-11-153-7/+7
| | | | | | | | | | | | | | | | | | | Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings about buggy use of strncpy. e.g. warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length and warning: ‘strncpy’ specified bound depends on the length of the source argument Since we're copying string fragments and explicitly null terminating use memcpy to silence the warning Change-Id: I413d84b5f4157f15c99e9af3e154ce594d5bcdc1 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* posix: Fix null pointer dererfenceSusant Palai2018-11-142-0/+13
| | | | | | | | CID: 1124799 1214618 Change-Id: Iff05180983fe9600be0a2ce015a137e4efb8f533 updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* feature/shard: Fix coverity issue - Use after freeSusant Palai2018-11-141-1/+1
| | | | | | | | CID: 1325524 Change-Id: Ic713285bd9e76d8e4dc1815aa471087d279008b5 updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* glusterd/snapshot: copy-paste typoSanju Rakonde2018-11-131-1/+1
| | | | | | Change-Id: Ice3663084b2d0a0a10d75ad68fe5fe494f928250 updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* features/ctime: Fix Coverity issueSusant Palai2018-11-121-0/+1
| | | | | | | | CID : 1394632 Dereference after null check Change-Id: If0bef48b070935854e9d2988393dba07c9001cd2 updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* glusterfsd: Make each multiplexed brick sign inPrashanth Pai2018-11-121-1/+11
| | | | | | | | | | | | | | | | | | | | | | | NOTE: This change will be consumed by brick mux implementation of glusterd2 only. No corresponsing change in glusterd1 has been made. When a multiplexed brick process is shutting down, it sends sign out requests to glusterd for all bricks that it contains. However, sign in request is only sent for a single brick. Consequently, glusterd has to use some tricky means to repopulate pmap registry with information of multiplexed bricks during glusterd restart. This change makes each multiplexed brick send a sign in request to glusterd2 which ensures that glusterd2 can easily repopulate pmap registry with port information. As a bonus, sign in request will now also contain PID of the brick sending the request so that glusterd2 can rely on this instead of having to read/manage brick pidfiles. Change-Id: I409501515bd9a28ee7a960faca080e97cabe5858 updates: bz#1193929 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* md-cache: request ACLs related xattrs when mode changeKinglong Mee2018-11-121-0/+62
| | | | | | | | If glusterfs client changes mode, ACLs related xattrs may changed too. Change-Id: Ifa5bff1f77ab7b176e54da4607ea9c1e66fc5588 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* glusterd: don't call svcs_reconfigure for all volumes during op-version bump upAtin Mukherjee2018-11-121-8/+12
| | | | | | | | | | With having large number of volumes in a configuration having svcs_reconfigure () called for every volumes makes cluster.op-version bump up to time out. Instead call svcs_reconfigure () only once. Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9 Fixes: bz#1648237 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* quiesce : fix coverity issueSunny Kumar2018-11-121-0/+5
| | | | | | | | | This patch fixes 1388996 : Dereference null return value updates: bz#789278 Change-Id: I9351ae43736efd2f9abe4e1888dba89b6b3e1fe3 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* features/changelog: Avoid a potential null dereferenceVijay Bellur2018-11-121-4/+6
| | | | | | | | Addresses CID 1396292 Change-Id: I9141502a12fb3e18c04d07c79da87a5ebb2cfc23 updates: bz#789278 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* core: Portmap entries showing stale brick entries when bricks are downMohit Agrawal2018-11-122-2/+7
| | | | | | | | | | | | | | | | Problem: pmap is showing stale brick entries after down the brick because of glusterd_brick_rpc_notify call gf_is_service_running before call pmap_registry_remove to ensure about brick instance. Solutiom: 1) Change the condition in gf_is_pid_running to ensure about process existence, use open instead of access to achieve the same 2) Call search_brick_path_from_proc in __glusterd_brick_rpc_notify along with gf_is_service_running Change-Id: Ia663ac61c01fdee6c12f47c0300cdf93f19b6a19 fixes: bz#1646892 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* ctime: Enable ctime feature by defaultKotresh HR2018-11-113-13/+7
| | | | | | | | | | | | | | | | | | | | This patch does following. 1. Enable ctime feature by default. 2. Earlier, to enable the ctime feature, two options needed to be enabled a. gluster vol set <volname> utime on b. gluster vol set <volname> ctime on This is inconvenient from the usability point of view. Hence changed it to following single option a. gluster vol set <volname> ctime on fixes: bz#1624724 Change-Id: I04af0e5de1ea6126c58a06ba8a26e22f9f06344e Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd: allow shared-storage to use bricks under glusterd working directorySanju Rakonde2018-11-086-11/+15
| | | | | | | | | | | | | | | With commit 44e4db, we are not allowing user to create a volume using glusterd's working directory as a brick or any sub directory under glusterd's working directory as a brick.This has broken shared-storage since the volume "gluster-shared-storage" is created using the bricks under glusterd's working directory. With this patch, we let the "gluster-shared-storage" volume to use bricks under glusterd's working directory. fixes: bz#1647029 Change-Id: Ifcbcf4576eea12cf46f199dea287b29bd3ec3bfd Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* bd: remove from the buildAmar Tumballi2018-11-082-7/+0
| | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removed BD (block device) translator from the build. [1] - https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html Updates: bz#1635688 Change-Id: Ia96db406c58a7aef355dde6bc33523bb2492b1a9 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* features/locks:Use pthread_mutex_unlock() instead of pthread_mutex_lock()Vijay Bellur2018-11-081-1/+1
| | | | | | | | Fixes CID 1396581 Change-Id: Ic04091b5783a75d8e1e605a9c1c28b77fea048d3 updates: bz#789278 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* glupy: remove from the buildAmar Tumballi2018-11-081-5/+4
| | | | | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removing 'glupy' translator from the build. [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html This patch aims at clearing the translator from build and tests. A followup is needed to remove the code from repository. Updates: bz#1642810 Change-Id: I41d0c1956330c3bbca62c540ccf9ab01bbf3a092 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* xlators/experimental: remove from the buildAmar Tumballi2018-11-081-6/+2
| | | | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removing all experimental translators from the build. [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html Note that as followup patch, there would be a patch to remove the code. Updates: bz#1635688 Change-Id: I8ebc256517feb37fc7580104e8bebe27d047f959 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* cluster/afr: s/uuid_is_null/gf_uuid_is_nullPranith Kumar K2018-11-071-1/+1
| | | | | | Updates bz#1193929 Change-Id: I1b312dabffac7e101df8ce15557527fd28a2c61f Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* md-cache: new option "cache-glusterfs-acl" for virtual glusterfs ACLsKinglong Mee2018-11-061-3/+21
| | | | | | Change-Id: I020ab08dba48f13cf7b8908e96280f1e92e9b9db Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* md-cache: request cached xattrs at getxattr/fgetxattrKinglong Mee2018-11-062-5/+40
| | | | | | Change-Id: I8e3ad961164815683776850e3a5fd4f510003690 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* md-cache: extends xa_time when previous attributes equals cached attributesKinglong Mee2018-11-061-7/+15
| | | | | | | | | | | | Some operations like read/write only update iatt and ia_time, without any operion request xattrs from glusterfsd, the xa_time is timeout before ia_time always. This patch updates xa_time when update ia_ttime. Change-Id: I77e3984f38c1c4dbebfde9729b8117fbacde9674 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* md-cache: remove xattr setting after new file createdKinglong Mee2018-11-061-3/+0
| | | | | | | | | Fops of creating file does not request cached xattrs, the xattr in reply is not cached xattrs. Change-Id: Iab2db686e92466e72cfee8ac494e851d797c10b3 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* glusterd: initialise caps inside #ifdef HAVE_BD_XLATOR blockSanju Rakonde2018-11-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Note: The problem is seen when we disable bd xlator. Problem: When we create a volume, volume info file is having caps value as 15 in nodes which hosts bricks for that volume. Remainig nodes in cluster are not having caps field. When glusterd is restarted, peers are going into rejected state, because of this mismacth in configuration files. Cause: In glusterd_op_create_volume(), we initialise caps value as 15 in the beginning. Later, we check whether brick belongs to the same node or not. If brick doesn't belong to the same node, caps value will be set to 0. If brick belongs to the same node, we will change the caps value inside Solution: If brick doesn't belongs to the same node,caps is set to 0 and if brick belongs to same brick caps value is changed inside #ifdef HAVE_BD_XLATOR block. So, to have the consistency across the cluster, we need to initialise caps value inside #ifdef HAVE_BD_XLATOR block, only when brick belongs to the same node. fixes: bz#1645986 Change-Id: I2648f420b21d6e69e7c38b0f4736d41e0f15a7f5 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* lock: Do not allow meta-lock count to be more than oneSusant Palai2018-11-061-1/+34
| | | | | | | | | | | | | | | | | | | | In the current scheme of glusterfs where lock migration is experimental, (ideally) the rebalance process which is migrating the file should request for a metalock. Hence, the metalock count should not be more than one for an inode. In future, if there is a need for meta-lock from other clients, this patch can be reverted. Since pl_metalk is called as part of setxattr operation, any client process(non-rebalance) residing outside trusted network can exhaust memory of the server node by issuing setxattr repetitively on the metalock key. The current patch makes sure that more than one metalock cannot be granted on an inode. Fixes CVE-2018-14660 updates: bz#1644758 Change-Id: Ie1e697766388718804a9551bc58351808fe71069 Signed-off-by: Susant Palai <spalai@redhat.com>
* fuse: diagnostic FLUSH interruptCsaba Henk2018-11-063-2/+69
| | | | | | | | | | | | | | | | | | | We add dummy interrupt handling for the FLUSH fuse message. It can be enabled by the "--fuse-flush-handle-interrupt" hidden command line option, or "-ofuse-flush-handle-interrupt=yes" mount option. It serves no other than diagnostic & demonstational purposes -- to exercise the interrupt handling framework a bit and to give an usage example. Documentation is also provided that showcases interrupt handling via FLUSH. Change-Id: I522f1e798501d06b74ac3592a5f73c1ab0590c60 updates: #465 Signed-off-by: Csaba Henk <csaba@redhat.com>
* fuse: interrupt handling frameworkCsaba Henk2018-11-063-1/+512
| | | | | | | | | | | | | | | | | | | | - add sub-framework to send timed responses to kernel - add interrupt handler queue - implement INTERRUPT fuse_interrupt looks up handlers for interrupted messages in the queue. If found, it invokes the handler function. Else responds with EAGAIN with a delay. See spec at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/fuse.txt?h=v4.17#n148 and explanation in comments. Change-Id: I1a79d3679b31f36e14b4ac8f60b7f2c1ea2badfb updates: #465 Signed-off-by: Csaba Henk <csaba@redhat.com>
* all: fix the format string exceptionsAmar Tumballi2018-11-0527-79/+77
| | | | | | | | | | | | | | | | Currently, there are possibilities in few places, where a user-controlled (like filename, program parameter etc) string can be passed as 'fmt' for printf(), which can lead to segfault, if the user's string contains '%s', '%d' in it. While fixing it, makes sense to make the explicit check for such issues across the codebase, by making the format call properly. Fixes: CVE-2018-14661 Fixes: bz#1644763 Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* protocol: remove the option 'verify-volfile-checksum'Amar Tumballi2018-11-053-354/+5
| | | | | | | | | | | | | | | | 'getspec' operation is not used between 'client' and 'server' ever since we have off-loaded volfile management to glusterd, ie, at least 7 years. No reason to keep the dead code! The removed option had no meaning, as glusterd didn't provide a way to set (or unset) this option. So, no regression should be observed from any of the existing glusterfs deployment, supported or unsupported. Updates: CVE-2018-14653 Updates: bz#1644756 Change-Id: I4a2e0f673c5bcd4644976a61dbd2d37003a428eb Signed-off-by: Amar Tumballi <amarts@redhat.com>
* server: don't allow '/' in basenameAmar Tumballi2018-11-052-6/+19
| | | | | | | | | | | | | | | | Server stack needs to have all the sort of validation, assuming clients can be compromized. It is possible for a compromized client to send basenames with paths with '/', and with that create files without permission on server. By sanitizing the basename, and not allowing anything other than actual directory as the parent for any entry creation, we can mitigate the effects of clients not able to exploit the server. Fixes: CVE-2018-14651 Fixes: bz#1644755 Change-Id: I5dc0da0da2713452ff2b65ac2ddbccf1a267dc20 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* io-stats: prevent taking file dump on server sideAmar Tumballi2018-11-051-0/+9
| | | | | | | | | | | | By allowing clients taking dump in a file on brick process, we are allowing compromised clients to create io-stats dumps on server, which can exhaust all the available inodes. Fixes: CVE-2018-14659 Fixes: bz#1644757 Change-Id: I32bfde9d4fe646d819a45e627805b928cae2e1ca Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd : fix high sev coverity issueSunny Kumar2018-11-051-1/+4
| | | | | | | | | This patch fixes CID : 1174824 : RESOURCE_LEAK updates: bz#789278 Change-Id: I2a4f8b508995de112fa16e1094e44ecd4b625312 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* index: prevent arbitrary file creation outside entry-changes folderRavishankar N2018-11-051-0/+17
| | | | | | | | | | | | | | | | | | | Problem: A compromised client can set arbitrary values for the GF_XATTROP_ENTRY_IN_KEY and GF_XATTROP_ENTRY_OUT_KEY during xattrop fop. These values are consumed by index as a filename to be created/deleted according to the key. Thus it is possible to create/delete random files even outside the gluster volume boundary. Fix: Index expects the filename to be a basename, i.e. it must not contain any pathname components like "/" or "../". Enforce this. Fixes: CVE-2018-14654 Fixes: bz#1644760 Change-Id: I35f2a39257b5917d17283d0a4f575b92f783f143 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* features/snapview-server: change gf_log instances to gf_msgRaghavendra Bhat2018-11-056-289/+417
| | | | | | Change-Id: Ib8bdf210a896423abcd7413dd4896d424ac0f561 fixes: bz#1626610 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* dht: fix use after free in dht_rmdir_readdirp_cbkKinglong Mee2018-11-051-8/+11
| | | | | | | | | The frame is freed when linkfile exist in dht_rmdir_is_subvol_empty(), the following message use the freed local. Change-Id: I41191e8bd477f031a2444d5f15e578dc4f086e6b Updates: bz#1640489 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* glusterd: coverity fixesAtin Mukherjee2018-11-031-6/+8
| | | | | | | | | | | | | Addresses CIDs : 1124769, 1124852, 1124864, 1134024, 1229876, 1382382 Also addressed a spurious failure in tests/bugs/glusterd/df-results-post-replace-brick-operations.t to ensure post replace brick operation and before triggering 'df' from mount, client has connection to the newly replaced bricks. Change-Id: Ie5d7e02f89400a661491d7fc2a120d6f6a83a1cc Updates: bz#789278 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* posix : fix coverity issues in posix-entry-ops.cSunny Kumar2018-11-031-2/+14
| | | | | | | | | | | | This patch fixes CID: 1. 1389762 : Explicit null dereferenced 2. 1390462 : Argument cannot be negative 3. 1124552 : Explicit null dereferenced 4. 1356522 : Argument cannot be negative updates: bz#789278 Change-Id: I1262f3b4b61a6e65bb34884f46df9a24b8dd03f1 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>